diff --git a/.changeset/dull-birds-remain.md b/.changeset/dull-birds-remain.md new file mode 100644 index 00000000000..05404e5126b --- /dev/null +++ b/.changeset/dull-birds-remain.md @@ -0,0 +1,8 @@ +--- +'@iota/create-dapp': patch +'@iota/iota-sdk': patch +'@iota/dapp-kit': patch +'@iota/kiosk': patch +--- + +Update documentation urls diff --git a/Cargo.lock b/Cargo.lock index 0c6f782e081..014b26fbc39 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -173,7 +173,7 @@ dependencies = [ [[package]] name = "anemo" version = "0.0.0" -source = "git+https://github.com/mystenlabs/anemo.git?rev=dbb5a074c2d25660525ab5d36d65ff0cb8051949#dbb5a074c2d25660525ab5d36d65ff0cb8051949" +source = "git+https://github.com/mystenlabs/anemo.git?rev=e609f7697ed6169bf0760882a0b6c032a57e4f3b#e609f7697ed6169bf0760882a0b6c032a57e4f3b" dependencies = [ "anyhow", "async-trait", @@ -208,18 +208,18 @@ dependencies = [ [[package]] name = "anemo-build" version = "0.0.0" -source = "git+https://github.com/mystenlabs/anemo.git?rev=dbb5a074c2d25660525ab5d36d65ff0cb8051949#dbb5a074c2d25660525ab5d36d65ff0cb8051949" +source = "git+https://github.com/mystenlabs/anemo.git?rev=e609f7697ed6169bf0760882a0b6c032a57e4f3b#e609f7697ed6169bf0760882a0b6c032a57e4f3b" dependencies = [ "prettyplease", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] [[package]] name = "anemo-cli" version = "0.0.0" -source = "git+https://github.com/mystenlabs/anemo.git?rev=dbb5a074c2d25660525ab5d36d65ff0cb8051949#dbb5a074c2d25660525ab5d36d65ff0cb8051949" +source = "git+https://github.com/mystenlabs/anemo.git?rev=e609f7697ed6169bf0760882a0b6c032a57e4f3b#e609f7697ed6169bf0760882a0b6c032a57e4f3b" dependencies = [ "anemo", "anemo-tower", @@ -235,7 +235,7 @@ dependencies = [ [[package]] name = "anemo-tower" version = "0.0.0" -source = "git+https://github.com/mystenlabs/anemo.git?rev=dbb5a074c2d25660525ab5d36d65ff0cb8051949#dbb5a074c2d25660525ab5d36d65ff0cb8051949" +source = "git+https://github.com/mystenlabs/anemo.git?rev=e609f7697ed6169bf0760882a0b6c032a57e4f3b#e609f7697ed6169bf0760882a0b6c032a57e4f3b" dependencies = [ "anemo", "bytes", @@ -425,7 +425,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" dependencies = [ - "quote 1.0.37", + "quote", "syn 1.0.109", ] @@ -437,8 +437,8 @@ checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ "num-bigint 0.4.6", "num-traits", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -510,8 +510,8 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -800,8 +800,8 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", "synstructure 0.12.6", ] @@ -812,8 +812,8 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -917,8 +917,8 @@ dependencies = [ "async-graphql-parser", "darling 0.20.10", "proc-macro-crate 1.3.1", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "strum 0.25.0", "syn 2.0.77", "thiserror", @@ -954,8 +954,8 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -976,8 +976,8 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -993,8 +993,8 @@ version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -1042,8 +1042,8 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -1805,8 +1805,8 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3deeecb812ca5300b7d3f66f730cc2ebd3511c3d36c691dd79c165d5b19a26e3" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -1859,8 +1859,8 @@ dependencies = [ "lazycell", "peeking_take_while", "prettyplease", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "regex", "rustc-hash 1.1.0", "shlex", @@ -1881,8 +1881,8 @@ dependencies = [ "lazycell", "log", "prettyplease", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "regex", "rustc-hash 1.1.0", "shlex", @@ -2249,8 +2249,8 @@ checksum = "e10ca87c81aaa3a949dbbe2b5e6c2c45dbc94ba4897e45ea31ff9ec5087be3dc" dependencies = [ "cached_proc_macro_types", "darling 0.14.4", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -2489,8 +2489,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck 0.5.0", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -3170,8 +3170,8 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -3226,8 +3226,8 @@ dependencies = [ "darling 0.20.10", "once_cell", "ouroboros 0.18.4", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "strsim 0.10.0", "syn 2.0.77", "thiserror", @@ -3252,7 +3252,7 @@ checksum = "25a69ecdf4aa110fed1c0c8de290bc8ccb2835388733cf2f418f0abdf6ff3899" dependencies = [ "cynic-codegen", "darling 0.20.10", - "quote 1.0.37", + "quote", "syn 2.0.77", ] @@ -3284,8 +3284,8 @@ checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "strsim 0.10.0", "syn 1.0.109", ] @@ -3298,8 +3298,8 @@ checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "strsim 0.11.1", "syn 2.0.77", ] @@ -3311,7 +3311,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ "darling_core 0.14.4", - "quote 1.0.37", + "quote", "syn 1.0.109", ] @@ -3322,7 +3322,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", - "quote 1.0.37", + "quote", "syn 2.0.77", ] @@ -3442,8 +3442,8 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -3453,8 +3453,8 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -3464,8 +3464,8 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -3476,8 +3476,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "convert_case 0.4.0", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "rustc_version", "syn 2.0.77", ] @@ -3497,10 +3497,10 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", - "unicode-xid 0.2.6", + "unicode-xid", ] [[package]] @@ -3530,8 +3530,8 @@ checksum = "e7f2c3de51e2ba6bf2a648285696137aaf0f5f487bcbea93972fe8a364e131a4" dependencies = [ "diesel_table_macro_syntax", "dsl_auto_type", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -3671,8 +3671,8 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -3726,8 +3726,8 @@ dependencies = [ "darling 0.20.10", "either", "heck 0.5.0", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -3964,8 +3964,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" dependencies = [ "heck 0.5.0", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -3983,8 +3983,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa18ce2bc66555b3218614519ac839ddb759a7d6720732f979ef8d13be147ecd" dependencies = [ "once_cell", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -4003,8 +4003,8 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bf679796c0322556351f287a51b49e48f7c4986e727b5dd78c972d30e2e16cc" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -4170,8 +4170,8 @@ dependencies = [ "ethers-etherscan", "eyre", "prettyplease", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "regex", "reqwest 0.11.27", "serde", @@ -4191,8 +4191,8 @@ dependencies = [ "const-hex", "ethers-contract-abigen", "ethers-core", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "serde_json", "syn 2.0.77", ] @@ -4224,7 +4224,7 @@ dependencies = [ "tempfile", "thiserror", "tiny-keccak", - "unicode-xid 0.2.6", + "unicode-xid", ] [[package]] @@ -4518,8 +4518,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c0c2af2157f416cb885e11d36cd0de2753f6d5384752d364075c835f5f8f891" dependencies = [ "convert_case 0.6.0", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -4528,7 +4528,7 @@ name = "fastcrypto-derive" version = "0.1.3" source = "git+https://github.com/MystenLabs/fastcrypto?rev=5f2c63266a065996d53f98156f0412782b468597#5f2c63266a065996d53f98156f0412782b468597" dependencies = [ - "quote 1.0.37", + "quote", "syn 1.0.109", ] @@ -4660,8 +4660,8 @@ dependencies = [ "num-bigint 0.3.3", "num-integer", "num-traits", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -4883,8 +4883,8 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -5003,8 +5003,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f636605b743120a8d32ed92fc27b6cde1a769f8f936c065151eb66f88ded513c" dependencies = [ "proc-macro-error2", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -5039,8 +5039,8 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -5698,8 +5698,8 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -5801,8 +5801,8 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -6113,8 +6113,8 @@ dependencies = [ name = "iota-analytics-indexer-derive" version = "0.8.0-alpha" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -6902,7 +6902,7 @@ dependencies = [ name = "iota-graphql-config" version = "0.8.0-alpha" dependencies = [ - "quote 1.0.37", + "quote", "syn 1.0.109", ] @@ -7584,8 +7584,8 @@ version = "0.8.0-alpha" dependencies = [ "derive-syn-parse", "itertools 0.13.0", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", "unescape", ] @@ -7650,8 +7650,8 @@ name = "iota-proc-macros" version = "0.8.0-alpha" dependencies = [ "msim-macros", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -7673,8 +7673,8 @@ dependencies = [ name = "iota-protocol-config-macros" version = "0.8.0-alpha" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -8531,7 +8531,7 @@ dependencies = [ name = "iota-util-mem-derive" version = "0.8.0-alpha" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2", "syn 1.0.109", "synstructure 0.12.6", ] @@ -8841,8 +8841,8 @@ checksum = "fc660a9389e2748e794a40673a4155d501f32db667757cdb80edeff0306b489b" dependencies = [ "heck 0.5.0", "proc-macro-crate 3.2.0", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -8999,7 +8999,7 @@ dependencies = [ "string_cache", "term", "tiny-keccak", - "unicode-xid 0.2.6", + "unicode-xid", "walkdir", ] @@ -9279,8 +9279,8 @@ dependencies = [ "beef", "fnv", "lazy_static", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "regex-syntax 0.8.4", "syn 2.0.77", ] @@ -9459,8 +9459,8 @@ version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -9481,8 +9481,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffb161cc72176cb37aa47f1fc520d3ef02263d67d661f44f05d05a079e1237fd" dependencies = [ "migrations_internals", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", ] [[package]] @@ -9583,8 +9583,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" dependencies = [ "cfg-if", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -10019,7 +10019,7 @@ dependencies = [ name = "move-proc-macros" version = "0.1.0" dependencies = [ - "quote 1.0.37", + "quote", "syn 2.0.77", ] @@ -10256,8 +10256,8 @@ version = "0.1.0" source = "git+https://github.com/iotaledger/iota-sim.git?rev=f16ef50ba7d874fe1f0960f248f6c651a634d6a5#f16ef50ba7d874fe1f0960f248f6c651a634d6a5" dependencies = [ "darling 0.14.4", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -10327,8 +10327,8 @@ checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro-error", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", "synstructure 0.12.6", ] @@ -10392,8 +10392,8 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "254a5372af8fc138e36684761d3c0cdb758a4410e938babcff1c860ce14ddbfc" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -10723,8 +10723,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ "proc-macro-crate 3.2.0", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -10860,8 +10860,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" dependencies = [ "bytes", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -11032,8 +11032,8 @@ checksum = "ec4c6225c69b4ca778c0aea097321a64c421cf4577b331c61b229267edabb6f8" dependencies = [ "heck 0.4.1", "proc-macro-error", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -11045,9 +11045,9 @@ checksum = "39b0deead1528fd0e5947a8546a9642a9777c25f6e1e26f34c97b204bbb465bd" dependencies = [ "heck 0.4.1", "itertools 0.12.1", - "proc-macro2 1.0.86", + "proc-macro2", "proc-macro2-diagnostics", - "quote 1.0.37", + "quote", "syn 2.0.77", ] @@ -11144,8 +11144,8 @@ checksum = "e9567693dd2f9a4339cb0a54adfcc0cb431c0ac88b2e46c6ddfb5f5d11a1cc4f" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro-error", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -11204,8 +11204,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" dependencies = [ "proc-macro-crate 1.3.1", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -11216,8 +11216,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ "proc-macro-crate 3.2.0", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -11496,8 +11496,8 @@ checksum = "94429506bde1ca69d1b5601962c73f4172ab4726571a59ea95931218cb0e930e" dependencies = [ "pest", "pest_meta", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -11570,8 +11570,8 @@ checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" dependencies = [ "phf_generator", "phf_shared 0.11.2", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -11608,8 +11608,8 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -11867,7 +11867,7 @@ version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2", "syn 2.0.77", ] @@ -11946,8 +11946,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", "version_check", ] @@ -11958,8 +11958,8 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "version_check", ] @@ -11969,8 +11969,8 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", ] [[package]] @@ -11980,20 +11980,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" dependencies = [ "proc-macro-error-attr2", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid 0.1.0", -] - [[package]] name = "proc-macro2" version = "1.0.86" @@ -12009,8 +12000,8 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", "version_check", "yansi 1.0.1", @@ -12088,13 +12079,13 @@ dependencies = [ [[package]] name = "proptest-derive" -version = "0.3.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90b46295382dc76166cb7cf2bb4a97952464e4b7ed5a43e6cd34e1fec3349ddc" +checksum = "4ee1c9ac207483d5e7db4940700de86a9aae46ef90c48b57f99fe7edb8345e49" dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.44", + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] @@ -12136,8 +12127,8 @@ checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" dependencies = [ "anyhow", "itertools 0.13.0", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -12254,22 +12245,13 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", -] - [[package]] name = "quote" version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2", ] [[package]] @@ -12476,8 +12458,8 @@ version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a25d631e41bfb5fdcde1d4e2215f62f7f0afa3ff11e26563765bd6ea1d229aeb" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -12542,8 +12524,8 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -12814,8 +12796,8 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -12918,8 +12900,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7229b505ae0706e64f37ffc54a9c163e11022a6636d58fe1f3f52018257ff9f7" dependencies = [ "cfg-if", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "rustc_version", "syn 1.0.109", "unicode-ident", @@ -13305,8 +13287,8 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5af959c8bf6af1aff6d2b463a57f71aae53d1332da58419e30ad8dc7011d951" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -13362,8 +13344,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" dependencies = [ "proc-macro-crate 3.2.0", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -13404,8 +13386,8 @@ version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "serde_derive_internals", "syn 2.0.77", ] @@ -13609,8 +13591,8 @@ version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -13620,8 +13602,8 @@ version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -13654,8 +13636,8 @@ version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -13721,8 +13703,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" dependencies = [ "darling 0.20.10", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -13733,8 +13715,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" dependencies = [ "darling 0.20.10", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -13780,8 +13762,8 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -14100,8 +14082,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "990079665f075b699031e9c08fd3ab99be5029b96f3b78dc0709e8f77e4efebf" dependencies = [ "heck 0.4.1", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -14112,8 +14094,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03c3c6b7927ffe7ecaa769ee0e3994da3b8cafc8f444578982c83ecb161af917" dependencies = [ "heck 0.5.0", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -14202,7 +14184,7 @@ dependencies = [ "lalrpop-util", "phf", "thiserror", - "unicode-xid 0.2.6", + "unicode-xid", ] [[package]] @@ -14359,8 +14341,8 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2835db23c4724c05a2f85b81c4681f4aa8ea158edc8a7f4ad791c916fb766c2e" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -14454,8 +14436,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ "heck 0.4.1", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "rustversion", "syn 1.0.109", ] @@ -14467,8 +14449,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ "heck 0.4.1", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "rustversion", "syn 2.0.77", ] @@ -14480,8 +14462,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ "heck 0.5.0", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "rustversion", "syn 2.0.77", ] @@ -14572,25 +14554,14 @@ dependencies = [ "symbolic-common", ] -[[package]] -name = "syn" -version = "0.15.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid 0.1.0", -] - [[package]] name = "syn" version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "unicode-ident", ] @@ -14600,8 +14571,8 @@ version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "unicode-ident", ] @@ -14626,10 +14597,10 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", - "unicode-xid 0.2.6", + "unicode-xid", ] [[package]] @@ -14638,8 +14609,8 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -14697,8 +14668,8 @@ checksum = "99f688a08b54f4f02f0a3c382aefdb7884d3d69609f785bd253dc033243e3fe4" dependencies = [ "heck 0.4.1", "proc-macro-error", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -14866,8 +14837,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48db3bbc562408b2111f3a0c96ec416ffa3ab66f8a6ab42579b608b9f74744e1" dependencies = [ "cargo_metadata 0.15.4", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "serde", "strum_macros 0.24.3", ] @@ -14882,8 +14853,8 @@ dependencies = [ "if_chain", "itertools 0.10.5", "lazy_static", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "subprocess", "syn 2.0.77", "test-fuzz-internal", @@ -14930,8 +14901,8 @@ version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -15104,8 +15075,8 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -15114,8 +15085,8 @@ name = "tokio-macros" version = "2.4.0" source = "git+https://github.com/iotaledger/tokio-madsim-fork.git?branch=main#e34a35287024b341db16139a402508aaea8ec955" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -15329,9 +15300,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe4ee8877250136bd7e3d2331632810a4df4ea5e004656990d8d66d2f5ee8a67" dependencies = [ "prettyplease", - "proc-macro2 1.0.86", + "proc-macro2", "prost-build", - "quote 1.0.37", + "quote", "syn 2.0.77", ] @@ -15471,8 +15442,8 @@ version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -15575,8 +15546,8 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b79e2e9c9ab44c6d7c20d5976961b47e8f49ac199154daa514b77cd1ab536625" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -15722,8 +15693,8 @@ name = "typed-store-derive" version = "0.8.0-alpha" dependencies = [ "itertools 0.13.0", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -15767,7 +15738,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a615d6c2764852a2e88a4f16e9ce1ea49bb776b5872956309e170d63a042a34f" dependencies = [ - "quote 1.0.37", + "quote", "syn 2.0.77", ] @@ -15843,12 +15814,6 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - [[package]] name = "unicode-xid" version = "0.2.6" @@ -15973,7 +15938,7 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aae2faf80ac463422992abf4de234731279c058aaf33171ca70277c98406b124" dependencies = [ - "quote 1.0.37", + "quote", "syn 1.0.109", ] @@ -16077,8 +16042,8 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", "wasm-bindgen-shared", ] @@ -16101,7 +16066,7 @@ version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ - "quote 1.0.37", + "quote", "wasm-bindgen-macro-support", ] @@ -16111,8 +16076,8 @@ version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -16307,8 +16272,8 @@ version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -16318,8 +16283,8 @@ version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -16708,8 +16673,8 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", "synstructure 0.13.1", ] @@ -16757,8 +16722,8 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -16777,8 +16742,8 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", "synstructure 0.13.1", ] @@ -16799,8 +16764,8 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] @@ -16821,8 +16786,8 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2", + "quote", "syn 2.0.77", ] diff --git a/Cargo.toml b/Cargo.toml index a7e175930f1..b5b7c3e7463 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -207,9 +207,9 @@ unexpected_cfgs = { level = "warn", check-cfg = ['cfg(msim)', 'cfg(fail_points)' [workspace.dependencies] # external dependencies # anemo dependencies -anemo = { git = "https://github.com/mystenlabs/anemo.git", rev = "dbb5a074c2d25660525ab5d36d65ff0cb8051949" } -anemo-build = { git = "https://github.com/mystenlabs/anemo.git", rev = "dbb5a074c2d25660525ab5d36d65ff0cb8051949" } -anemo-tower = { git = "https://github.com/mystenlabs/anemo.git", rev = "dbb5a074c2d25660525ab5d36d65ff0cb8051949" } +anemo = { git = "https://github.com/mystenlabs/anemo.git", rev = "e609f7697ed6169bf0760882a0b6c032a57e4f3b" } +anemo-build = { git = "https://github.com/mystenlabs/anemo.git", rev = "e609f7697ed6169bf0760882a0b6c032a57e4f3b" } +anemo-tower = { git = "https://github.com/mystenlabs/anemo.git", rev = "e609f7697ed6169bf0760882a0b6c032a57e4f3b" } anyhow = "1.0.71" arc-swap = { version = "1.5.1", features = ["serde"] } async-graphql = "=7.0.1" @@ -295,7 +295,7 @@ pretty_assertions = "1.3.0" proc-macro2 = "1.0.47" prometheus = "0.13.3" proptest = "1.1.0" -proptest-derive = "0.3.0" +proptest-derive = "0.5.1" prost = "0.13" protobuf = { version = "2.28", features = ["with-bytes"] } quinn-proto = "0.11.6" diff --git a/apps/apps-backend/src/app.module.ts b/apps/apps-backend/src/app.module.ts index b7fd88272e7..d9272d12ba0 100644 --- a/apps/apps-backend/src/app.module.ts +++ b/apps/apps-backend/src/app.module.ts @@ -8,7 +8,7 @@ import { ConfigModule } from '@nestjs/config'; import { AnalyticsModule } from './analytics/analytics.module'; import { FeaturesModule } from './features/features.module'; -import { MonitorNetworkModule } from './monitor-network/monitor-network.module'; +import { MonitorNetworkModule } from './monitor-network/monitorNetwork.module'; import { PricesModule } from './prices/prices.module'; import { RestrictedModule } from './restricted/restricted.module'; import { HealthModule } from './health/health.module'; diff --git a/apps/apps-backend/src/features/features.controller.ts b/apps/apps-backend/src/features/features.controller.ts index a3f3dbbdd3f..78f31bb5a20 100644 --- a/apps/apps-backend/src/features/features.controller.ts +++ b/apps/apps-backend/src/features/features.controller.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { Controller, Get } from '@nestjs/common'; -import { Feature } from '@iota/core/constants/features.enum'; +import { Feature } from '@iota/core/enums/features.enums'; @Controller('/api/features') export class FeaturesController { diff --git a/apps/apps-backend/src/monitor-network/monitor-network.controller.ts b/apps/apps-backend/src/monitor-network/monitorNetwork.controller.ts similarity index 100% rename from apps/apps-backend/src/monitor-network/monitor-network.controller.ts rename to apps/apps-backend/src/monitor-network/monitorNetwork.controller.ts diff --git a/apps/apps-backend/src/monitor-network/monitor-network.module.ts b/apps/apps-backend/src/monitor-network/monitorNetwork.module.ts similarity index 74% rename from apps/apps-backend/src/monitor-network/monitor-network.module.ts rename to apps/apps-backend/src/monitor-network/monitorNetwork.module.ts index 0273c17be8b..9897c7598b5 100644 --- a/apps/apps-backend/src/monitor-network/monitor-network.module.ts +++ b/apps/apps-backend/src/monitor-network/monitorNetwork.module.ts @@ -3,7 +3,7 @@ import { Module } from '@nestjs/common'; -import { MonitorNetworkController } from './monitor-network.controller'; +import { MonitorNetworkController } from './monitorNetwork.controller'; @Module({ controllers: [MonitorNetworkController], diff --git a/apps/apps-backend/tsconfig.json b/apps/apps-backend/tsconfig.json index 62acc1f8668..1ee903b9da4 100644 --- a/apps/apps-backend/tsconfig.json +++ b/apps/apps-backend/tsconfig.json @@ -18,7 +18,7 @@ "forceConsistentCasingInFileNames": false, "noFallthroughCasesInSwitch": false, "paths": { - "@iota/core/constants/*": ["./../core/src/constants/*"] + "@iota/core/enums/*": ["./../core/src/enums/*"], } } } diff --git a/apps/apps-backend/types/iota-core.d.ts b/apps/apps-backend/types/iota-core.d.ts index e51933507ea..b5ad75d0244 100644 --- a/apps/apps-backend/types/iota-core.d.ts +++ b/apps/apps-backend/types/iota-core.d.ts @@ -1,4 +1,4 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -declare module '@iota/core/constants/features.enum'; +declare module '@iota/core/enums/features.enums'; diff --git a/apps/core/package.json b/apps/core/package.json index 0a8cd7acfeb..5a73c837e6b 100644 --- a/apps/core/package.json +++ b/apps/core/package.json @@ -36,6 +36,7 @@ "bignumber.js": "^9.1.1", "clsx": "^2.1.1", "formik": "^2.4.2", + "idb-keyval": "^6.2.1", "qrcode.react": "^4.0.1", "react": "^18.3.1", "react-dom": "^18.3.1", diff --git a/apps/core/src/components/index.ts b/apps/core/src/components/index.ts index 08ec0f2d601..e1173200254 100644 --- a/apps/core/src/components/index.ts +++ b/apps/core/src/components/index.ts @@ -5,7 +5,7 @@ export * from './coin'; export * from './cards'; export * from './gas'; export * from './icon'; -export * from './Inputs'; +export * from './inputs'; export * from './QR'; export * from './transaction'; export * from './buttons'; diff --git a/apps/core/src/components/Inputs/AddressInput.tsx b/apps/core/src/components/inputs/AddressInput.tsx similarity index 100% rename from apps/core/src/components/Inputs/AddressInput.tsx rename to apps/core/src/components/inputs/AddressInput.tsx diff --git a/apps/core/src/components/Inputs/SendTokenFormInput.tsx b/apps/core/src/components/inputs/SendTokenFormInput.tsx similarity index 100% rename from apps/core/src/components/Inputs/SendTokenFormInput.tsx rename to apps/core/src/components/inputs/SendTokenFormInput.tsx diff --git a/apps/core/src/components/Inputs/index.ts b/apps/core/src/components/inputs/index.ts similarity index 100% rename from apps/core/src/components/Inputs/index.ts rename to apps/core/src/components/inputs/index.ts diff --git a/apps/wallet-dashboard/components/transactions/TransactionIcon.tsx b/apps/core/src/components/transaction/TransactionIcon.tsx similarity index 88% rename from apps/wallet-dashboard/components/transactions/TransactionIcon.tsx rename to apps/core/src/components/transaction/TransactionIcon.tsx index 4acde307d43..55b54f0fc5b 100644 --- a/apps/wallet-dashboard/components/transactions/TransactionIcon.tsx +++ b/apps/core/src/components/transaction/TransactionIcon.tsx @@ -19,6 +19,8 @@ const icons = { Failed: , Loading: , PersonalMessage: , + ['Timelocked Staked']: , + ['Timelocked Unstaked']: , }; interface TransactionIconProps { diff --git a/apps/core/src/components/transaction/details/StakeTransactionDetails.tsx b/apps/core/src/components/transaction/details/StakeTransactionDetails.tsx index 7470f93b10f..b1aabfef024 100644 --- a/apps/core/src/components/transaction/details/StakeTransactionDetails.tsx +++ b/apps/core/src/components/transaction/details/StakeTransactionDetails.tsx @@ -3,7 +3,7 @@ import { CardType } from '@iota/apps-ui-kit'; import { IotaEvent } from '@iota/iota-sdk/client'; -import { formatPercentageDisplay } from '../../../utils'; +import { formatPercentageDisplay, getStakeDetailsFromEvent } from '../../../utils'; import { useGetValidatorsApy } from '../../../hooks'; import { TransactionAmount } from '../amount'; import { StakeTransactionInfo } from '../info'; @@ -24,20 +24,12 @@ export function StakeTransactionDetails({ activeAddress, renderExplorerLink, }: StakeTransactionDetailsProps) { - const json = event.parsedJson as { - amount: string; - validator_address: string; - epoch: string; - }; - const validatorAddress = json?.validator_address; - const stakedAmount = json?.amount; - const stakedEpoch = Number(json?.epoch || '0'); - + const { stakedAmount, validatorAddress, epoch } = getStakeDetailsFromEvent(event); const { data: rollingAverageApys } = useGetValidatorsApy(); - const { apy, isApyApproxZero } = rollingAverageApys?.[validatorAddress] ?? { apy: null, }; + const stakedEpoch = Number(epoch || '0'); return (
@@ -45,8 +37,9 @@ export function StakeTransactionDetails({ )} {stakedAmount && ( diff --git a/apps/core/src/components/transaction/index.ts b/apps/core/src/components/transaction/index.ts index bedefbc5d7e..e3b830d27d8 100644 --- a/apps/core/src/components/transaction/index.ts +++ b/apps/core/src/components/transaction/index.ts @@ -5,3 +5,4 @@ export * from './info'; export * from './summary'; export * from './TransactionReceipt'; +export * from './TransactionIcon'; diff --git a/apps/core/src/components/transaction/info/UnstakeTransactionInfo.tsx b/apps/core/src/components/transaction/info/UnstakeTransactionInfo.tsx index dd997e3d3b1..932fa20d5fc 100644 --- a/apps/core/src/components/transaction/info/UnstakeTransactionInfo.tsx +++ b/apps/core/src/components/transaction/info/UnstakeTransactionInfo.tsx @@ -8,7 +8,7 @@ import { IOTA_TYPE_ARG } from '@iota/iota-sdk/utils'; import type { GasSummaryType, RenderExplorerLink } from '../../../types'; import { useFormatCoin } from '../../../hooks'; import { Divider, KeyValueInfo, Panel, CardType } from '@iota/apps-ui-kit'; -import { GasSummary, Validator } from '../../..'; +import { GasSummary, getUnstakeDetailsFromEvent, Validator } from '../../..'; interface UnstakeTransactionInfoProps { activeAddress: string | null; @@ -23,15 +23,9 @@ export function UnstakeTransactionInfo({ gasSummary, renderExplorerLink, }: UnstakeTransactionInfoProps) { - const json = event.parsedJson as { - principal_amount?: string; - reward_amount?: string; - validator_address?: string; - }; - const principalAmount = json?.principal_amount || '0'; - const rewardAmount = json?.reward_amount || '0'; - const validatorAddress = json?.validator_address; - const totalAmount = BigInt(principalAmount) + BigInt(rewardAmount); + const { principalAmount, rewardAmount, totalAmount, validatorAddress } = + getUnstakeDetailsFromEvent(event); + const [formatPrinciple, symbol] = useFormatCoin(principalAmount, IOTA_TYPE_ARG); const [formatRewards] = useFormatCoin(rewardAmount || 0, IOTA_TYPE_ARG); diff --git a/apps/core/src/constants/index.ts b/apps/core/src/constants/index.ts index 834fd50145e..693b46c5973 100644 --- a/apps/core/src/constants/index.ts +++ b/apps/core/src/constants/index.ts @@ -6,6 +6,5 @@ export * from './recognizedPackages.constants'; export * from './coins.constants'; export * from './timelock.constants'; export * from './migration.constants'; -export * from './features.enum'; export * from './gas.constants'; export * from './time.constants'; diff --git a/apps/core/src/contexts/HiddenAssetsProvider.tsx b/apps/core/src/contexts/HiddenAssetsProvider.tsx new file mode 100644 index 00000000000..3d03e54669f --- /dev/null +++ b/apps/core/src/contexts/HiddenAssetsProvider.tsx @@ -0,0 +1,112 @@ +// Copyright (c) Mysten Labs, Inc. +// Modifications Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +import { get, set } from 'idb-keyval'; +import { + PropsWithChildren, + createContext, + useCallback, + useContext, + useEffect, + useState, + useRef, +} from 'react'; + +const HIDDEN_ASSET_IDS = 'hidden-asset-ids'; + +export type HiddenAssets = + | { + type: 'loading'; + } + | { + type: 'loaded'; + assetIds: string[]; + }; + +interface HiddenAssetContext { + hiddenAssets: HiddenAssets; + hideAsset: (assetId: string) => string | void; + showAsset: (assetId: string) => string | void; +} + +export const HiddenAssetsContext = createContext({ + hiddenAssets: { + type: 'loading', + }, + hideAsset: () => {}, + showAsset: () => {}, +}); + +export const HiddenAssetsProvider = ({ children }: PropsWithChildren) => { + const [hiddenAssets, setHiddenAssets] = useState({ + type: 'loading', + }); + const hiddenAssetIdsRef = useRef([]); + + useEffect(() => { + (async () => { + try { + const hiddenAssetsFromStorage = (await get(HIDDEN_ASSET_IDS)) ?? []; + hiddenAssetIdsRef.current = hiddenAssetsFromStorage; + setHiddenAssetIds(hiddenAssetsFromStorage); + } catch (error) { + console.error('Failed to load hidden assets from storage:', error); + setHiddenAssetIds([]); + } + })(); + }, []); + + function setHiddenAssetIds(hiddenAssetIds: string[]) { + hiddenAssetIdsRef.current = hiddenAssetIds; + setHiddenAssets({ + type: 'loaded', + assetIds: hiddenAssetIds, + }); + } + + const syncIdb = useCallback(async (nextState: string[], prevState: string[]) => { + try { + await set(HIDDEN_ASSET_IDS, nextState); + } catch (error) { + console.error('Error syncing with IndexedDB:', error); + // Revert to the previous state on failure + setHiddenAssetIds(prevState); + } + }, []); + + const hideAsset = useCallback((assetId: string) => { + const prevIds = [...hiddenAssetIdsRef.current]; + const newHiddenAssetIds = Array.from(new Set([...hiddenAssetIdsRef.current, assetId])); + setHiddenAssetIds(newHiddenAssetIds); + syncIdb(newHiddenAssetIds, prevIds); + return assetId; + }, []); + + const showAsset = useCallback((assetId: string) => { + // Ensure the asset exists in the hidden list + if (!hiddenAssetIdsRef.current.includes(assetId)) return; + + const prevIds = [...hiddenAssetIdsRef.current]; + // Compute the new list of hidden assets + const updatedHiddenAssetIds = hiddenAssetIdsRef.current.filter((id) => id !== assetId); + setHiddenAssetIds(updatedHiddenAssetIds); + syncIdb(updatedHiddenAssetIds, prevIds); + }, []); + + return ( + + {children} + + ); +}; + +export const useHiddenAssets = () => { + return useContext(HiddenAssetsContext); +}; diff --git a/apps/core/src/contexts/index.ts b/apps/core/src/contexts/index.ts index c592171afa8..fe492c59d09 100644 --- a/apps/core/src/contexts/index.ts +++ b/apps/core/src/contexts/index.ts @@ -2,3 +2,4 @@ // SPDX-License-Identifier: Apache-2.0 export * from './ThemeContext'; +export * from './HiddenAssetsProvider'; diff --git a/apps/core/src/enums/explorer-link-type.enums.ts b/apps/core/src/enums/explorerLinkType.enums.ts similarity index 100% rename from apps/core/src/enums/explorer-link-type.enums.ts rename to apps/core/src/enums/explorerLinkType.enums.ts diff --git a/apps/core/src/constants/features.enum.ts b/apps/core/src/enums/features.enums.ts similarity index 100% rename from apps/core/src/constants/features.enum.ts rename to apps/core/src/enums/features.enums.ts diff --git a/apps/core/src/enums/index.ts b/apps/core/src/enums/index.ts index 7c01aed335d..e7bd792140c 100644 --- a/apps/core/src/enums/index.ts +++ b/apps/core/src/enums/index.ts @@ -2,4 +2,5 @@ // SPDX-License-Identifier: Apache-2.0 export * from './theme.enums'; -export * from './explorer-link-type.enums'; +export * from './explorerLinkType.enums'; +export * from './features.enums'; diff --git a/apps/core/src/hooks/index.ts b/apps/core/src/hooks/index.ts index 1602541e57b..40489d25ff2 100644 --- a/apps/core/src/hooks/index.ts +++ b/apps/core/src/hooks/index.ts @@ -47,6 +47,8 @@ export * from './useOwnedNFT'; export * from './useNftDetails'; export * from './useCountdownByTimestamp'; export * from './useStakeRewardStatus'; +export * from './useGetNFTs'; export * from './useRecognizedPackages'; export * from './stake'; +export * from './ui'; diff --git a/apps/core/src/hooks/stake/useValidatorInfo.tsx b/apps/core/src/hooks/stake/useValidatorInfo.ts similarity index 97% rename from apps/core/src/hooks/stake/useValidatorInfo.tsx rename to apps/core/src/hooks/stake/useValidatorInfo.ts index f8d6dcd5a2f..b3d5b9833f9 100644 --- a/apps/core/src/hooks/stake/useValidatorInfo.tsx +++ b/apps/core/src/hooks/stake/useValidatorInfo.ts @@ -1,7 +1,7 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 import { useIotaClientQuery } from '@iota/dapp-kit'; -import { useGetValidatorsApy } from '../'; +import { useGetValidatorsApy } from '..'; export function useValidatorInfo({ validatorAddress }: { validatorAddress: string }) { const { diff --git a/apps/wallet-dashboard/components/Dialogs/Assets/constants/index.ts b/apps/core/src/hooks/ui/index.ts similarity index 67% rename from apps/wallet-dashboard/components/Dialogs/Assets/constants/index.ts rename to apps/core/src/hooks/ui/index.ts index 76b42558333..37bbc87557c 100644 --- a/apps/wallet-dashboard/components/Dialogs/Assets/constants/index.ts +++ b/apps/core/src/hooks/ui/index.ts @@ -1,4 +1,4 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -export * from './AssetsDialogView'; +export * from './usePageAssets'; diff --git a/apps/core/src/hooks/ui/usePageAssets.ts b/apps/core/src/hooks/ui/usePageAssets.ts new file mode 100644 index 00000000000..6fbd8f35836 --- /dev/null +++ b/apps/core/src/hooks/ui/usePageAssets.ts @@ -0,0 +1,131 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 +import { useState, useMemo, useRef, useEffect } from 'react'; +import { useGetNFTs, HiddenAssets, useOnScreen } from '../..'; + +export enum AssetCategory { + Visual = 'Visual', + Other = 'Other', + Hidden = 'Hidden', +} + +export function usePageAssets(address: string | null, hiddenAssets?: HiddenAssets) { + const [selectedAssetCategory, setSelectedAssetCategory] = useState(null); + const observerElem = useRef(null); + const { isIntersecting } = useOnScreen(observerElem); + const { + data: ownedAssets, + hasNextPage, + isFetchingNextPage, + fetchNextPage, + error, + isPending, + isError, + isFetching, + refetch, + } = useGetNFTs(address, hiddenAssets); + + const isAssetsLoaded = !!ownedAssets; + const isSpinnerVisible = isFetchingNextPage && hasNextPage; + + const filteredAssets = (() => { + if (!ownedAssets) return []; + switch (selectedAssetCategory) { + case AssetCategory.Visual: + return ownedAssets.visual; + case AssetCategory.Other: + return ownedAssets.other; + default: + return []; + } + })(); + + const filteredHiddenAssets = useMemo(() => { + return ( + ownedAssets?.hidden + .flatMap((data) => { + return { + data: data, + display: data?.display?.data, + }; + }) + .sort((nftA, nftB) => { + const nameA = nftA.display?.name || ''; + const nameB = nftB.display?.name || ''; + + if (nameA < nameB) { + return -1; + } else if (nameA > nameB) { + return 1; + } + return 0; + }) ?? [] + ); + }, [ownedAssets]); + + // Fetch the next page if the user scrolls to the bottom of the page + useEffect(() => { + if (isIntersecting && hasNextPage && !isFetchingNextPage) { + fetchNextPage(); + } + }, [isIntersecting, fetchNextPage, hasNextPage, isFetchingNextPage]); + + // select the default category if no category is selected and assets are loaded + useEffect(() => { + let computeSelectedCategory = false; + if ( + (selectedAssetCategory === AssetCategory.Visual && ownedAssets?.visual.length === 0) || + (selectedAssetCategory === AssetCategory.Other && ownedAssets?.other.length === 0) || + (selectedAssetCategory === AssetCategory.Hidden && ownedAssets?.hidden.length === 0) || + !selectedAssetCategory + ) { + computeSelectedCategory = true; + } + if (computeSelectedCategory && ownedAssets) { + const defaultCategory = + ownedAssets.visual.length > 0 + ? AssetCategory.Visual + : ownedAssets.other.length > 0 + ? AssetCategory.Other + : ownedAssets.hidden.length > 0 + ? AssetCategory.Hidden + : null; + setSelectedAssetCategory(defaultCategory); + } + }, [ownedAssets]); + + // Fetch the next page if there are no visual assets, other + hidden assets are present in multiples of 50, and there are more pages to fetch + useEffect(() => { + if ( + hasNextPage && + ownedAssets?.visual.length === 0 && + ownedAssets?.other.length + ownedAssets?.hidden.length > 0 && + (ownedAssets.other.length + ownedAssets.hidden.length) % 50 === 0 && + !isFetchingNextPage + ) { + fetchNextPage(); + setSelectedAssetCategory(null); + } + }, [hasNextPage, ownedAssets, isFetchingNextPage]); + + return { + // reexport from useGetNFTs + ownedAssets, + hasNextPage, + isFetchingNextPage, + fetchNextPage, + error, + isPending, + isError, + isFetching, + refetch, + + isAssetsLoaded, + filteredAssets, + filteredHiddenAssets, + selectedAssetCategory, + setSelectedAssetCategory, + observerElem, + isSpinnerVisible, + }; +} diff --git a/apps/wallet/src/ui/app/hooks/useGetNFTs.ts b/apps/core/src/hooks/useGetNFTs.ts similarity index 73% rename from apps/wallet/src/ui/app/hooks/useGetNFTs.ts rename to apps/core/src/hooks/useGetNFTs.ts index 8e891e129be..9fedb74b911 100644 --- a/apps/wallet/src/ui/app/hooks/useGetNFTs.ts +++ b/apps/core/src/hooks/useGetNFTs.ts @@ -2,10 +2,16 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { hasDisplayData, isKioskOwnerToken, useGetOwnedObjects, useKioskClient } from '@iota/core'; +import { + hasDisplayData, + isKioskOwnerToken, + useGetOwnedObjects, + useKioskClient, + HiddenAssets, + COIN_TYPE, +} from '../../'; import { type IotaObjectData } from '@iota/iota-sdk/client'; import { useMemo } from 'react'; -import { useHiddenAssets } from '../pages/home/assets/HiddenAssetsProvider'; type OwnedAssets = { visual: IotaObjectData[]; @@ -18,10 +24,13 @@ export enum AssetFilterTypes { Other = 'other', } -export function useGetNFTs(address?: string | null) { +const OBJECTS_PER_REQ = 50; + +export function useGetNFTs(address?: string | null, hiddenAssets?: HiddenAssets) { const kioskClient = useKioskClient(); const { data, + isFetching, isPending, error, isError, @@ -29,14 +38,14 @@ export function useGetNFTs(address?: string | null) { hasNextPage, fetchNextPage, isLoading, + refetch, } = useGetOwnedObjects( address, { - MatchNone: [{ StructType: '0x2::coin::Coin' }], + MatchNone: [{ StructType: COIN_TYPE }], }, - 50, + OBJECTS_PER_REQ, ); - const { hiddenAssets } = useHiddenAssets(); const assets = useMemo(() => { const ownedAssets: OwnedAssets = { @@ -45,13 +54,16 @@ export function useGetNFTs(address?: string | null) { hidden: [], }; - if (hiddenAssets.type === 'loading') { + if (hiddenAssets?.type === 'loading') { return ownedAssets; } else { const groupedAssets = data?.pages .flatMap((page) => page.data) .reduce((acc, curr) => { - if (curr.data?.objectId && hiddenAssets.assetIds.includes(curr.data?.objectId)) + if ( + curr.data?.objectId && + hiddenAssets?.assetIds?.includes(curr.data?.objectId) + ) acc.hidden.push(curr.data as IotaObjectData); else if (hasDisplayData(curr) || isKioskOwnerToken(kioskClient.network, curr)) acc.visual.push(curr.data as IotaObjectData); @@ -64,6 +76,7 @@ export function useGetNFTs(address?: string | null) { return { data: assets, + isFetching, isLoading, hasNextPage, isFetchingNextPage, @@ -71,5 +84,6 @@ export function useGetNFTs(address?: string | null) { isPending: isPending, isError: isError, error, + refetch, }; } diff --git a/apps/core/src/hooks/useOnScreen.ts b/apps/core/src/hooks/useOnScreen.ts index 33ae1701b8c..a1532e79818 100644 --- a/apps/core/src/hooks/useOnScreen.ts +++ b/apps/core/src/hooks/useOnScreen.ts @@ -19,7 +19,7 @@ export const useOnScreen = (elementRef: MutableRefObject) => { ); observer.observe(node); return () => observer.disconnect(); - }, [elementRef]); + }, [elementRef.current]); return { isIntersecting }; }; diff --git a/apps/core/src/hooks/useTransactionSummary.ts b/apps/core/src/hooks/useTransactionSummary.ts index f34bfa4001d..2e79dc69a00 100644 --- a/apps/core/src/hooks/useTransactionSummary.ts +++ b/apps/core/src/hooks/useTransactionSummary.ts @@ -11,7 +11,7 @@ import { IotaObjectChangeWithDisplay } from '../types'; import { getBalanceChangeSummary, getGasSummary, - getLabel, + getTransactionAction, getObjectChangeSummary, getObjectDisplayLookup, } from '../utils'; @@ -57,7 +57,7 @@ export function useTransactionSummary({ sender: transaction.transaction?.data.sender, balanceChanges: balanceChangeSummary, digest: transaction.digest, - label: getLabel(transaction, currentAddress), + label: getTransactionAction(transaction, currentAddress), objectSummary, status: transaction.effects?.status.status, timestamp: transaction.timestampMs, diff --git a/apps/core/src/interfaces/index.ts b/apps/core/src/interfaces/index.ts index 6b7810baaea..226be390797 100644 --- a/apps/core/src/interfaces/index.ts +++ b/apps/core/src/interfaces/index.ts @@ -2,3 +2,5 @@ // SPDX-License-Identifier: Apache-2.0 export * from './balanceChange.interfaces'; +export * from './transactions.interfaces'; +export * from './stakeEvent.interfaces'; diff --git a/apps/core/src/interfaces/stakeEvent.interfaces.ts b/apps/core/src/interfaces/stakeEvent.interfaces.ts new file mode 100644 index 00000000000..1b7514f0a64 --- /dev/null +++ b/apps/core/src/interfaces/stakeEvent.interfaces.ts @@ -0,0 +1,14 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +export interface StakeEventJson { + amount: string; + validator_address: string; + epoch: string; +} + +export interface UnstakeEventJson { + principal_amount?: string; + reward_amount?: string; + validator_address?: string; +} diff --git a/apps/wallet-dashboard/lib/interfaces/transactions.interface.ts b/apps/core/src/interfaces/transactions.interfaces.ts similarity index 87% rename from apps/wallet-dashboard/lib/interfaces/transactions.interface.ts rename to apps/core/src/interfaces/transactions.interfaces.ts index 3a7b9c789d8..4c4ea3c1962 100644 --- a/apps/wallet-dashboard/lib/interfaces/transactions.interface.ts +++ b/apps/core/src/interfaces/transactions.interfaces.ts @@ -16,6 +16,8 @@ export enum TransactionAction { Transaction = 'Transaction', Staked = 'Staked', Unstaked = 'Unstaked', + TimelockedStaked = 'Timelocked Staked', + TimelockedUnstaked = 'Timelocked Unstaked', Rewards = 'Rewards', PersonalMessage = 'PersonalMessage', } diff --git a/apps/core/src/utils/stake/checkIfIsTimelockedStaking.ts b/apps/core/src/utils/stake/checkIfIsTimelockedStaking.ts new file mode 100644 index 00000000000..b88e6166068 --- /dev/null +++ b/apps/core/src/utils/stake/checkIfIsTimelockedStaking.ts @@ -0,0 +1,25 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +import type { IotaTransactionBlockResponse } from '@iota/iota-sdk/client'; +import { STAKING_REQUEST_EVENT, UNSTAKING_REQUEST_EVENT } from '../../constants'; + +export function checkIfIsTimelockedStaking(events: IotaTransactionBlockResponse['events']) { + const TIMELOCKED_STAKING_EVENT_MODULE = 'timelocked_staking'; + if (!events) return { isTimelockedStaking: false, isTimelockedUnstaking: false }; + + const stakeTypeTransaction = events?.find(({ type }) => type === STAKING_REQUEST_EVENT); + const unstakeTypeTransaction = events?.find(({ type }) => type === UNSTAKING_REQUEST_EVENT); + + const isTimelockedStaking = + stakeTypeTransaction?.transactionModule === TIMELOCKED_STAKING_EVENT_MODULE; + const isTimelockedUnstaking = + unstakeTypeTransaction?.transactionModule === TIMELOCKED_STAKING_EVENT_MODULE; + + return { + isTimelockedStaking, + isTimelockedUnstaking, + stakeTypeTransaction, + unstakeTypeTransaction, + }; +} diff --git a/apps/core/src/utils/stake/getStakeDetailsFromEvent.ts b/apps/core/src/utils/stake/getStakeDetailsFromEvent.ts new file mode 100644 index 00000000000..d1e4f406d77 --- /dev/null +++ b/apps/core/src/utils/stake/getStakeDetailsFromEvent.ts @@ -0,0 +1,18 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +import { StakeEventJson } from '../../interfaces'; +import type { IotaEvent } from '@iota/iota-sdk/client'; + +export function getStakeDetailsFromEvent(event: IotaEvent): { + stakedAmount: string; + validatorAddress: string; + epoch: number; +} { + const eventJson = event.parsedJson as StakeEventJson; + return { + stakedAmount: eventJson.amount || '0', + validatorAddress: eventJson.validator_address || '', + epoch: Number(eventJson.epoch || '0'), + }; +} diff --git a/apps/core/src/utils/stake/getTransactionAmountForTimelocked.ts b/apps/core/src/utils/stake/getTransactionAmountForTimelocked.ts new file mode 100644 index 00000000000..42af4741347 --- /dev/null +++ b/apps/core/src/utils/stake/getTransactionAmountForTimelocked.ts @@ -0,0 +1,24 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +import type { IotaEvent } from '@iota/iota-sdk/client'; +import { + getStakeDetailsFromEvent, + getUnstakeDetailsFromEvent, + checkIfIsTimelockedStaking, +} from '.'; + +export function getTransactionAmountForTimelocked( + events: IotaEvent[], +): bigint | undefined | string { + if (!events) return; + const { isTimelockedStaking, isTimelockedUnstaking } = checkIfIsTimelockedStaking(events); + + if (isTimelockedStaking) { + const { stakedAmount } = getStakeDetailsFromEvent(events[0]); + return stakedAmount; + } else if (isTimelockedUnstaking) { + const { totalAmount } = getUnstakeDetailsFromEvent(events[0]); + return totalAmount; + } +} diff --git a/apps/core/src/utils/stake/getUnstakeDetailsFromEvent.ts b/apps/core/src/utils/stake/getUnstakeDetailsFromEvent.ts new file mode 100644 index 00000000000..5a9a13ddc57 --- /dev/null +++ b/apps/core/src/utils/stake/getUnstakeDetailsFromEvent.ts @@ -0,0 +1,23 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +import { UnstakeEventJson } from '../../interfaces'; +import type { IotaEvent } from '@iota/iota-sdk/client'; + +export function getUnstakeDetailsFromEvent(event: IotaEvent): { + principalAmount: string; + rewardAmount: string; + totalAmount: bigint; + validatorAddress: string; +} { + const eventJson = event.parsedJson as UnstakeEventJson; + const principalAmount = eventJson.principal_amount || '0'; + const rewardAmount = eventJson.reward_amount || '0'; + const totalAmount = BigInt(principalAmount) + BigInt(rewardAmount); + return { + principalAmount, + rewardAmount, + totalAmount, + validatorAddress: eventJson.validator_address || '', + }; +} diff --git a/apps/core/src/utils/stake/index.ts b/apps/core/src/utils/stake/index.ts index 6ecca7353f6..e742b3377ec 100644 --- a/apps/core/src/utils/stake/index.ts +++ b/apps/core/src/utils/stake/index.ts @@ -7,3 +7,7 @@ export * from './createStakeTransaction'; export * from './createTimelockedUnstakeTransaction'; export * from './createTimelockedStakeTransaction'; export * from './createValidationSchema'; +export * from './getStakeDetailsFromEvent'; +export * from './checkIfIsTimelockedStaking'; +export * from './getUnstakeDetailsFromEvent'; +export * from './getTransactionAmountForTimelocked'; diff --git a/apps/core/src/utils/transaction/getLabel.ts b/apps/core/src/utils/transaction/getLabel.ts deleted file mode 100644 index fbcd0e57649..00000000000 --- a/apps/core/src/utils/transaction/getLabel.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 -import { IotaTransactionBlockResponse } from '@iota/iota-sdk/client'; - -// todo: add more logic for deriving transaction label -export const getLabel = (transaction: IotaTransactionBlockResponse, currentAddress?: string) => { - const isSender = transaction.transaction?.data.sender === currentAddress; - // Rename to "Send" to Transaction - return isSender ? 'Transaction' : 'Receive'; -}; diff --git a/apps/core/src/utils/transaction/getTransactionAction.ts b/apps/core/src/utils/transaction/getTransactionAction.ts new file mode 100644 index 00000000000..5eeb25a4946 --- /dev/null +++ b/apps/core/src/utils/transaction/getTransactionAction.ts @@ -0,0 +1,30 @@ +// Copyright (c) Mysten Labs, Inc. +// Modifications Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +import { IotaTransactionBlockResponse } from '@iota/iota-sdk/client'; +import { TransactionAction } from '../../interfaces'; +import { checkIfIsTimelockedStaking } from '../stake/checkIfIsTimelockedStaking'; + +export const getTransactionAction = ( + transaction: IotaTransactionBlockResponse, + currentAddress?: string, +) => { + const { + isTimelockedStaking, + isTimelockedUnstaking, + stakeTypeTransaction, + unstakeTypeTransaction, + } = checkIfIsTimelockedStaking(transaction?.events); + + if (stakeTypeTransaction) { + return isTimelockedStaking ? TransactionAction.TimelockedStaked : TransactionAction.Staked; + } else if (unstakeTypeTransaction) { + return isTimelockedUnstaking + ? TransactionAction.TimelockedUnstaked + : TransactionAction.Unstaked; + } else { + const isSender = transaction.transaction?.data.sender === currentAddress; + return isSender ? TransactionAction.Transaction : TransactionAction.Receive; + } +}; diff --git a/apps/core/src/utils/transaction/index.ts b/apps/core/src/utils/transaction/index.ts index f5ef47663b6..1951221f6e4 100644 --- a/apps/core/src/utils/transaction/index.ts +++ b/apps/core/src/utils/transaction/index.ts @@ -4,7 +4,7 @@ export * from './getBalanceChangeSummary'; export * from './getObjectChangeSummary'; -export * from './getLabel'; +export * from './getTransactionAction'; export * from './getGasSummary'; export * from './groupByOwner'; export * from './getOwnerType'; diff --git a/apps/core/tailwind.config.ts b/apps/core/tailwind.config.ts index 6add2c1e8b4..917136bd1c6 100644 --- a/apps/core/tailwind.config.ts +++ b/apps/core/tailwind.config.ts @@ -4,7 +4,7 @@ import { type Config } from 'tailwindcss'; import colors from 'tailwindcss/colors'; -import uiKitResponsivePreset from '../../apps/ui-kit/src/lib/tailwind/responsive.preset'; +import uiKitResponsivePreset from '../../apps/ui-kit/src/lib/tailwind/responsive.presets'; export default { presets: [uiKitResponsivePreset], diff --git a/apps/explorer/src/lib/enums/imageVisibility.enum.ts b/apps/explorer/src/lib/enums/imageVisibility.enums.ts similarity index 100% rename from apps/explorer/src/lib/enums/imageVisibility.enum.ts rename to apps/explorer/src/lib/enums/imageVisibility.enums.ts diff --git a/apps/explorer/src/lib/enums/index.ts b/apps/explorer/src/lib/enums/index.ts index 21eccaf2e98..459938152ff 100644 --- a/apps/explorer/src/lib/enums/index.ts +++ b/apps/explorer/src/lib/enums/index.ts @@ -1,7 +1,7 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -export * from './objectViewMode.enum'; -export * from './objectFilterValue.enum'; -export * from './imageVisibility.enum'; -export * from './splitPaneKey.enum'; +export * from './objectViewMode.enums'; +export * from './objectFilterValue.enums'; +export * from './imageVisibility.enums'; +export * from './splitPaneKey.enums'; diff --git a/apps/explorer/src/lib/enums/objectFilterValue.enum.ts b/apps/explorer/src/lib/enums/objectFilterValue.enums.ts similarity index 100% rename from apps/explorer/src/lib/enums/objectFilterValue.enum.ts rename to apps/explorer/src/lib/enums/objectFilterValue.enums.ts diff --git a/apps/explorer/src/lib/enums/objectViewMode.enum.ts b/apps/explorer/src/lib/enums/objectViewMode.enums.ts similarity index 100% rename from apps/explorer/src/lib/enums/objectViewMode.enum.ts rename to apps/explorer/src/lib/enums/objectViewMode.enums.ts diff --git a/apps/explorer/src/lib/enums/splitPaneKey.enum.ts b/apps/explorer/src/lib/enums/splitPaneKey.enums.ts similarity index 100% rename from apps/explorer/src/lib/enums/splitPaneKey.enum.ts rename to apps/explorer/src/lib/enums/splitPaneKey.enums.ts diff --git a/apps/explorer/tailwind.config.ts b/apps/explorer/tailwind.config.ts index 553727d7246..4d1800c3212 100644 --- a/apps/explorer/tailwind.config.ts +++ b/apps/explorer/tailwind.config.ts @@ -5,7 +5,7 @@ import colors from 'tailwindcss/colors'; import { type Config } from 'tailwindcss'; // Note: exception for the tailwind preset import -import uiKitResponsivePreset from '../../apps/ui-kit/src/lib/tailwind/responsive.preset'; +import uiKitResponsivePreset from '../../apps/ui-kit/src/lib/tailwind/responsive.presets'; export default { presets: [uiKitResponsivePreset], diff --git a/apps/ui-kit/src/lib/components/atoms/button-segment/ButtonSegment.tsx b/apps/ui-kit/src/lib/components/atoms/button-segment/ButtonSegment.tsx index 6c092fab833..1024457df90 100644 --- a/apps/ui-kit/src/lib/components/atoms/button-segment/ButtonSegment.tsx +++ b/apps/ui-kit/src/lib/components/atoms/button-segment/ButtonSegment.tsx @@ -8,9 +8,9 @@ import { TEXT_COLORS_SELECTED, UNDERLINED, UNDERLINED_SELECTED, -} from './button-segment.classes'; +} from './buttonSegment.classes'; import cx from 'classnames'; -import { ButtonSegmentType } from './button-segment.enums'; +import { ButtonSegmentType } from './buttonSegment.enums'; import { ButtonUnstyled } from '../button'; interface ButtonSegmentProps { diff --git a/apps/ui-kit/src/lib/components/atoms/button-segment/button-segment.classes.ts b/apps/ui-kit/src/lib/components/atoms/button-segment/buttonSegment.classes.ts similarity index 100% rename from apps/ui-kit/src/lib/components/atoms/button-segment/button-segment.classes.ts rename to apps/ui-kit/src/lib/components/atoms/button-segment/buttonSegment.classes.ts diff --git a/apps/ui-kit/src/lib/components/atoms/button-segment/button-segment.enums.ts b/apps/ui-kit/src/lib/components/atoms/button-segment/buttonSegment.enums.ts similarity index 100% rename from apps/ui-kit/src/lib/components/atoms/button-segment/button-segment.enums.ts rename to apps/ui-kit/src/lib/components/atoms/button-segment/buttonSegment.enums.ts diff --git a/apps/ui-kit/src/lib/components/atoms/button-segment/index.ts b/apps/ui-kit/src/lib/components/atoms/button-segment/index.ts index f8b4143cc86..0c48b7e0022 100644 --- a/apps/ui-kit/src/lib/components/atoms/button-segment/index.ts +++ b/apps/ui-kit/src/lib/components/atoms/button-segment/index.ts @@ -2,4 +2,4 @@ // SPDX-License-Identifier: Apache-2.0 export * from './ButtonSegment'; -export * from './button-segment.enums'; +export * from './buttonSegment.enums'; diff --git a/apps/ui-kit/src/lib/components/atoms/button/button-variants/ButtonPill.tsx b/apps/ui-kit/src/lib/components/atoms/button/button-variants/ButtonPill.tsx index b502085574e..53556258c6a 100644 --- a/apps/ui-kit/src/lib/components/atoms/button/button-variants/ButtonPill.tsx +++ b/apps/ui-kit/src/lib/components/atoms/button/button-variants/ButtonPill.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { ButtonHtmlType } from '../button.enums'; -import { ButtonVariantProps } from './button-variants.types'; +import { ButtonVariantProps } from './buttonVariants.types'; export function ButtonPill({ htmlType = ButtonHtmlType.Button, diff --git a/apps/ui-kit/src/lib/components/atoms/button/button-variants/ButtonUnstyled.tsx b/apps/ui-kit/src/lib/components/atoms/button/button-variants/ButtonUnstyled.tsx index 1b4d64ad861..53400f13513 100644 --- a/apps/ui-kit/src/lib/components/atoms/button/button-variants/ButtonUnstyled.tsx +++ b/apps/ui-kit/src/lib/components/atoms/button/button-variants/ButtonUnstyled.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { ButtonHtmlType } from '../button.enums'; -import { ButtonVariantProps } from './button-variants.types'; +import { ButtonVariantProps } from './buttonVariants.types'; import cx from 'classnames'; export function ButtonUnstyled({ diff --git a/apps/ui-kit/src/lib/components/atoms/button/button-variants/button-variants.types.ts b/apps/ui-kit/src/lib/components/atoms/button/button-variants/buttonVariants.types.ts similarity index 100% rename from apps/ui-kit/src/lib/components/atoms/button/button-variants/button-variants.types.ts rename to apps/ui-kit/src/lib/components/atoms/button/button-variants/buttonVariants.types.ts diff --git a/apps/ui-kit/src/lib/components/atoms/info-box/InfoBox.tsx b/apps/ui-kit/src/lib/components/atoms/info-box/InfoBox.tsx index 7fb7216f423..bb668cbe24b 100644 --- a/apps/ui-kit/src/lib/components/atoms/info-box/InfoBox.tsx +++ b/apps/ui-kit/src/lib/components/atoms/info-box/InfoBox.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import cx from 'classnames'; -import { InfoBoxStyle, InfoBoxType } from './info-box.enums'; -import { BACKGROUND_COLORS, ICON_COLORS } from './info-box.classes'; +import { InfoBoxStyle, InfoBoxType } from './infoBox.enums'; +import { BACKGROUND_COLORS, ICON_COLORS } from './infoBox.classes'; export interface InfoBoxProps { /** diff --git a/apps/ui-kit/src/lib/components/atoms/info-box/index.ts b/apps/ui-kit/src/lib/components/atoms/info-box/index.ts index c4f12c2be81..fff4ed5d37a 100644 --- a/apps/ui-kit/src/lib/components/atoms/info-box/index.ts +++ b/apps/ui-kit/src/lib/components/atoms/info-box/index.ts @@ -2,4 +2,4 @@ // SPDX-License-Identifier: Apache-2.0 export * from './InfoBox'; -export * from './info-box.enums'; +export * from './infoBox.enums'; diff --git a/apps/ui-kit/src/lib/components/atoms/info-box/info-box.classes.ts b/apps/ui-kit/src/lib/components/atoms/info-box/infoBox.classes.ts similarity index 91% rename from apps/ui-kit/src/lib/components/atoms/info-box/info-box.classes.ts rename to apps/ui-kit/src/lib/components/atoms/info-box/infoBox.classes.ts index ce7136fa7e8..d78493a4af3 100644 --- a/apps/ui-kit/src/lib/components/atoms/info-box/info-box.classes.ts +++ b/apps/ui-kit/src/lib/components/atoms/info-box/infoBox.classes.ts @@ -1,7 +1,7 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { InfoBoxType } from './info-box.enums'; +import { InfoBoxType } from './infoBox.enums'; export const ICON_COLORS: Record = { [InfoBoxType.Default]: 'bg-neutral-96 dark:bg-neutral-12 text-neutral-10 dark:text-neutral-92', diff --git a/apps/ui-kit/src/lib/components/atoms/info-box/info-box.enums.ts b/apps/ui-kit/src/lib/components/atoms/info-box/infoBox.enums.ts similarity index 100% rename from apps/ui-kit/src/lib/components/atoms/info-box/info-box.enums.ts rename to apps/ui-kit/src/lib/components/atoms/info-box/infoBox.enums.ts diff --git a/apps/ui-kit/src/lib/components/atoms/visual-asset-card/VisualAssetCard.tsx b/apps/ui-kit/src/lib/components/atoms/visual-asset-card/VisualAssetCard.tsx index 99cfe9b1271..81ea419093c 100644 --- a/apps/ui-kit/src/lib/components/atoms/visual-asset-card/VisualAssetCard.tsx +++ b/apps/ui-kit/src/lib/components/atoms/visual-asset-card/VisualAssetCard.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { VisualAssetType } from './visual-asset-card.enums'; +import { VisualAssetType } from './visualAssetCard.enums'; import { ButtonUnstyled } from '../button'; import { MoreHoriz } from '@iota/ui-icons'; import cx from 'classnames'; diff --git a/apps/ui-kit/src/lib/components/atoms/visual-asset-card/index.ts b/apps/ui-kit/src/lib/components/atoms/visual-asset-card/index.ts index 05a2d49f88d..3e758c82d59 100644 --- a/apps/ui-kit/src/lib/components/atoms/visual-asset-card/index.ts +++ b/apps/ui-kit/src/lib/components/atoms/visual-asset-card/index.ts @@ -2,4 +2,4 @@ // SPDX-License-Identifier: Apache-2.0 export * from './VisualAssetCard'; -export * from './visual-asset-card.enums'; +export * from './visualAssetCard.enums'; diff --git a/apps/ui-kit/src/lib/components/atoms/visual-asset-card/visual-asset-card.enums.ts b/apps/ui-kit/src/lib/components/atoms/visual-asset-card/visualAssetCard.enums.ts similarity index 100% rename from apps/ui-kit/src/lib/components/atoms/visual-asset-card/visual-asset-card.enums.ts rename to apps/ui-kit/src/lib/components/atoms/visual-asset-card/visualAssetCard.enums.ts diff --git a/apps/ui-kit/src/lib/components/molecules/chip/Chip.tsx b/apps/ui-kit/src/lib/components/molecules/chip/Chip.tsx index 8d98db426aa..3fd593beec5 100644 --- a/apps/ui-kit/src/lib/components/molecules/chip/Chip.tsx +++ b/apps/ui-kit/src/lib/components/molecules/chip/Chip.tsx @@ -47,6 +47,10 @@ interface ChipProps { * Trailing element to show in the chip. */ trailingElement?: React.JSX.Element; + /** + * The button is disabled or not. + */ + disabled?: boolean; } export function Chip({ @@ -58,18 +62,20 @@ export function Chip({ avatar, leadingElement, trailingElement, + disabled, }: ChipProps) { const chipState = selected ? ChipState.Selected : ChipState.Default; return ( = { [DisplayStatsType.Default]: 'bg-neutral-96 dark:bg-neutral-10', diff --git a/apps/ui-kit/src/lib/components/molecules/display-stats/display-stats.enums.ts b/apps/ui-kit/src/lib/components/molecules/display-stats/displayStats.enums.ts similarity index 100% rename from apps/ui-kit/src/lib/components/molecules/display-stats/display-stats.enums.ts rename to apps/ui-kit/src/lib/components/molecules/display-stats/displayStats.enums.ts diff --git a/apps/ui-kit/src/lib/components/molecules/display-stats/index.ts b/apps/ui-kit/src/lib/components/molecules/display-stats/index.ts index 9203c88a7db..36d4c1dcf47 100644 --- a/apps/ui-kit/src/lib/components/molecules/display-stats/index.ts +++ b/apps/ui-kit/src/lib/components/molecules/display-stats/index.ts @@ -2,4 +2,4 @@ // SPDX-License-Identifier: Apache-2.0 export * from './DisplayStats'; -export * from './display-stats.enums'; +export * from './displayStats.enums'; diff --git a/apps/ui-kit/src/lib/components/molecules/dropdown/dropdown-position.enum.ts b/apps/ui-kit/src/lib/components/molecules/dropdown/dropdownPosition.enums.ts similarity index 100% rename from apps/ui-kit/src/lib/components/molecules/dropdown/dropdown-position.enum.ts rename to apps/ui-kit/src/lib/components/molecules/dropdown/dropdownPosition.enums.ts diff --git a/apps/ui-kit/src/lib/components/molecules/dropdown/index.ts b/apps/ui-kit/src/lib/components/molecules/dropdown/index.ts index 7661c872580..97c3abbbd0b 100644 --- a/apps/ui-kit/src/lib/components/molecules/dropdown/index.ts +++ b/apps/ui-kit/src/lib/components/molecules/dropdown/index.ts @@ -2,4 +2,4 @@ // SPDX-License-Identifier: Apache-2.0 export * from './Dropdown'; -export * from './dropdown-position.enum'; +export * from './dropdownPosition.enums'; diff --git a/apps/ui-kit/src/lib/components/molecules/segmented-button/SegmentedButton.tsx b/apps/ui-kit/src/lib/components/molecules/segmented-button/SegmentedButton.tsx index 7b3135fddec..195606ecec4 100644 --- a/apps/ui-kit/src/lib/components/molecules/segmented-button/SegmentedButton.tsx +++ b/apps/ui-kit/src/lib/components/molecules/segmented-button/SegmentedButton.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import { PropsWithChildren } from 'react'; -import { BACKGROUND_COLORS, OUTLINED_BORDER } from './segmented-button.classes'; +import { BACKGROUND_COLORS, OUTLINED_BORDER } from './segmentedButton.classes'; import cx from 'classnames'; -import { SegmentedButtonType } from './segmented-button.enums'; +import { SegmentedButtonType } from './segmentedButton.enums'; import { ButtonSegmentType } from '../../atoms'; interface SegmentedButtonProps { diff --git a/apps/ui-kit/src/lib/components/molecules/segmented-button/index.ts b/apps/ui-kit/src/lib/components/molecules/segmented-button/index.ts index 481c1f46d93..0df9efe8def 100644 --- a/apps/ui-kit/src/lib/components/molecules/segmented-button/index.ts +++ b/apps/ui-kit/src/lib/components/molecules/segmented-button/index.ts @@ -3,4 +3,4 @@ export * from './SegmentedButton'; -export * from './segmented-button.enums'; +export * from './segmentedButton.enums'; diff --git a/apps/ui-kit/src/lib/components/molecules/segmented-button/segmented-button.classes.ts b/apps/ui-kit/src/lib/components/molecules/segmented-button/segmentedButton.classes.ts similarity index 86% rename from apps/ui-kit/src/lib/components/molecules/segmented-button/segmented-button.classes.ts rename to apps/ui-kit/src/lib/components/molecules/segmented-button/segmentedButton.classes.ts index f7160bed6b1..3ed05f9ac8c 100644 --- a/apps/ui-kit/src/lib/components/molecules/segmented-button/segmented-button.classes.ts +++ b/apps/ui-kit/src/lib/components/molecules/segmented-button/segmentedButton.classes.ts @@ -1,7 +1,7 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { SegmentedButtonType } from './segmented-button.enums'; +import { SegmentedButtonType } from './segmentedButton.enums'; export const BACKGROUND_COLORS: Record = { [SegmentedButtonType.Outlined]: 'bg-transparent', diff --git a/apps/ui-kit/src/lib/components/molecules/segmented-button/segmented-button.enums.ts b/apps/ui-kit/src/lib/components/molecules/segmented-button/segmentedButton.enums.ts similarity index 100% rename from apps/ui-kit/src/lib/components/molecules/segmented-button/segmented-button.enums.ts rename to apps/ui-kit/src/lib/components/molecules/segmented-button/segmentedButton.enums.ts diff --git a/apps/ui-kit/src/lib/components/molecules/table-cell/table-cell.enums.ts b/apps/ui-kit/src/lib/components/molecules/table-cell/table-cell.enums.ts deleted file mode 100644 index c89759317d8..00000000000 --- a/apps/ui-kit/src/lib/components/molecules/table-cell/table-cell.enums.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -export enum TableCellType { - Text = 'text', - TextToCopy = 'text-to-copy', - Badge = 'badge', - AvatarText = 'avatar-text', - Checkbox = 'checkbox', - Placeholder = 'placeholder', - Link = 'link', - Children = 'children', -} - -export enum TableCellTextColor { - Default = 'text-neutral-40 dark:text-neutral-60', - Dark = 'text-neutral-10 dark:text-neutral-92', -} diff --git a/apps/ui-kit/src/lib/components/molecules/table-header-cell/TableHeaderCell.tsx b/apps/ui-kit/src/lib/components/molecules/table-header-cell/TableHeaderCell.tsx index d88fc1ec23d..a1eccdb71db 100644 --- a/apps/ui-kit/src/lib/components/molecules/table-header-cell/TableHeaderCell.tsx +++ b/apps/ui-kit/src/lib/components/molecules/table-header-cell/TableHeaderCell.tsx @@ -5,7 +5,7 @@ import { useState } from 'react'; import { SortByDown, SortByUp } from '@iota/ui-icons'; import cx from 'classnames'; import { Checkbox } from '@/lib'; -import { TableHeaderCellSortOrder } from './table-header-cell.enums'; +import { TableHeaderCellSortOrder } from './tableHeaderCell.enums'; export interface TableHeaderCellProps { /** diff --git a/apps/ui-kit/src/lib/components/molecules/table-header-cell/index.ts b/apps/ui-kit/src/lib/components/molecules/table-header-cell/index.ts index 42f32bb3b76..d4e701c2740 100644 --- a/apps/ui-kit/src/lib/components/molecules/table-header-cell/index.ts +++ b/apps/ui-kit/src/lib/components/molecules/table-header-cell/index.ts @@ -2,4 +2,4 @@ // SPDX-License-Identifier: Apache-2.0 export * from './TableHeaderCell'; -export * from './table-header-cell.enums'; +export * from './tableHeaderCell.enums'; diff --git a/apps/ui-kit/src/lib/components/molecules/table-header-cell/table-header-cell.enums.ts b/apps/ui-kit/src/lib/components/molecules/table-header-cell/tableHeaderCell.enums.ts similarity index 100% rename from apps/ui-kit/src/lib/components/molecules/table-header-cell/table-header-cell.enums.ts rename to apps/ui-kit/src/lib/components/molecules/table-header-cell/tableHeaderCell.enums.ts diff --git a/apps/ui-kit/src/lib/components/molecules/title/Title.tsx b/apps/ui-kit/src/lib/components/molecules/title/Title.tsx index bfaaaf8e37b..44be31f1496 100644 --- a/apps/ui-kit/src/lib/components/molecules/title/Title.tsx +++ b/apps/ui-kit/src/lib/components/molecules/title/Title.tsx @@ -3,9 +3,9 @@ import { Tooltip, TooltipPosition } from '../../atoms'; import { Info } from '@iota/ui-icons'; -import { TitleSize } from './title-size.enum'; +import { TitleSize } from './titleSize.enums'; import cx from 'classnames'; -import { TITLE_PADDINGS, TITLE_SIZE } from './title-classes.constants'; +import { TITLE_PADDINGS, TITLE_SIZE } from './titleClasses.constants'; interface TitleProps { /** diff --git a/apps/ui-kit/src/lib/components/molecules/title/index.ts b/apps/ui-kit/src/lib/components/molecules/title/index.ts index 9a78adf3f24..34efb8414ac 100644 --- a/apps/ui-kit/src/lib/components/molecules/title/index.ts +++ b/apps/ui-kit/src/lib/components/molecules/title/index.ts @@ -2,4 +2,4 @@ // SPDX-License-Identifier: Apache-2.0 export * from './Title'; -export { TitleSize } from './title-size.enum'; +export { TitleSize } from './titleSize.enums'; diff --git a/apps/ui-kit/src/lib/components/molecules/title/title-classes.constants.ts b/apps/ui-kit/src/lib/components/molecules/title/titleClasses.constants.ts similarity index 88% rename from apps/ui-kit/src/lib/components/molecules/title/title-classes.constants.ts rename to apps/ui-kit/src/lib/components/molecules/title/titleClasses.constants.ts index 15640fbb854..eb66d1726b5 100644 --- a/apps/ui-kit/src/lib/components/molecules/title/title-classes.constants.ts +++ b/apps/ui-kit/src/lib/components/molecules/title/titleClasses.constants.ts @@ -1,7 +1,7 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { TitleSize } from './title-size.enum'; +import { TitleSize } from './titleSize.enums'; export const TITLE_PADDINGS: Record = { [TitleSize.Small]: 'px-md py-sm--rs', diff --git a/apps/ui-kit/src/lib/components/molecules/title/title-size.enum.ts b/apps/ui-kit/src/lib/components/molecules/title/titleSize.enums.ts similarity index 100% rename from apps/ui-kit/src/lib/components/molecules/title/title-size.enum.ts rename to apps/ui-kit/src/lib/components/molecules/title/titleSize.enums.ts diff --git a/apps/ui-kit/src/lib/enums/index.ts b/apps/ui-kit/src/lib/enums/index.ts index b85a71aeebb..c15d6246d2c 100644 --- a/apps/ui-kit/src/lib/enums/index.ts +++ b/apps/ui-kit/src/lib/enums/index.ts @@ -1,4 +1,4 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -export * from './screenSize.enum'; +export * from './screenSize.enums'; diff --git a/apps/ui-kit/src/lib/enums/screenSize.enum.ts b/apps/ui-kit/src/lib/enums/screenSize.enums.ts similarity index 100% rename from apps/ui-kit/src/lib/enums/screenSize.enum.ts rename to apps/ui-kit/src/lib/enums/screenSize.enums.ts diff --git a/apps/ui-kit/src/lib/tailwind/base.preset.ts b/apps/ui-kit/src/lib/tailwind/base.presets.ts similarity index 100% rename from apps/ui-kit/src/lib/tailwind/base.preset.ts rename to apps/ui-kit/src/lib/tailwind/base.presets.ts diff --git a/apps/ui-kit/src/lib/tailwind/constants/index.ts b/apps/ui-kit/src/lib/tailwind/constants/index.ts index 2adc80fcca0..7be12319899 100644 --- a/apps/ui-kit/src/lib/tailwind/constants/index.ts +++ b/apps/ui-kit/src/lib/tailwind/constants/index.ts @@ -3,4 +3,4 @@ export * from './scaling.constants'; export * from './fontSizes.constants'; -export * from './variable-spacing.constants'; +export * from './variableSpacing.constants'; diff --git a/apps/ui-kit/src/lib/tailwind/constants/variable-spacing.constants.ts b/apps/ui-kit/src/lib/tailwind/constants/variableSpacing.constants.ts similarity index 97% rename from apps/ui-kit/src/lib/tailwind/constants/variable-spacing.constants.ts rename to apps/ui-kit/src/lib/tailwind/constants/variableSpacing.constants.ts index ad6ed83f78d..c091667ccba 100644 --- a/apps/ui-kit/src/lib/tailwind/constants/variable-spacing.constants.ts +++ b/apps/ui-kit/src/lib/tailwind/constants/variableSpacing.constants.ts @@ -1,7 +1,7 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { ScreenSize } from '../../enums/screenSize.enum'; +import { ScreenSize } from '../../enums/screenSize.enums'; enum VariableSpacingClassPrefix { Xs = 'xs--rs', diff --git a/apps/ui-kit/src/lib/tailwind/index.ts b/apps/ui-kit/src/lib/tailwind/index.ts index 5edddfd1578..d0766485b1b 100644 --- a/apps/ui-kit/src/lib/tailwind/index.ts +++ b/apps/ui-kit/src/lib/tailwind/index.ts @@ -1,5 +1,5 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -export { default as uiKitResponsivePreset } from './responsive.preset'; -export { default as uiKitStaticPreset } from './static.preset'; +export { default as uiKitResponsivePreset } from './responsive.presets'; +export { default as uiKitStaticPreset } from './static.presets'; diff --git a/apps/ui-kit/src/lib/tailwind/responsive.preset.ts b/apps/ui-kit/src/lib/tailwind/responsive.presets.ts similarity index 95% rename from apps/ui-kit/src/lib/tailwind/responsive.preset.ts rename to apps/ui-kit/src/lib/tailwind/responsive.presets.ts index b86c59eb154..a0c99a45340 100644 --- a/apps/ui-kit/src/lib/tailwind/responsive.preset.ts +++ b/apps/ui-kit/src/lib/tailwind/responsive.presets.ts @@ -5,7 +5,7 @@ import type { Config } from 'tailwindcss'; import type { ScreenBreakpoints } from './types'; import { ScreenSize } from '../enums'; import { getTailwindScreens, pxToRem } from './helpers'; -import { BASE_CONFIG } from './base.preset'; +import { BASE_CONFIG } from './base.presets'; import merge from 'lodash.merge'; const BREAKPOINTS: ScreenBreakpoints = { diff --git a/apps/ui-kit/src/lib/tailwind/static.preset.ts b/apps/ui-kit/src/lib/tailwind/static.presets.ts similarity index 92% rename from apps/ui-kit/src/lib/tailwind/static.preset.ts rename to apps/ui-kit/src/lib/tailwind/static.presets.ts index ad50674fb55..d1a3868ad42 100644 --- a/apps/ui-kit/src/lib/tailwind/static.preset.ts +++ b/apps/ui-kit/src/lib/tailwind/static.presets.ts @@ -4,7 +4,7 @@ import type { Config } from 'tailwindcss'; import type { ScreenBreakpoints } from './types'; import { getTailwindScreens } from './helpers'; -import { BASE_CONFIG } from './base.preset'; +import { BASE_CONFIG } from './base.presets'; import merge from 'lodash.merge'; const BREAKPOINTS: Partial & { default: number } = { diff --git a/apps/ui-kit/src/storybook/constants/index.ts b/apps/ui-kit/src/storybook/constants/index.ts index a259cd8f991..ae109adc501 100644 --- a/apps/ui-kit/src/storybook/constants/index.ts +++ b/apps/ui-kit/src/storybook/constants/index.ts @@ -2,4 +2,4 @@ // SPDX-License-Identifier: Apache-2.0 export * from './typeset.constants'; -export * from './variable-spacing.constants'; +export * from './variableSpacing.constants'; diff --git a/apps/ui-kit/src/storybook/constants/variable-spacing.constants.ts b/apps/ui-kit/src/storybook/constants/variableSpacing.constants.ts similarity index 100% rename from apps/ui-kit/src/storybook/constants/variable-spacing.constants.ts rename to apps/ui-kit/src/storybook/constants/variableSpacing.constants.ts diff --git a/apps/ui-kit/tailwind.config.ts b/apps/ui-kit/tailwind.config.ts index 319b7dc1818..1ebb4d52c0f 100644 --- a/apps/ui-kit/tailwind.config.ts +++ b/apps/ui-kit/tailwind.config.ts @@ -1,6 +1,6 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import preset from './src/lib/tailwind/responsive.preset'; +import preset from './src/lib/tailwind/responsive.presets'; export default preset; diff --git a/apps/wallet-dashboard/app/(protected)/assets/page.tsx b/apps/wallet-dashboard/app/(protected)/assets/page.tsx index 9af8669a717..cf3c236f81f 100644 --- a/apps/wallet-dashboard/app/(protected)/assets/page.tsx +++ b/apps/wallet-dashboard/app/(protected)/assets/page.tsx @@ -3,16 +3,25 @@ 'use client'; -import { Panel, Title, Chip, TitleSize } from '@iota/apps-ui-kit'; -import { COIN_TYPE, hasDisplayData, useGetOwnedObjects } from '@iota/core'; +import { useState } from 'react'; +import cl from 'clsx'; +import { usePageAssets, AssetCategory } from '@iota/core'; +import { + Panel, + Title, + TitleSize, + LoadingIndicator, + InfoBox, + InfoBoxType, + InfoBoxStyle, + Chip, +} from '@iota/apps-ui-kit'; import { useCurrentAccount } from '@iota/dapp-kit'; import { IotaObjectData } from '@iota/iota-sdk/client'; -import { useState } from 'react'; -import { AssetCategory } from '@/lib/enums'; -import { AssetList } from '@/components/AssetsList'; -import { AssetDialog } from '@/components/Dialogs/Assets'; +import { Warning } from '@iota/ui-icons'; -const OBJECTS_PER_REQ = 50; +import { AssetTileLink, Loading } from '@/components'; +import { AssetDialog } from '@/components/dialogs/assets'; const ASSET_CATEGORIES: { label: string; value: AssetCategory }[] = [ { @@ -25,34 +34,32 @@ const ASSET_CATEGORIES: { label: string; value: AssetCategory }[] = [ }, ]; +const ASSET_LAYOUT: Record = { + [AssetCategory.Visual]: + 'grid-template-visual-assets grid max-h-[600px] gap-md overflow-auto py-sm', + [AssetCategory.Other]: 'flex flex-col overflow-auto py-sm', + [AssetCategory.Hidden]: 'flex flex-col overflow-auto py-sm', +}; + export default function AssetsDashboardPage(): React.JSX.Element { const [selectedAsset, setSelectedAsset] = useState(null); - const [selectedCategory, setSelectedCategory] = useState(AssetCategory.Visual); const account = useCurrentAccount(); - const { data, isFetching, fetchNextPage, hasNextPage, refetch } = useGetOwnedObjects( - account?.address, - { - MatchNone: [{ StructType: COIN_TYPE }], - }, - OBJECTS_PER_REQ, - ); + const accountAddress = account?.address || null; + + const { + isPending, + refetch, + error, + isError, - const assets = (data?.pages || []) - .flatMap((page) => page.data) - .filter((asset) => { - if (!asset.data || !asset.data.objectId) { - return false; - } - if (selectedCategory === AssetCategory.Visual) { - return hasDisplayData(asset); - } - if (selectedCategory === AssetCategory.Other) { - return !hasDisplayData(asset); - } - return false; - }) - .map((asset) => asset.data) - .filter((data): data is IotaObjectData => data !== null && data !== undefined); + ownedAssets, + isAssetsLoaded, + filteredAssets, + selectedAssetCategory, + setSelectedAssetCategory, + observerElem, + isSpinnerVisible, + } = usePageAssets(accountAddress); function onAssetClick(asset: IotaObjectData) { setSelectedAsset(asset); @@ -62,31 +69,69 @@ export default function AssetsDashboardPage(): React.JSX.Element { <div className="px-lg"> - <div className="flex flex-row items-center justify-start gap-xs py-xs"> - {ASSET_CATEGORIES.map((tab) => ( - <Chip - key={tab.label} - label={tab.label} - onClick={() => setSelectedCategory(tab.value)} - selected={selectedCategory === tab.value} + {isError ? ( + <div className="mb-2 flex h-full w-full items-center justify-center p-2"> + <InfoBox + type={InfoBoxType.Error} + title="Sync error (data might be outdated)" + supportingText={error?.message ?? 'An error occurred'} + icon={<Warning />} + style={InfoBoxStyle.Default} /> - ))} - </div> + </div> + ) : ( + <> + {isAssetsLoaded && + Boolean(ownedAssets?.visual.length || ownedAssets?.other.length) ? ( + <div className="flex flex-row items-center justify-start gap-xs py-xs"> + {ASSET_CATEGORIES.map(({ value, label }) => ( + <Chip + key={value} + onClick={() => setSelectedAssetCategory(value)} + label={label} + selected={selectedAssetCategory === value} + disabled={ + AssetCategory.Visual === value + ? !ownedAssets?.visual.length + : !ownedAssets?.other.length + } + /> + ))} + </div> + ) : null} + <Loading loading={isPending}> + <div + className={cl( + 'max-h-[600px]', + selectedAssetCategory && ASSET_LAYOUT[selectedAssetCategory], + )} + > + {filteredAssets.map((asset) => ( + <AssetTileLink + key={asset.digest} + asset={asset} + type={selectedAssetCategory} + onClick={onAssetClick} + /> + ))} + <div ref={observerElem}> + {isSpinnerVisible ? ( + <div className="mt-1 flex h-full w-full justify-center"> + <LoadingIndicator /> + </div> + ) : null} + </div> + </div> + </Loading> - <AssetList - assets={assets} - selectedCategory={selectedCategory} - onClick={onAssetClick} - hasNextPage={hasNextPage} - isFetchingNextPage={isFetching} - fetchNextPage={fetchNextPage} - /> - {selectedAsset && ( - <AssetDialog - onClose={() => setSelectedAsset(null)} - asset={selectedAsset} - refetchAssets={refetch} - /> + {selectedAsset && ( + <AssetDialog + onClose={() => setSelectedAsset(null)} + asset={selectedAsset} + refetchAssets={refetch} + /> + )} + </> )} </div> </Panel> diff --git a/apps/wallet-dashboard/app/(protected)/migrations/page.tsx b/apps/wallet-dashboard/app/(protected)/migrations/page.tsx index e2cd767e663..868877f00a5 100644 --- a/apps/wallet-dashboard/app/(protected)/migrations/page.tsx +++ b/apps/wallet-dashboard/app/(protected)/migrations/page.tsx @@ -6,8 +6,8 @@ import { useState, useMemo, useCallback } from 'react'; import { useQueryClient } from '@tanstack/react-query'; import clsx from 'clsx'; -import { useGetStardustMigratableObjects } from '@/hooks'; -import { summarizeMigratableObjectValues, summarizeTimelockedObjectValues } from '@/lib/utils'; +import { useGetStardustMigratableObjects, useGroupedStardustObjects } from '@/hooks'; +import { getStardustObjectsTotals } from '@/lib/utils'; import { Button, ButtonSize, @@ -19,7 +19,7 @@ import { Panel, Title, } from '@iota/apps-ui-kit'; -import { Assets, Clock, IotaLogoMark, Tokens } from '@iota/ui-icons'; +import { Assets, IotaLogoMark, Tokens } from '@iota/ui-icons'; import { useCurrentAccount, useIotaClient } from '@iota/dapp-kit'; import { STARDUST_BASIC_OUTPUT_TYPE, STARDUST_NFT_OUTPUT_TYPE, useFormatCoin } from '@iota/core'; import { IOTA_TYPE_ARG } from '@iota/iota-sdk/utils'; @@ -47,24 +47,49 @@ function MigrationDashboardPage(): JSX.Element { timelockedNftOutputs, } = stardustMigrationObjects || {}; + const { data: resolvedMigrationObjects = [] } = useGroupedStardustObjects( + [...(migratableBasicOutputs || []), ...(migratableNftOutputs || [])], + false, + ); + const { data: resolvedTimelockedObjects = [] } = useGroupedStardustObjects( + [...(timelockedBasicOutputs || []), ...(timelockedNftOutputs || [])], + true, + ); + const { - totalIotaAmount, + totalIotaAmount: migratableIotaAmount, totalNativeTokens: migratableNativeTokens, totalVisualAssets: migratableVisualAssets, - } = summarizeMigratableObjectValues({ + } = getStardustObjectsTotals({ basicOutputs: migratableBasicOutputs, nftOutputs: migratableNftOutputs, address, + resolvedObjects: resolvedMigrationObjects, }); - const { totalTimelockedObjects } = summarizeTimelockedObjectValues({ + const { + totalIotaAmount: timelockedIotaAmount, + totalNativeTokens: timelockedNativeTokens, + totalVisualAssets: timelockedVisualAssets, + } = getStardustObjectsTotals({ basicOutputs: timelockedBasicOutputs, nftOutputs: timelockedNftOutputs, + address, + resolvedObjects: resolvedTimelockedObjects, }); const hasMigratableObjects = - (migratableBasicOutputs?.length || 0) > 0 && (migratableNftOutputs?.length || 0) > 0; + (migratableBasicOutputs?.length || 0) > 0 || (migratableNftOutputs?.length || 0) > 0; + const hasTimelockedObjects = + (timelockedBasicOutputs?.length || 0) > 0 || (timelockedNftOutputs?.length || 0) > 0; - const [timelockedIotaTokens, symbol] = useFormatCoin(totalIotaAmount, IOTA_TYPE_ARG); + const [migratableIotaAmountFormatted, migratableIotaAmountSymbol] = useFormatCoin( + migratableIotaAmount, + IOTA_TYPE_ARG, + ); + const [timelockedIotaAmountFormatted, timelockedIotaAmountSymbol] = useFormatCoin( + timelockedIotaAmount, + IOTA_TYPE_ARG, + ); const handleOnSuccess = useCallback( (digest: string) => { @@ -90,7 +115,7 @@ function MigrationDashboardPage(): JSX.Element { const MIGRATION_CARDS: MigrationDisplayCardProps[] = [ { - title: `${timelockedIotaTokens} ${symbol}`, + title: `${migratableIotaAmountFormatted} ${migratableIotaAmountSymbol}`, subtitle: 'IOTA Tokens', icon: IotaLogoMark, }, @@ -108,9 +133,19 @@ function MigrationDashboardPage(): JSX.Element { const TIMELOCKED_ASSETS_CARDS: MigrationDisplayCardProps[] = [ { - title: `${totalTimelockedObjects}`, - subtitle: 'Time-locked', - icon: Clock, + title: `${timelockedIotaAmountFormatted} ${timelockedIotaAmountSymbol}`, + subtitle: 'IOTA Tokens', + icon: IotaLogoMark, + }, + { + title: `${timelockedNativeTokens}`, + subtitle: 'Native Tokens', + icon: Tokens, + }, + { + title: `${timelockedVisualAssets}`, + subtitle: 'Visual Assets', + icon: Assets, }, ]; @@ -224,7 +259,7 @@ function MigrationDashboardPage(): JSX.Element { disabled={ selectedStardustObjectsCategory === StardustOutputMigrationStatus.TimeLocked || - !totalTimelockedObjects + !hasTimelockedObjects } onClick={() => setSelectedStardustObjectsCategory( @@ -239,7 +274,7 @@ function MigrationDashboardPage(): JSX.Element { <MigrationObjectsPanel selectedObjects={selectedObjects} onClose={handleCloseDetailsPanel} - isTimelocked={ + groupByTimelockUC={ selectedStardustObjectsCategory === StardustOutputMigrationStatus.TimeLocked } /> diff --git a/apps/wallet-dashboard/app/(protected)/vesting/page.tsx b/apps/wallet-dashboard/app/(protected)/vesting/page.tsx index 6c2eec1756a..d3c147c319f 100644 --- a/apps/wallet-dashboard/app/(protected)/vesting/page.tsx +++ b/apps/wallet-dashboard/app/(protected)/vesting/page.tsx @@ -11,8 +11,8 @@ import { UnstakeDialog, StakeDialogView, } from '@/components'; -import { UnstakeDialogView } from '@/components/Dialogs/unstake/enums'; -import { useUnstakeDialog } from '@/components/Dialogs/unstake/hooks'; +import { UnstakeDialogView } from '@/components/dialogs/unstake/enums'; +import { useUnstakeDialog } from '@/components/dialogs/unstake/hooks'; import { useGetSupplyIncreaseVestingObjects } from '@/hooks'; import { groupTimelockedStakedObjects, TimelockedStakedObjectsGrouped } from '@/lib/utils'; import { useFeature } from '@growthbook/growthbook-react'; diff --git a/apps/wallet-dashboard/components/AssetsList.tsx b/apps/wallet-dashboard/components/AssetsList.tsx deleted file mode 100644 index adb9e251581..00000000000 --- a/apps/wallet-dashboard/components/AssetsList.tsx +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -import { AssetCategory } from '@/lib/enums'; -import { IotaObjectData } from '@iota/iota-sdk/client'; -import { AssetTileLink } from '@/components'; -import { LoadingIndicator } from '@iota/apps-ui-kit'; -import { useEffect, useRef } from 'react'; -import { useOnScreen } from '@iota/core'; -import cl from 'clsx'; - -interface AssetListProps { - assets: IotaObjectData[]; - selectedCategory: AssetCategory; - hasNextPage: boolean; - isFetchingNextPage: boolean; - fetchNextPage: () => void; - onClick: (asset: IotaObjectData) => void; -} - -const ASSET_LAYOUT: Record<AssetCategory, string> = { - [AssetCategory.Visual]: - 'grid-template-visual-assets grid max-h-[600px] gap-md overflow-auto py-sm', - [AssetCategory.Other]: 'flex flex-col overflow-auto py-sm', -}; - -export function AssetList({ - assets, - selectedCategory, - hasNextPage, - isFetchingNextPage, - fetchNextPage, - onClick, -}: AssetListProps): React.JSX.Element { - const observerElem = useRef<HTMLDivElement | null>(null); - const { isIntersecting } = useOnScreen(observerElem); - const isSpinnerVisible = isFetchingNextPage && hasNextPage; - - useEffect(() => { - if (isIntersecting && hasNextPage && !isFetchingNextPage && fetchNextPage) { - fetchNextPage(); - } - }, [isIntersecting, fetchNextPage, hasNextPage, isFetchingNextPage]); - - return ( - <div className={cl('max-h-[600px]', ASSET_LAYOUT[selectedCategory])}> - {assets.map((asset) => ( - <AssetTileLink - key={asset.digest} - asset={asset} - type={selectedCategory} - onClick={onClick} - /> - ))} - <div ref={observerElem}> - {isSpinnerVisible ? ( - <div className="mt-1 flex h-full w-full justify-center"> - <LoadingIndicator /> - </div> - ) : null} - </div> - </div> - ); -} diff --git a/apps/wallet-dashboard/components/SupplyIncreaseVestingOverview.tsx b/apps/wallet-dashboard/components/SupplyIncreaseVestingOverview.tsx index 7608bda1a3a..5d79759ad35 100644 --- a/apps/wallet-dashboard/components/SupplyIncreaseVestingOverview.tsx +++ b/apps/wallet-dashboard/components/SupplyIncreaseVestingOverview.tsx @@ -15,7 +15,7 @@ import { Panel, Title, } from '@iota/apps-ui-kit'; -import { StakeDialog, useStakeDialog } from './Dialogs'; +import { StakeDialog, useStakeDialog } from './dialogs'; import { TIMELOCK_IOTA_TYPE, useCountdownByTimestamp, useFormatCoin } from '@iota/core'; import { IOTA_TYPE_ARG } from '@iota/iota-sdk/utils'; import SvgClock from '@iota/ui-icons/src/Clock'; diff --git a/apps/wallet-dashboard/components/account-balance/AccountBalance.tsx b/apps/wallet-dashboard/components/account-balance/AccountBalance.tsx index 9bb3f297b27..b84dec37910 100644 --- a/apps/wallet-dashboard/components/account-balance/AccountBalance.tsx +++ b/apps/wallet-dashboard/components/account-balance/AccountBalance.tsx @@ -6,7 +6,7 @@ import { formatAddress, IOTA_TYPE_ARG } from '@iota/iota-sdk/utils'; import { useBalance, useFormatCoin } from '@iota/core'; import { Address, Button, ButtonSize, ButtonType, Panel } from '@iota/apps-ui-kit'; import { getNetwork } from '@iota/iota-sdk/client'; -import { ReceiveFundsDialog, SendTokenDialog } from '../Dialogs'; +import { ReceiveFundsDialog, SendTokenDialog } from '../dialogs'; import toast from 'react-hot-toast'; import { useState } from 'react'; diff --git a/apps/wallet-dashboard/components/AppList/AppList.tsx b/apps/wallet-dashboard/components/app-list/AppList.tsx similarity index 97% rename from apps/wallet-dashboard/components/AppList/AppList.tsx rename to apps/wallet-dashboard/components/app-list/AppList.tsx index 543250637c6..a3e1b487d03 100644 --- a/apps/wallet-dashboard/components/AppList/AppList.tsx +++ b/apps/wallet-dashboard/components/app-list/AppList.tsx @@ -4,7 +4,7 @@ import Image from 'next/image'; import { useAppsBackend } from '@iota/core'; import { useQuery } from '@tanstack/react-query'; -import { type AppListItem } from './AppList.types'; +import { type AppListItem } from './appList.types'; import { getDefaultNetwork } from '@iota/iota-sdk/client'; const AppListItem = (props: AppListItem) => { diff --git a/apps/wallet-dashboard/components/AppList/AppList.types.ts b/apps/wallet-dashboard/components/app-list/appList.types.ts similarity index 100% rename from apps/wallet-dashboard/components/AppList/AppList.types.ts rename to apps/wallet-dashboard/components/app-list/appList.types.ts diff --git a/apps/wallet-dashboard/components/AppList/index.ts b/apps/wallet-dashboard/components/app-list/index.ts similarity index 100% rename from apps/wallet-dashboard/components/AppList/index.ts rename to apps/wallet-dashboard/components/app-list/index.ts diff --git a/apps/wallet-dashboard/components/Buttons/Button.tsx b/apps/wallet-dashboard/components/buttons/Button.tsx similarity index 100% rename from apps/wallet-dashboard/components/Buttons/Button.tsx rename to apps/wallet-dashboard/components/buttons/Button.tsx diff --git a/apps/wallet-dashboard/components/Buttons/index.ts b/apps/wallet-dashboard/components/buttons/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Buttons/index.ts rename to apps/wallet-dashboard/components/buttons/index.ts diff --git a/apps/wallet-dashboard/components/Cards/VisualAssetDetailsCard.tsx b/apps/wallet-dashboard/components/cards/VisualAssetDetailsCard.tsx similarity index 100% rename from apps/wallet-dashboard/components/Cards/VisualAssetDetailsCard.tsx rename to apps/wallet-dashboard/components/cards/VisualAssetDetailsCard.tsx diff --git a/apps/wallet-dashboard/components/Cards/index.ts b/apps/wallet-dashboard/components/cards/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Cards/index.ts rename to apps/wallet-dashboard/components/cards/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/ReceiveFundsDialog.tsx b/apps/wallet-dashboard/components/dialogs/ReceiveFundsDialog.tsx similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/ReceiveFundsDialog.tsx rename to apps/wallet-dashboard/components/dialogs/ReceiveFundsDialog.tsx diff --git a/apps/wallet-dashboard/components/Dialogs/TransactionDialog.tsx b/apps/wallet-dashboard/components/dialogs/TransactionDialog.tsx similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/TransactionDialog.tsx rename to apps/wallet-dashboard/components/dialogs/TransactionDialog.tsx diff --git a/apps/wallet-dashboard/components/Dialogs/Assets/AssetDialog.tsx b/apps/wallet-dashboard/components/dialogs/assets/AssetDialog.tsx similarity index 98% rename from apps/wallet-dashboard/components/Dialogs/Assets/AssetDialog.tsx rename to apps/wallet-dashboard/components/dialogs/assets/AssetDialog.tsx index ccc199afcdb..4796402e80c 100644 --- a/apps/wallet-dashboard/components/Dialogs/Assets/AssetDialog.tsx +++ b/apps/wallet-dashboard/components/dialogs/assets/AssetDialog.tsx @@ -10,7 +10,7 @@ import { DetailsView, SendView } from './views'; import { IotaObjectData } from '@iota/iota-sdk/client'; import { AssetsDialogView } from './constants'; import { useCreateSendAssetTransaction } from '@/hooks'; -import { TransactionDetailsView } from '../SendToken'; +import { TransactionDetailsView } from '../send-token'; import { DialogLayout } from '../layout'; import toast from 'react-hot-toast'; diff --git a/apps/wallet-dashboard/components/Dialogs/Assets/constants/AssetsDialogView.ts b/apps/wallet-dashboard/components/dialogs/assets/constants/assetsDialogView.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/Assets/constants/AssetsDialogView.ts rename to apps/wallet-dashboard/components/dialogs/assets/constants/assetsDialogView.ts diff --git a/apps/wallet-dashboard/components/dialogs/assets/constants/index.ts b/apps/wallet-dashboard/components/dialogs/assets/constants/index.ts new file mode 100644 index 00000000000..84f36d56cf4 --- /dev/null +++ b/apps/wallet-dashboard/components/dialogs/assets/constants/index.ts @@ -0,0 +1,4 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +export * from './assetsDialogView'; diff --git a/apps/wallet-dashboard/components/Dialogs/Assets/index.ts b/apps/wallet-dashboard/components/dialogs/assets/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/Assets/index.ts rename to apps/wallet-dashboard/components/dialogs/assets/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/Assets/views/DetailsView.tsx b/apps/wallet-dashboard/components/dialogs/assets/views/DetailsView.tsx similarity index 98% rename from apps/wallet-dashboard/components/Dialogs/Assets/views/DetailsView.tsx rename to apps/wallet-dashboard/components/dialogs/assets/views/DetailsView.tsx index 0ee80d9fef2..8c54af7e8bf 100644 --- a/apps/wallet-dashboard/components/Dialogs/Assets/views/DetailsView.tsx +++ b/apps/wallet-dashboard/components/dialogs/assets/views/DetailsView.tsx @@ -43,12 +43,12 @@ export function DetailsView({ onClose, asset, onSend }: DetailsViewProps) { const { fileExtensionType, filePath } = useNFTBasicData(objectData); function handleMoreAboutKiosk() { - window.open('https://docs.iota.org/references/ts-sdk/kiosk/', '_blank'); + window.open('https://docs.iota.org/ts-sdk/kiosk/', '_blank'); } function handleMarketplace() { // TODO: https://github.com/iotaledger/iota/issues/4024 - window.open('https://docs.iota.org/references/ts-sdk/kiosk/', '_blank'); + window.open('https://docs.iota.org/ts-sdk/kiosk/', '_blank'); } return ( diff --git a/apps/wallet-dashboard/components/Dialogs/Assets/views/SendView.tsx b/apps/wallet-dashboard/components/dialogs/assets/views/SendView.tsx similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/Assets/views/SendView.tsx rename to apps/wallet-dashboard/components/dialogs/assets/views/SendView.tsx diff --git a/apps/wallet-dashboard/components/Dialogs/Assets/views/index.ts b/apps/wallet-dashboard/components/dialogs/assets/views/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/Assets/views/index.ts rename to apps/wallet-dashboard/components/dialogs/assets/views/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/index.ts b/apps/wallet-dashboard/components/dialogs/index.ts similarity index 79% rename from apps/wallet-dashboard/components/Dialogs/index.ts rename to apps/wallet-dashboard/components/dialogs/index.ts index 1475376b5ec..88c9e90c332 100644 --- a/apps/wallet-dashboard/components/Dialogs/index.ts +++ b/apps/wallet-dashboard/components/dialogs/index.ts @@ -1,9 +1,9 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -export * from './SendToken'; +export * from './send-token'; export * from './ReceiveFundsDialog'; -export * from './Staking'; +export * from './staking'; export * from './unstake'; export * from './vesting'; export * from './settings'; diff --git a/apps/wallet-dashboard/components/Dialogs/layout/DialogLayout.tsx b/apps/wallet-dashboard/components/dialogs/layout/DialogLayout.tsx similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/layout/DialogLayout.tsx rename to apps/wallet-dashboard/components/dialogs/layout/DialogLayout.tsx diff --git a/apps/wallet-dashboard/components/Dialogs/layout/index.ts b/apps/wallet-dashboard/components/dialogs/layout/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/layout/index.ts rename to apps/wallet-dashboard/components/dialogs/layout/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/migration/MigrationDialog.tsx b/apps/wallet-dashboard/components/dialogs/migration/MigrationDialog.tsx similarity index 98% rename from apps/wallet-dashboard/components/Dialogs/migration/MigrationDialog.tsx rename to apps/wallet-dashboard/components/dialogs/migration/MigrationDialog.tsx index 5e21d9896dd..e3e9cd19541 100644 --- a/apps/wallet-dashboard/components/Dialogs/migration/MigrationDialog.tsx +++ b/apps/wallet-dashboard/components/dialogs/migration/MigrationDialog.tsx @@ -73,7 +73,7 @@ export function MigrationDialog({ nftOutputObjects={nftOutputObjects} onSuccess={handleMigrate} setOpen={setOpen} - isTimelocked={isTimelocked} + groupByTimelockUC={isTimelocked} migrateData={migrateData} isMigrationPending={isMigrationPending} isMigrationError={isMigrationError} diff --git a/apps/wallet-dashboard/components/Dialogs/Staking/enums/index.ts b/apps/wallet-dashboard/components/dialogs/migration/enums/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/Staking/enums/index.ts rename to apps/wallet-dashboard/components/dialogs/migration/enums/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/migration/enums/view.enums.ts b/apps/wallet-dashboard/components/dialogs/migration/enums/view.enums.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/migration/enums/view.enums.ts rename to apps/wallet-dashboard/components/dialogs/migration/enums/view.enums.ts diff --git a/apps/wallet-dashboard/components/Dialogs/migration/index.ts b/apps/wallet-dashboard/components/dialogs/migration/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/migration/index.ts rename to apps/wallet-dashboard/components/dialogs/migration/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/migration/views/ConfirmMigrationView.tsx b/apps/wallet-dashboard/components/dialogs/migration/views/ConfirmMigrationView.tsx similarity index 56% rename from apps/wallet-dashboard/components/Dialogs/migration/views/ConfirmMigrationView.tsx rename to apps/wallet-dashboard/components/dialogs/migration/views/ConfirmMigrationView.tsx index c81db02dba5..bd9071e3a6c 100644 --- a/apps/wallet-dashboard/components/Dialogs/migration/views/ConfirmMigrationView.tsx +++ b/apps/wallet-dashboard/components/dialogs/migration/views/ConfirmMigrationView.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { MigrationObjectLoading, VirtualList } from '@/components'; +import { MigrationObjectLoading, VirtualList, MigrationObjectDetailsCard } from '@/components'; import { useCurrentAccount } from '@iota/dapp-kit'; import { IotaObjectData } from '@iota/iota-sdk/client'; import { @@ -16,21 +16,21 @@ import { Title, TitleSize, } from '@iota/apps-ui-kit'; -import { useGroupedMigrationObjectsByExpirationDate } from '@/hooks'; +import { useGroupedStardustObjects } from '@/hooks'; import { Loader, Warning } from '@iota/ui-icons'; import { Collapsible, useFormatCoin } from '@iota/core'; import { IOTA_TYPE_ARG } from '@iota/iota-sdk/utils'; -import { summarizeMigratableObjectValues } from '@/lib/utils'; -import { MigrationObjectDetailsCard } from '@/components/migration/migration-object-details-card'; +import { getStardustObjectsTotals, filterMigrationObjects } from '@/lib/utils'; import { DialogLayout, DialogLayoutBody, DialogLayoutFooter } from '../../layout'; import { Transaction } from '@iota/iota-sdk/transactions'; +import { StardustOutputDetailsFilter } from '@/lib/enums'; interface ConfirmMigrationViewProps { basicOutputObjects: IotaObjectData[] | undefined; nftOutputObjects: IotaObjectData[] | undefined; onSuccess: () => void; setOpen: (bool: boolean) => void; - isTimelocked: boolean; + groupByTimelockUC: boolean; migrateData: | { transaction: Transaction; @@ -47,7 +47,7 @@ export function ConfirmMigrationView({ nftOutputObjects = [], onSuccess, setOpen, - isTimelocked, + groupByTimelockUC, migrateData, isMigrationPending, isMigrationError, @@ -59,26 +59,62 @@ export function ConfirmMigrationView({ data: resolvedObjects = [], isLoading, error: isGroupedMigrationError, - } = useGroupedMigrationObjectsByExpirationDate( - [...basicOutputObjects, ...nftOutputObjects], - isTimelocked, - ); + } = useGroupedStardustObjects([...basicOutputObjects, ...nftOutputObjects], groupByTimelockUC); - const { totalNotOwnedStorageDepositReturnAmount } = summarizeMigratableObjectValues({ + const { + totalIotaAmount, + totalNativeTokens: migratableNativeTokens, + totalVisualAssets: migratableVisualAssets, + totalNotOwnedStorageDepositReturnAmount, + } = getStardustObjectsTotals({ basicOutputs: basicOutputObjects, nftOutputs: nftOutputObjects, address: account?.address || '', }); + const [timelockedIotaTokens, symbol] = useFormatCoin(totalIotaAmount, IOTA_TYPE_ARG); const [gasFee, gasFeeSymbol] = useFormatCoin(migrateData?.gasBudget, IOTA_TYPE_ARG); const [totalStorageDepositReturnAmountFormatted, totalStorageDepositReturnAmountSymbol] = useFormatCoin(totalNotOwnedStorageDepositReturnAmount.toString(), IOTA_TYPE_ARG); + const filteredIotaObjects = filterMigrationObjects( + resolvedObjects, + StardustOutputDetailsFilter.IOTA, + ); + const filteredNativeTokens = filterMigrationObjects( + resolvedObjects, + StardustOutputDetailsFilter.NativeTokens, + ); + const filteredVisualAssets = filterMigrationObjects( + resolvedObjects, + StardustOutputDetailsFilter.VisualAssets, + ); + + const assetsToMigrateCategories = [ + { + title: 'IOTA Tokens', + subtitle: `${timelockedIotaTokens} ${symbol}`, + filteredObjects: filteredIotaObjects, + }, + { + title: 'Native Tokens', + subtitle: `${migratableNativeTokens} Types`, + filteredObjects: filteredNativeTokens, + }, + { + title: 'Visual Assets', + subtitle: `${migratableVisualAssets} Assets`, + filteredObjects: filteredVisualAssets, + }, + ]; + const filteredAssetsToMigrateCategories = assetsToMigrateCategories.filter( + ({ filteredObjects }) => filteredObjects.length > 0, + ); return ( <DialogLayout> - <Header title="Confirmation" onClose={() => setOpen(false)} titleCentered /> + <Header title="Migrate Your Assets" onClose={() => setOpen(false)} titleCentered /> <DialogLayoutBody> - <div className="flex h-full flex-col gap-y-md overflow-y-auto"> + <div className="flex h-full flex-col gap-y-md"> {isGroupedMigrationError && !isLoading && ( <InfoBox title="Error" @@ -105,27 +141,37 @@ export function ConfirmMigrationView({ </> ) : ( <> - <Collapsible - defaultOpen - render={() => ( - <Title size={TitleSize.Small} title="Assets to Migrate" /> + <div className="flex flex-col gap-y-sm"> + {filteredAssetsToMigrateCategories.map( + ({ title, subtitle, filteredObjects }) => ( + <Collapsible + key={title} + render={() => ( + <Title + size={TitleSize.Small} + title={title} + subtitle={subtitle} + /> + )} + > + <div className="flex h-full max-h-[300px] flex-col gap-y-sm pb-sm"> + <VirtualList + heightClassName="h-full" + overflowClassName="overflow-y-auto" + items={filteredObjects} + estimateSize={() => 58} + render={(migrationObject) => ( + <MigrationObjectDetailsCard + migrationObject={migrationObject} + isTimelocked={groupByTimelockUC} + /> + )} + /> + </div> + </Collapsible> + ), )} - > - <div className="h-[500px] pb-md--rs xl:h-[600px]"> - <VirtualList - heightClassName="h-full" - overflowClassName="overflow-y-auto" - items={resolvedObjects} - estimateSize={() => 58} - render={(migrationObject) => ( - <MigrationObjectDetailsCard - migrationObject={migrationObject} - isTimelocked={isTimelocked} - /> - )} - /> - </div> - </Collapsible> + </div> <Panel hasBorder> <div className="flex flex-col gap-y-sm p-md"> <KeyValueInfo diff --git a/apps/wallet-dashboard/components/Dialogs/migration/views/index.ts b/apps/wallet-dashboard/components/dialogs/migration/views/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/migration/views/index.ts rename to apps/wallet-dashboard/components/dialogs/migration/views/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/SendToken/SendTokenDialog.tsx b/apps/wallet-dashboard/components/dialogs/send-token/SendTokenDialog.tsx similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/SendToken/SendTokenDialog.tsx rename to apps/wallet-dashboard/components/dialogs/send-token/SendTokenDialog.tsx diff --git a/apps/wallet-dashboard/components/Dialogs/SendToken/constants/index.ts b/apps/wallet-dashboard/components/dialogs/send-token/constants/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/SendToken/constants/index.ts rename to apps/wallet-dashboard/components/dialogs/send-token/constants/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/SendToken/index.ts b/apps/wallet-dashboard/components/dialogs/send-token/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/SendToken/index.ts rename to apps/wallet-dashboard/components/dialogs/send-token/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/SendToken/interfaces/index.ts b/apps/wallet-dashboard/components/dialogs/send-token/interfaces/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/SendToken/interfaces/index.ts rename to apps/wallet-dashboard/components/dialogs/send-token/interfaces/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/SendToken/views/EnterValuesFormView.tsx b/apps/wallet-dashboard/components/dialogs/send-token/views/EnterValuesFormView.tsx similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/SendToken/views/EnterValuesFormView.tsx rename to apps/wallet-dashboard/components/dialogs/send-token/views/EnterValuesFormView.tsx diff --git a/apps/wallet-dashboard/components/Dialogs/SendToken/views/ReviewValuesFormView.tsx b/apps/wallet-dashboard/components/dialogs/send-token/views/ReviewValuesFormView.tsx similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/SendToken/views/ReviewValuesFormView.tsx rename to apps/wallet-dashboard/components/dialogs/send-token/views/ReviewValuesFormView.tsx diff --git a/apps/wallet-dashboard/components/Dialogs/SendToken/views/TransactionDetailsView.tsx b/apps/wallet-dashboard/components/dialogs/send-token/views/TransactionDetailsView.tsx similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/SendToken/views/TransactionDetailsView.tsx rename to apps/wallet-dashboard/components/dialogs/send-token/views/TransactionDetailsView.tsx diff --git a/apps/wallet-dashboard/components/Dialogs/SendToken/views/index.ts b/apps/wallet-dashboard/components/dialogs/send-token/views/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/SendToken/views/index.ts rename to apps/wallet-dashboard/components/dialogs/send-token/views/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/settings/SettingsDialog.tsx b/apps/wallet-dashboard/components/dialogs/settings/SettingsDialog.tsx similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/settings/SettingsDialog.tsx rename to apps/wallet-dashboard/components/dialogs/settings/SettingsDialog.tsx diff --git a/apps/wallet-dashboard/components/Dialogs/migration/enums/index.ts b/apps/wallet-dashboard/components/dialogs/settings/enums/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/migration/enums/index.ts rename to apps/wallet-dashboard/components/dialogs/settings/enums/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/settings/enums/view.enums.ts b/apps/wallet-dashboard/components/dialogs/settings/enums/view.enums.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/settings/enums/view.enums.ts rename to apps/wallet-dashboard/components/dialogs/settings/enums/view.enums.ts diff --git a/apps/wallet-dashboard/components/Dialogs/settings/hooks/index.ts b/apps/wallet-dashboard/components/dialogs/settings/hooks/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/settings/hooks/index.ts rename to apps/wallet-dashboard/components/dialogs/settings/hooks/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/settings/hooks/useSettingsDialog.ts b/apps/wallet-dashboard/components/dialogs/settings/hooks/useSettingsDialog.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/settings/hooks/useSettingsDialog.ts rename to apps/wallet-dashboard/components/dialogs/settings/hooks/useSettingsDialog.ts diff --git a/apps/wallet-dashboard/components/Dialogs/settings/index.ts b/apps/wallet-dashboard/components/dialogs/settings/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/settings/index.ts rename to apps/wallet-dashboard/components/dialogs/settings/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/settings/views/NetworkSelectorView.tsx b/apps/wallet-dashboard/components/dialogs/settings/views/NetworkSelectorView.tsx similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/settings/views/NetworkSelectorView.tsx rename to apps/wallet-dashboard/components/dialogs/settings/views/NetworkSelectorView.tsx diff --git a/apps/wallet-dashboard/components/Dialogs/settings/views/SettingsListView.tsx b/apps/wallet-dashboard/components/dialogs/settings/views/SettingsListView.tsx similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/settings/views/SettingsListView.tsx rename to apps/wallet-dashboard/components/dialogs/settings/views/SettingsListView.tsx diff --git a/apps/wallet-dashboard/components/Dialogs/settings/views/index.ts b/apps/wallet-dashboard/components/dialogs/settings/views/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/settings/views/index.ts rename to apps/wallet-dashboard/components/dialogs/settings/views/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/Staking/StakeDialog.tsx b/apps/wallet-dashboard/components/dialogs/staking/StakeDialog.tsx similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/Staking/StakeDialog.tsx rename to apps/wallet-dashboard/components/dialogs/staking/StakeDialog.tsx diff --git a/apps/wallet-dashboard/components/Dialogs/settings/enums/index.ts b/apps/wallet-dashboard/components/dialogs/staking/enums/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/settings/enums/index.ts rename to apps/wallet-dashboard/components/dialogs/staking/enums/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/Staking/enums/view.enums.ts b/apps/wallet-dashboard/components/dialogs/staking/enums/view.enums.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/Staking/enums/view.enums.ts rename to apps/wallet-dashboard/components/dialogs/staking/enums/view.enums.ts diff --git a/apps/wallet-dashboard/components/Dialogs/Staking/hooks/index.ts b/apps/wallet-dashboard/components/dialogs/staking/hooks/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/Staking/hooks/index.ts rename to apps/wallet-dashboard/components/dialogs/staking/hooks/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/Staking/hooks/useStakeDialog.ts b/apps/wallet-dashboard/components/dialogs/staking/hooks/useStakeDialog.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/Staking/hooks/useStakeDialog.ts rename to apps/wallet-dashboard/components/dialogs/staking/hooks/useStakeDialog.ts diff --git a/apps/wallet-dashboard/components/Dialogs/Staking/index.ts b/apps/wallet-dashboard/components/dialogs/staking/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/Staking/index.ts rename to apps/wallet-dashboard/components/dialogs/staking/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/Staking/views/DetailsView.tsx b/apps/wallet-dashboard/components/dialogs/staking/views/DetailsView.tsx similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/Staking/views/DetailsView.tsx rename to apps/wallet-dashboard/components/dialogs/staking/views/DetailsView.tsx diff --git a/apps/wallet-dashboard/components/Dialogs/Staking/views/EnterAmountDialogLayout.tsx b/apps/wallet-dashboard/components/dialogs/staking/views/EnterAmountDialogLayout.tsx similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/Staking/views/EnterAmountDialogLayout.tsx rename to apps/wallet-dashboard/components/dialogs/staking/views/EnterAmountDialogLayout.tsx diff --git a/apps/wallet-dashboard/components/Dialogs/Staking/views/EnterAmountView.tsx b/apps/wallet-dashboard/components/dialogs/staking/views/EnterAmountView.tsx similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/Staking/views/EnterAmountView.tsx rename to apps/wallet-dashboard/components/dialogs/staking/views/EnterAmountView.tsx diff --git a/apps/wallet-dashboard/components/Dialogs/Staking/views/EnterTimelockedAmountView.tsx b/apps/wallet-dashboard/components/dialogs/staking/views/EnterTimelockedAmountView.tsx similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/Staking/views/EnterTimelockedAmountView.tsx rename to apps/wallet-dashboard/components/dialogs/staking/views/EnterTimelockedAmountView.tsx diff --git a/apps/wallet-dashboard/components/Dialogs/Staking/views/SelectValidatorView.tsx b/apps/wallet-dashboard/components/dialogs/staking/views/SelectValidatorView.tsx similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/Staking/views/SelectValidatorView.tsx rename to apps/wallet-dashboard/components/dialogs/staking/views/SelectValidatorView.tsx diff --git a/apps/wallet-dashboard/components/Dialogs/Staking/views/StakedInfo.tsx b/apps/wallet-dashboard/components/dialogs/staking/views/StakedInfo.tsx similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/Staking/views/StakedInfo.tsx rename to apps/wallet-dashboard/components/dialogs/staking/views/StakedInfo.tsx diff --git a/apps/wallet-dashboard/components/Dialogs/Staking/views/index.ts b/apps/wallet-dashboard/components/dialogs/staking/views/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/Staking/views/index.ts rename to apps/wallet-dashboard/components/dialogs/staking/views/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/transaction/TransactionDetailsLayout.tsx b/apps/wallet-dashboard/components/dialogs/transaction/TransactionDetailsLayout.tsx similarity index 97% rename from apps/wallet-dashboard/components/Dialogs/transaction/TransactionDetailsLayout.tsx rename to apps/wallet-dashboard/components/dialogs/transaction/TransactionDetailsLayout.tsx index e34d6857e84..8b7d9cfa6a2 100644 --- a/apps/wallet-dashboard/components/Dialogs/transaction/TransactionDetailsLayout.tsx +++ b/apps/wallet-dashboard/components/dialogs/transaction/TransactionDetailsLayout.tsx @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import { ExplorerLink } from '@/components'; -import { ExtendedTransaction } from '@/lib/interfaces'; import { Header, LoadingIndicator } from '@iota/apps-ui-kit'; import { useTransactionSummary, @@ -10,6 +9,7 @@ import { ExplorerLinkType, TransactionReceipt, useRecognizedPackages, + ExtendedTransaction, } from '@iota/core'; import { useCurrentAccount, useIotaClientContext } from '@iota/dapp-kit'; import { DialogLayoutBody, DialogLayoutFooter } from '../layout'; diff --git a/apps/wallet-dashboard/components/Dialogs/transaction/index.ts b/apps/wallet-dashboard/components/dialogs/transaction/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/transaction/index.ts rename to apps/wallet-dashboard/components/dialogs/transaction/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/unstake/UnstakeDialog.tsx b/apps/wallet-dashboard/components/dialogs/unstake/UnstakeDialog.tsx similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/unstake/UnstakeDialog.tsx rename to apps/wallet-dashboard/components/dialogs/unstake/UnstakeDialog.tsx diff --git a/apps/wallet-dashboard/components/Dialogs/unstake/enums/index.ts b/apps/wallet-dashboard/components/dialogs/unstake/enums/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/unstake/enums/index.ts rename to apps/wallet-dashboard/components/dialogs/unstake/enums/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/unstake/enums/views.enums.ts b/apps/wallet-dashboard/components/dialogs/unstake/enums/views.enums.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/unstake/enums/views.enums.ts rename to apps/wallet-dashboard/components/dialogs/unstake/enums/views.enums.ts diff --git a/apps/wallet-dashboard/components/Dialogs/unstake/hooks/index.ts b/apps/wallet-dashboard/components/dialogs/unstake/hooks/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/unstake/hooks/index.ts rename to apps/wallet-dashboard/components/dialogs/unstake/hooks/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/unstake/hooks/useUnstakeDialog.ts b/apps/wallet-dashboard/components/dialogs/unstake/hooks/useUnstakeDialog.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/unstake/hooks/useUnstakeDialog.ts rename to apps/wallet-dashboard/components/dialogs/unstake/hooks/useUnstakeDialog.ts diff --git a/apps/wallet-dashboard/components/Dialogs/unstake/index.ts b/apps/wallet-dashboard/components/dialogs/unstake/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/unstake/index.ts rename to apps/wallet-dashboard/components/dialogs/unstake/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/unstake/views/UnstakeTimelockedObjectsView.tsx b/apps/wallet-dashboard/components/dialogs/unstake/views/UnstakeTimelockedObjectsView.tsx similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/unstake/views/UnstakeTimelockedObjectsView.tsx rename to apps/wallet-dashboard/components/dialogs/unstake/views/UnstakeTimelockedObjectsView.tsx diff --git a/apps/wallet-dashboard/components/Dialogs/unstake/views/UnstakeView.tsx b/apps/wallet-dashboard/components/dialogs/unstake/views/UnstakeView.tsx similarity index 99% rename from apps/wallet-dashboard/components/Dialogs/unstake/views/UnstakeView.tsx rename to apps/wallet-dashboard/components/dialogs/unstake/views/UnstakeView.tsx index 03bae1f84d5..72ae95178a4 100644 --- a/apps/wallet-dashboard/components/Dialogs/unstake/views/UnstakeView.tsx +++ b/apps/wallet-dashboard/components/dialogs/unstake/views/UnstakeView.tsx @@ -24,6 +24,7 @@ import { useCurrentAccount, useSignAndExecuteTransaction } from '@iota/dapp-kit' import { Warning } from '@iota/ui-icons'; import { StakeRewardsPanel, ValidatorStakingData } from '@/components'; import { DialogLayout, DialogLayoutFooter, DialogLayoutBody } from '../../layout'; + import { useNewUnstakeTransaction } from '@/hooks'; import { IotaSignAndExecuteTransactionOutput } from '@iota/wallet-standard'; import toast from 'react-hot-toast'; diff --git a/apps/wallet-dashboard/components/Dialogs/unstake/views/index.ts b/apps/wallet-dashboard/components/dialogs/unstake/views/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/unstake/views/index.ts rename to apps/wallet-dashboard/components/dialogs/unstake/views/index.ts diff --git a/apps/wallet-dashboard/components/Dialogs/vesting/VestingScheduleBox.tsx b/apps/wallet-dashboard/components/dialogs/vesting/VestingScheduleBox.tsx similarity index 80% rename from apps/wallet-dashboard/components/Dialogs/vesting/VestingScheduleBox.tsx rename to apps/wallet-dashboard/components/dialogs/vesting/VestingScheduleBox.tsx index d9a93fc8d7c..d8d9dcdb14b 100644 --- a/apps/wallet-dashboard/components/Dialogs/vesting/VestingScheduleBox.tsx +++ b/apps/wallet-dashboard/components/dialogs/vesting/VestingScheduleBox.tsx @@ -3,7 +3,7 @@ import { useGetCurrentEpochStartTimestamp } from '@/hooks'; import { DisplayStats, DisplayStatsType } from '@iota/apps-ui-kit'; -import { useFormatCoin } from '@iota/core'; +import { formatDate, useFormatCoin } from '@iota/core'; import { IOTA_TYPE_ARG } from '@iota/iota-sdk/utils'; import { LockLocked } from '@iota/ui-icons'; @@ -20,9 +20,16 @@ export function VestingScheduleBox({ const { data: currentEpochMs } = useGetCurrentEpochStartTimestamp(); const isLocked = expirationTimestampMs > Number(currentEpochMs); + const transactionDate = formatDate(Number(expirationTimestampMs), [ + 'year', + 'month', + 'day', + 'hour', + 'minute', + ]); return ( <DisplayStats - label={new Date(expirationTimestampMs).toLocaleDateString()} + label={transactionDate} value={`${formattedAmountVested} ${amountVestedSymbol}`} type={isLocked ? DisplayStatsType.Default : DisplayStatsType.Secondary} icon={isLocked && <LockLocked className="h-4 w-4" />} diff --git a/apps/wallet-dashboard/components/Dialogs/vesting/VestingScheduleDialog.tsx b/apps/wallet-dashboard/components/dialogs/vesting/VestingScheduleDialog.tsx similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/vesting/VestingScheduleDialog.tsx rename to apps/wallet-dashboard/components/dialogs/vesting/VestingScheduleDialog.tsx diff --git a/apps/wallet-dashboard/components/Dialogs/vesting/index.ts b/apps/wallet-dashboard/components/dialogs/vesting/index.ts similarity index 100% rename from apps/wallet-dashboard/components/Dialogs/vesting/index.ts rename to apps/wallet-dashboard/components/dialogs/vesting/index.ts diff --git a/apps/wallet-dashboard/components/index.ts b/apps/wallet-dashboard/components/index.ts index 977211a1057..0a713ba5fb6 100644 --- a/apps/wallet-dashboard/components/index.ts +++ b/apps/wallet-dashboard/components/index.ts @@ -12,13 +12,13 @@ export * from './PaginationOptions'; export * from './account-balance/AccountBalance'; export * from './coins'; -export * from './AppList'; -export * from './Cards'; -export * from './Buttons'; +export * from './app-list'; +export * from './cards'; +export * from './buttons'; export * from './transactions'; export * from './staking-overview'; export * from './ExplorerLink'; -export * from './Dialogs'; +export * from './dialogs'; export * from './ValidatorStakingData'; export * from './tiles'; export * from './migration'; @@ -28,3 +28,4 @@ export * from './StakeRewardsPanel'; export * from './MigrationOverview'; export * from './SupplyIncreaseVestingOverview'; export * from './staked-timelock-object'; +export * from './loading'; diff --git a/apps/wallet-dashboard/components/loading/Loading.tsx b/apps/wallet-dashboard/components/loading/Loading.tsx new file mode 100644 index 00000000000..cea927d254c --- /dev/null +++ b/apps/wallet-dashboard/components/loading/Loading.tsx @@ -0,0 +1,20 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +import { LoadingIndicator, type LoadingIndicatorProps } from '@iota/apps-ui-kit'; +import type { ReactNode } from 'react'; + +interface LoadingProps extends LoadingIndicatorProps { + loading: boolean; + children: ReactNode | ReactNode[]; +} + +export function Loading({ loading, children, ...indicatorProps }: LoadingProps) { + return loading ? ( + <div className="flex h-full w-full items-center justify-center"> + <LoadingIndicator {...indicatorProps} /> + </div> + ) : ( + <>{children}</> + ); +} diff --git a/apps/wallet-dashboard/components/loading/index.ts b/apps/wallet-dashboard/components/loading/index.ts new file mode 100644 index 00000000000..0c903d2dc5e --- /dev/null +++ b/apps/wallet-dashboard/components/loading/index.ts @@ -0,0 +1,4 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +export * from './Loading'; diff --git a/apps/wallet-dashboard/components/migration/MigrationObjectsPanel.tsx b/apps/wallet-dashboard/components/migration/MigrationObjectsPanel.tsx index 348ccd6b02b..4e6df6ad374 100644 --- a/apps/wallet-dashboard/components/migration/MigrationObjectsPanel.tsx +++ b/apps/wallet-dashboard/components/migration/MigrationObjectsPanel.tsx @@ -3,7 +3,7 @@ 'use client'; -import { useGroupedMigrationObjectsByExpirationDate } from '@/hooks'; +import { useGroupedStardustObjects } from '@/hooks'; import { STARDUST_MIGRATABLE_OBJECTS_FILTER_LIST, STARDUST_TIMELOCKED_OBJECTS_FILTER_LIST, @@ -36,13 +36,13 @@ const FILTERS = { interface MigrationObjectsPanelProps { selectedObjects: IotaObjectData[]; onClose: () => void; - isTimelocked: boolean; + groupByTimelockUC: boolean; } export function MigrationObjectsPanel({ selectedObjects, onClose, - isTimelocked, + groupByTimelockUC, }: MigrationObjectsPanelProps): React.JSX.Element { const [stardustOutputDetailsFilter, setStardustOutputDetailsFilter] = useState<StardustOutputDetailsFilter>(StardustOutputDetailsFilter.All); @@ -51,11 +51,11 @@ export function MigrationObjectsPanel({ data: resolvedObjects = [], isLoading, error: isErrored, - } = useGroupedMigrationObjectsByExpirationDate(selectedObjects, isTimelocked); + } = useGroupedStardustObjects(selectedObjects, groupByTimelockUC); const filteredObjects = filterMigrationObjects(resolvedObjects, stardustOutputDetailsFilter); - const filters = isTimelocked ? FILTERS.timelocked : FILTERS.migratable; + const filters = groupByTimelockUC ? FILTERS.timelocked : FILTERS.migratable; const isHidden = selectedObjects.length === 0; return ( @@ -101,7 +101,7 @@ export function MigrationObjectsPanel({ render={(migrationObject) => ( <MigrationObjectDetailsCard migrationObject={migrationObject} - isTimelocked={isTimelocked} + isTimelocked={groupByTimelockUC} /> )} /> diff --git a/apps/wallet-dashboard/components/migration/index.ts b/apps/wallet-dashboard/components/migration/index.ts index 2690e18d11b..be5fbb96d1a 100644 --- a/apps/wallet-dashboard/components/migration/index.ts +++ b/apps/wallet-dashboard/components/migration/index.ts @@ -3,3 +3,4 @@ export * from './MigrationObjectsPanel'; export * from './MigrationObjectLoading'; +export * from './migration-object-details-card'; diff --git a/apps/wallet-dashboard/components/staking-overview/StartStaking.tsx b/apps/wallet-dashboard/components/staking-overview/StartStaking.tsx index 573a254a3d2..ab99da76411 100644 --- a/apps/wallet-dashboard/components/staking-overview/StartStaking.tsx +++ b/apps/wallet-dashboard/components/staking-overview/StartStaking.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { StakeDialog, useStakeDialog } from '../Dialogs'; +import { StakeDialog, useStakeDialog } from '../dialogs'; import { Theme, useTheme } from '@iota/core'; import { Banner } from '../Banner'; diff --git a/apps/wallet-dashboard/components/tiles/AssetTileLink.tsx b/apps/wallet-dashboard/components/tiles/AssetTileLink.tsx index 6d5d25d23b7..08af2c2e683 100644 --- a/apps/wallet-dashboard/components/tiles/AssetTileLink.tsx +++ b/apps/wallet-dashboard/components/tiles/AssetTileLink.tsx @@ -3,7 +3,7 @@ 'use client'; -import { AssetCategory } from '@/lib/enums'; +import { AssetCategory } from '@iota/core'; import { VisibilityOff } from '@iota/ui-icons'; import { VisualAssetTile } from '.'; import { IotaObjectData } from '@iota/iota-sdk/client'; @@ -11,7 +11,7 @@ import { NonVisualAssetCard } from './NonVisualAssetTile'; interface AssetTileLinkProps { asset: IotaObjectData; - type: AssetCategory; + type: AssetCategory | null; onClick: (asset: IotaObjectData) => void; } diff --git a/apps/wallet-dashboard/components/transactions/TransactionTile.tsx b/apps/wallet-dashboard/components/transactions/TransactionTile.tsx index 0441adda3c6..f79915abcb4 100644 --- a/apps/wallet-dashboard/components/transactions/TransactionTile.tsx +++ b/apps/wallet-dashboard/components/transactions/TransactionTile.tsx @@ -4,9 +4,6 @@ 'use client'; import { useState } from 'react'; -import { TransactionIcon } from './TransactionIcon'; -import formatTimestamp from '@/lib/utils/time'; -import { ExtendedTransaction, TransactionState } from '@/lib/interfaces'; import { Card, CardType, @@ -18,11 +15,21 @@ import { CardActionType, Dialog, } from '@iota/apps-ui-kit'; -import { useFormatCoin, getLabel, useTransactionSummary } from '@iota/core'; +import { + useFormatCoin, + getTransactionAction, + useTransactionSummary, + ExtendedTransaction, + TransactionState, + TransactionIcon, + checkIfIsTimelockedStaking, + getTransactionAmountForTimelocked, + formatDate, +} from '@iota/core'; import { IOTA_TYPE_ARG } from '@iota/iota-sdk/utils'; import { useCurrentAccount } from '@iota/dapp-kit'; -import { TransactionDetailsLayout } from '../Dialogs/transaction/TransactionDetailsLayout'; -import { DialogLayout } from '../Dialogs/layout'; +import { TransactionDetailsLayout } from '../dialogs/transaction/TransactionDetailsLayout'; +import { DialogLayout } from '../dialogs/layout'; interface TransactionTileProps { transaction: ExtendedTransaction; @@ -38,16 +45,33 @@ export function TransactionTile({ transaction }: TransactionTileProps): JSX.Elem currentAddress: account?.address, recognizedPackagesList: [], }); - const [formatAmount, symbol] = useFormatCoin( - Math.abs(Number(address ? transactionSummary?.balanceChanges?.[address]?.[0]?.amount : 0)), - IOTA_TYPE_ARG, + + const { isTimelockedStaking, isTimelockedUnstaking } = checkIfIsTimelockedStaking( + transaction.raw?.events, ); + const balanceChanges = transactionSummary?.balanceChanges; + + function getAmount(tx: ExtendedTransaction) { + if ((isTimelockedStaking || isTimelockedUnstaking) && tx.raw.events) { + return getTransactionAmountForTimelocked(tx.raw.events); + } else { + return address && balanceChanges?.[address]?.[0]?.amount + ? Math.abs(Number(balanceChanges?.[address]?.[0]?.amount)) + : 0; + } + } + + const transactionAmount = getAmount(transaction); + const [formatAmount, symbol] = useFormatCoin(transactionAmount, IOTA_TYPE_ARG); + function openDetailsDialog() { setOpen(true); } - const transactionDate = transaction?.timestamp && formatTimestamp(transaction.timestamp); + const transactionDate = + transaction?.timestamp && + formatDate(Number(transaction?.timestamp), ['month', 'day', 'hour', 'minute']); return ( <> @@ -55,7 +79,7 @@ export function TransactionTile({ transaction }: TransactionTileProps): JSX.Elem <CardImage type={ImageType.BgSolid} shape={ImageShape.SquareRounded}> <TransactionIcon txnFailed={transaction.state === TransactionState.Failed} - variant={getLabel(transaction?.raw, address)} + variant={getTransactionAction(transaction?.raw, address)} /> </CardImage> <CardBody diff --git a/apps/wallet-dashboard/components/transactions/index.ts b/apps/wallet-dashboard/components/transactions/index.ts index 163627a5922..276bc9ee5f6 100644 --- a/apps/wallet-dashboard/components/transactions/index.ts +++ b/apps/wallet-dashboard/components/transactions/index.ts @@ -4,6 +4,5 @@ export * from './TransactionAmount'; export * from './TransactionSummary'; export * from './TransactionTile'; -export * from './TransactionIcon'; export * from './TransactionsList'; export * from './TransactionsOverview'; diff --git a/apps/wallet-dashboard/hooks/index.ts b/apps/wallet-dashboard/hooks/index.ts index e5ebbf33490..c54d887f0f2 100644 --- a/apps/wallet-dashboard/hooks/index.ts +++ b/apps/wallet-dashboard/hooks/index.ts @@ -10,6 +10,6 @@ export * from './useTimelockedUnstakeTransaction'; export * from './useExplorerLinkGetter'; export * from './useGetStardustMigratableObjects'; export * from './useGetSupplyIncreaseVestingObjects'; -export * from './useGroupedMigrationObjectsByExpirationDate'; +export * from './useGroupedStardustObjects'; export * from './useTransferTransaction'; export * from './usePersistedNetwork'; diff --git a/apps/wallet-dashboard/hooks/useGroupedMigrationObjectsByExpirationDate.ts b/apps/wallet-dashboard/hooks/useGroupedStardustObjects.ts similarity index 91% rename from apps/wallet-dashboard/hooks/useGroupedMigrationObjectsByExpirationDate.ts rename to apps/wallet-dashboard/hooks/useGroupedStardustObjects.ts index d9d96816fd2..6c54e672ba0 100644 --- a/apps/wallet-dashboard/hooks/useGroupedMigrationObjectsByExpirationDate.ts +++ b/apps/wallet-dashboard/hooks/useGroupedStardustObjects.ts @@ -13,9 +13,9 @@ import { useQuery } from '@tanstack/react-query'; import { useGetCurrentEpochStartTimestamp } from './useGetCurrentEpochStartTimestamp'; import { useGetCurrentEpochEndTimestamp } from './useGetCurrentEpochEndTimestamp'; -export function useGroupedMigrationObjectsByExpirationDate( +export function useGroupedStardustObjects( objects: IotaObjectData[], - isTimelockUnlockCondition: boolean = false, + groupByTimelockUC: boolean = false, ) { const client = useIotaClient(); const address = useCurrentAccount()?.address; @@ -32,7 +32,7 @@ export function useGroupedMigrationObjectsByExpirationDate( 'grouped-migration-objects', objects, address, - isTimelockUnlockCondition, + groupByTimelockUC, epochStartMs, epochEndMs, ], @@ -44,7 +44,7 @@ export function useGroupedMigrationObjectsByExpirationDate( objects, client, address, - isTimelockUnlockCondition, + groupByTimelockUC, ); return sortStardustResolvedObjectsByExpiration( diff --git a/apps/wallet-dashboard/lib/constants/routes.constants.ts b/apps/wallet-dashboard/lib/constants/routes.constants.ts index 5d8d27d33e3..e66fcacd86a 100644 --- a/apps/wallet-dashboard/lib/constants/routes.constants.ts +++ b/apps/wallet-dashboard/lib/constants/routes.constants.ts @@ -3,7 +3,7 @@ import type { ProtectedRoute } from '../interfaces'; import { ProtectedRouteTitle } from '../enums'; -import { Activity, Assets, Calendar, Home, Tokens, Vesting } from '@iota/ui-icons'; +import { Activity, Assets, Calendar, Home, Stake, Vesting } from '@iota/ui-icons'; export const HOMEPAGE_ROUTE: ProtectedRoute = { title: ProtectedRouteTitle.Home, @@ -20,13 +20,13 @@ export const ASSETS_ROUTE: ProtectedRoute = { export const STAKING_ROUTE: ProtectedRoute = { title: ProtectedRouteTitle.Staking, path: '/staking', - icon: Activity, + icon: Stake, }; export const ACTIVITY_ROUTE: ProtectedRoute = { title: ProtectedRouteTitle.Activity, path: '/activity', - icon: Tokens, + icon: Activity, }; export const MIGRATIONS_ROUTE: ProtectedRoute = { title: ProtectedRouteTitle.Migrations, diff --git a/apps/wallet-dashboard/lib/enums/assetCategory.enum.ts b/apps/wallet-dashboard/lib/enums/assetCategory.enums.ts similarity index 70% rename from apps/wallet-dashboard/lib/enums/assetCategory.enum.ts rename to apps/wallet-dashboard/lib/enums/assetCategory.enums.ts index bab9839ceaa..b7d45b16343 100644 --- a/apps/wallet-dashboard/lib/enums/assetCategory.enum.ts +++ b/apps/wallet-dashboard/lib/enums/assetCategory.enums.ts @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 export enum AssetCategory { - Visual = 'Visual', - Other = 'Other', + Visual = 'visual', + Other = 'other', } diff --git a/apps/wallet-dashboard/lib/enums/index.ts b/apps/wallet-dashboard/lib/enums/index.ts index 6d936d1ec45..8cac53c8275 100644 --- a/apps/wallet-dashboard/lib/enums/index.ts +++ b/apps/wallet-dashboard/lib/enums/index.ts @@ -1,8 +1,8 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -export * from './protectedRouteTitle.enum'; -export * from './assetCategory.enum'; +export * from './protectedRouteTitle.enums'; +export * from './assetCategory.enums'; export * from './commonMigrationObjectType.enums'; -export * from './stardustOutputDetailsFilter.enum'; -export * from './stardustOutputMigrationStatus.enum'; +export * from './stardustOutputDetailsFilter.enums'; +export * from './stardustOutputMigrationStatus.enums'; diff --git a/apps/wallet-dashboard/lib/enums/protectedRouteTitle.enum.ts b/apps/wallet-dashboard/lib/enums/protectedRouteTitle.enums.ts similarity index 100% rename from apps/wallet-dashboard/lib/enums/protectedRouteTitle.enum.ts rename to apps/wallet-dashboard/lib/enums/protectedRouteTitle.enums.ts diff --git a/apps/wallet-dashboard/lib/enums/stardustOutputDetailsFilter.enum.ts b/apps/wallet-dashboard/lib/enums/stardustOutputDetailsFilter.enums.ts similarity index 100% rename from apps/wallet-dashboard/lib/enums/stardustOutputDetailsFilter.enum.ts rename to apps/wallet-dashboard/lib/enums/stardustOutputDetailsFilter.enums.ts diff --git a/apps/wallet-dashboard/lib/enums/stardustOutputMigrationStatus.enum.ts b/apps/wallet-dashboard/lib/enums/stardustOutputMigrationStatus.enums.ts similarity index 100% rename from apps/wallet-dashboard/lib/enums/stardustOutputMigrationStatus.enum.ts rename to apps/wallet-dashboard/lib/enums/stardustOutputMigrationStatus.enums.ts diff --git a/apps/wallet-dashboard/lib/interfaces/appRoute.interface.ts b/apps/wallet-dashboard/lib/interfaces/appRoute.interfaces.ts similarity index 100% rename from apps/wallet-dashboard/lib/interfaces/appRoute.interface.ts rename to apps/wallet-dashboard/lib/interfaces/appRoute.interfaces.ts diff --git a/apps/wallet-dashboard/lib/interfaces/dialogView.interface.ts b/apps/wallet-dashboard/lib/interfaces/dialogView.interfaces.ts similarity index 100% rename from apps/wallet-dashboard/lib/interfaces/dialogView.interface.ts rename to apps/wallet-dashboard/lib/interfaces/dialogView.interfaces.ts diff --git a/apps/wallet-dashboard/lib/interfaces/index.ts b/apps/wallet-dashboard/lib/interfaces/index.ts index 6999e34dd61..27ca0836eb4 100644 --- a/apps/wallet-dashboard/lib/interfaces/index.ts +++ b/apps/wallet-dashboard/lib/interfaces/index.ts @@ -1,8 +1,8 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -export * from './transactions.interface'; -export * from './timelock.interface'; -export * from './vesting.interface'; -export * from './appRoute.interface'; -export * from './dialogView.interface'; +export * from './transactions.interfaces'; +export * from './timelock.interfaces'; +export * from './vesting.interfaces'; +export * from './appRoute.interfaces'; +export * from './dialogView.interfaces'; diff --git a/apps/wallet-dashboard/lib/interfaces/timelock.interface.ts b/apps/wallet-dashboard/lib/interfaces/timelock.interfaces.ts similarity index 100% rename from apps/wallet-dashboard/lib/interfaces/timelock.interface.ts rename to apps/wallet-dashboard/lib/interfaces/timelock.interfaces.ts diff --git a/apps/wallet-dashboard/lib/interfaces/transactions.interfaces.ts b/apps/wallet-dashboard/lib/interfaces/transactions.interfaces.ts new file mode 100644 index 00000000000..4c4ea3c1962 --- /dev/null +++ b/apps/wallet-dashboard/lib/interfaces/transactions.interfaces.ts @@ -0,0 +1,29 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +import { IotaTransactionBlockResponse } from '@iota/iota-sdk/client'; + +export interface ExtendedTransaction { + action: TransactionAction; + timestamp?: number; + state: TransactionState; + raw: IotaTransactionBlockResponse; +} + +export enum TransactionAction { + Send = 'Send', + Receive = 'Receive', + Transaction = 'Transaction', + Staked = 'Staked', + Unstaked = 'Unstaked', + TimelockedStaked = 'Timelocked Staked', + TimelockedUnstaked = 'Timelocked Unstaked', + Rewards = 'Rewards', + PersonalMessage = 'PersonalMessage', +} + +export enum TransactionState { + Successful = 'successful', + Failed = 'failed', + Pending = 'pending', +} diff --git a/apps/wallet-dashboard/lib/interfaces/vesting.interface.ts b/apps/wallet-dashboard/lib/interfaces/vesting.interfaces.ts similarity index 100% rename from apps/wallet-dashboard/lib/interfaces/vesting.interface.ts rename to apps/wallet-dashboard/lib/interfaces/vesting.interfaces.ts diff --git a/apps/wallet-dashboard/lib/ui/enums/flex-direction.enums.ts b/apps/wallet-dashboard/lib/ui/enums/flexDirection.enums.ts similarity index 100% rename from apps/wallet-dashboard/lib/ui/enums/flex-direction.enums.ts rename to apps/wallet-dashboard/lib/ui/enums/flexDirection.enums.ts diff --git a/apps/wallet-dashboard/lib/ui/enums/index.ts b/apps/wallet-dashboard/lib/ui/enums/index.ts index 416ee72bd74..ac0d7e3ead5 100644 --- a/apps/wallet-dashboard/lib/ui/enums/index.ts +++ b/apps/wallet-dashboard/lib/ui/enums/index.ts @@ -1,4 +1,4 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -export * from './flex-direction.enums'; +export * from './flexDirection.enums'; diff --git a/apps/wallet-dashboard/lib/utils/migration/groupMigrationObjects.ts b/apps/wallet-dashboard/lib/utils/migration/groupMigrationObjects.ts index 73991f4ac09..bc7523039c6 100644 --- a/apps/wallet-dashboard/lib/utils/migration/groupMigrationObjects.ts +++ b/apps/wallet-dashboard/lib/utils/migration/groupMigrationObjects.ts @@ -16,7 +16,7 @@ import { STARDUST_BASIC_OUTPUT_TYPE, STARDUST_NFT_OUTPUT_TYPE, } from '@iota/core'; -import { extractMigrationOutputFields, extractOwnedStorageDepositReturnAmount } from '.'; +import { extractOutputFields, extractOwnedStorageDepositReturnAmount } from '.'; import { IotaClient, IotaObjectData } from '@iota/iota-sdk/client'; import { MIGRATION_OBJECT_WITHOUT_UC_KEY } from '@/lib/constants'; @@ -24,7 +24,7 @@ export async function groupMigrationObjectsByUnlockCondition( objectsData: IotaObjectData[], client: IotaClient, currentAddress: string = '', - isTimelockUnlockCondition: boolean = false, + groupByTimelockUC: boolean = false, // If true, group by timelock unlock condition, else group by expiration unlock condition ): Promise<ResolvedObjectTypes[]> { const flatObjects: ResolvedObjectTypes[] = []; const basicObjectMap: Map<string, ResolvedBasicObject> = new Map(); @@ -37,10 +37,10 @@ export async function groupMigrationObjectsByUnlockCondition( const chunk = objectsData.slice(i, i + PROMISE_CHUNK_SIZE); const promises = chunk.map(async (object) => { - const objectFields = extractMigrationOutputFields(object); + const objectFields = extractOutputFields(object); let groupKey: string | undefined; - if (isTimelockUnlockCondition) { + if (groupByTimelockUC) { const timestamp = objectFields.timelock_uc?.fields.unix_time.toString(); groupKey = timestamp; } else { @@ -54,32 +54,29 @@ export async function groupMigrationObjectsByUnlockCondition( return; } - if (object.type === STARDUST_BASIC_OUTPUT_TYPE) { - const existing = basicObjectMap.get(groupKey); - const gasReturn = extractOwnedStorageDepositReturnAmount( - objectFields, - currentAddress, - ); - const newBalance = - (existing ? existing.balance : 0n) + - BigInt(objectFields.balance) + - (gasReturn ?? 0n); + const existingBasicObject = basicObjectMap.get(groupKey); + const gasReturn = extractOwnedStorageDepositReturnAmount(objectFields, currentAddress); + const newBalance = + (existingBasicObject ? existingBasicObject.balance : 0n) + + BigInt(objectFields.balance) + + (gasReturn ?? 0n); - if (existing) { - existing.balance = newBalance; - } else { - const newBasicObject: ResolvedBasicObject = { - balance: newBalance, - unlockConditionTimestamp: groupKey, - type: object.type, - commonObjectType: CommonMigrationObjectType.Basic, - output: object, - uniqueId: objectFields.id.id, - }; - basicObjectMap.set(groupKey, newBasicObject); - flatObjects.push(newBasicObject); - } - } else if (object.type === STARDUST_NFT_OUTPUT_TYPE) { + if (existingBasicObject) { + existingBasicObject.balance = newBalance; + } else { + const newBasicObject: ResolvedBasicObject = { + balance: newBalance, + unlockConditionTimestamp: groupKey, + type: STARDUST_BASIC_OUTPUT_TYPE, + commonObjectType: CommonMigrationObjectType.Basic, + output: object, + uniqueId: objectFields.id.id, + }; + basicObjectMap.set(groupKey, newBasicObject); + flatObjects.push(newBasicObject); + } + + if (object.type === STARDUST_NFT_OUTPUT_TYPE) { const nftDetails = await getNftDetails(object, groupKey, client); flatObjects.push(...nftDetails); } @@ -160,7 +157,7 @@ async function getNftDetails( expirationKey: UnlockConditionTimestamp, client: IotaClient, ): Promise<ResolvedNftObject[]> { - const objectFields = extractMigrationOutputFields(object); + const objectFields = extractOutputFields(object); const nftOutputDynamicFields = await client.getDynamicFields({ parentId: objectFields.id.id, }); @@ -195,7 +192,7 @@ async function extractNativeTokensFromObject( client: IotaClient, expirationKey: UnlockConditionTimestamp, ): Promise<ResolvedNativeToken[]> { - const fields = extractMigrationOutputFields(object); + const fields = extractOutputFields(object); const bagId = fields.native_tokens.fields.id.id; const bagSize = Number(fields.native_tokens.fields.size); diff --git a/apps/wallet-dashboard/lib/utils/migration/groupStardustObjectsByMigrationStatus.ts b/apps/wallet-dashboard/lib/utils/migration/groupStardustObjectsByMigrationStatus.ts index b10f1cf4218..5c0a20a824c 100644 --- a/apps/wallet-dashboard/lib/utils/migration/groupStardustObjectsByMigrationStatus.ts +++ b/apps/wallet-dashboard/lib/utils/migration/groupStardustObjectsByMigrationStatus.ts @@ -3,6 +3,9 @@ import { CommonOutputObjectWithUc, MILLISECONDS_PER_SECOND } from '@iota/core'; import { IotaObjectData } from '@iota/iota-sdk/client'; +import { filterMigrationObjects } from './filterMigrationObjectDetails'; +import { CommonMigrationObjectType, StardustOutputDetailsFilter } from '@/lib/enums'; +import { ResolvedObjectTypes } from '@/lib/types'; export type StardustMigrationGroupedObjects = { migratable: IotaObjectData[]; @@ -20,7 +23,7 @@ export function groupStardustObjectsByMigrationStatus( const epochUnix = epochTimestampMs / MILLISECONDS_PER_SECOND; for (const outputObject of stardustOutputObjects) { - const outputObjectFields = extractMigrationOutputFields(outputObject); + const outputObjectFields = extractOutputFields(outputObject); if ( outputObjectFields.timelock_uc && @@ -47,36 +50,46 @@ export function groupStardustObjectsByMigrationStatus( return { migratable, timelocked }; } -interface MigratableObjectsData { +interface StardustObjectsTotals { totalNativeTokens: number; totalVisualAssets: number; totalIotaAmount: bigint; totalNotOwnedStorageDepositReturnAmount: bigint; } -interface SummarizeMigrationObjectParams { +interface StardustObjectsTotalsParams { basicOutputs: IotaObjectData[] | undefined; nftOutputs: IotaObjectData[] | undefined; address: string; + resolvedObjects?: ResolvedObjectTypes[]; } -export function summarizeMigratableObjectValues({ +export function getStardustObjectsTotals({ basicOutputs = [], nftOutputs = [], address, -}: SummarizeMigrationObjectParams): MigratableObjectsData { + resolvedObjects, +}: StardustObjectsTotalsParams): StardustObjectsTotals { let totalNativeTokens = 0; let totalIotaAmount: bigint = 0n; let totalNotOwnedStorageDepositReturnAmount: bigint = 0n; + let filteredObjects: ResolvedObjectTypes[] = []; const totalVisualAssets = nftOutputs.length; const outputObjects = [...basicOutputs, ...nftOutputs]; + if (resolvedObjects) { + filteredObjects = filterMigrationObjects( + resolvedObjects, + StardustOutputDetailsFilter.NativeTokens, + ); + } + totalNativeTokens = getUniqueNativeTokensByCoinType(filteredObjects); + for (const output of outputObjects) { - const outputObjectFields = extractMigrationOutputFields(output); + const outputObjectFields = extractOutputFields(output); totalIotaAmount += BigInt(outputObjectFields.balance); - totalNativeTokens += parseInt(outputObjectFields.native_tokens.fields.size); totalIotaAmount += extractOwnedStorageDepositReturnAmount(outputObjectFields, address) || 0n; totalNotOwnedStorageDepositReturnAmount += @@ -91,29 +104,6 @@ export function summarizeMigratableObjectValues({ }; } -interface UnmmigratableObjectsData { - totalTimelockedObjects: number; -} - -export function summarizeTimelockedObjectValues({ - basicOutputs = [], - nftOutputs = [], -}: Omit<SummarizeMigrationObjectParams, 'address'>): UnmmigratableObjectsData { - const basicObjects = basicOutputs.length; - const nftObjects = nftOutputs.length; - let nativeTokens = 0; - - for (const output of [...basicOutputs, ...nftOutputs]) { - const outputObjectFields = extractMigrationOutputFields(output); - - nativeTokens += parseInt(outputObjectFields.native_tokens.fields.size); - } - - const totalTimelockedObjects = basicObjects + nativeTokens + nftObjects; - - return { totalTimelockedObjects }; -} - export function extractOwnedStorageDepositReturnAmount( { storage_deposit_return_uc }: CommonOutputObjectWithUc, address: string, @@ -127,9 +117,7 @@ export function extractOwnedStorageDepositReturnAmount( return null; } -export function extractMigrationOutputFields( - outputObject: IotaObjectData, -): CommonOutputObjectWithUc { +export function extractOutputFields(outputObject: IotaObjectData): CommonOutputObjectWithUc { return ( outputObject.content as unknown as { fields: CommonOutputObjectWithUc; @@ -149,3 +137,11 @@ export function extractNotOwnedStorageDepositReturnAmount( } return null; } + +export function getUniqueNativeTokensByCoinType(objects: ResolvedObjectTypes[]): number { + return new Set( + objects + .filter((obj) => obj.commonObjectType === CommonMigrationObjectType.NativeToken) + .map((obj) => obj.coinType), + ).size; +} diff --git a/apps/wallet-dashboard/lib/utils/time.ts b/apps/wallet-dashboard/lib/utils/time.ts index 8c66df0c883..9df8d1969f0 100644 --- a/apps/wallet-dashboard/lib/utils/time.ts +++ b/apps/wallet-dashboard/lib/utils/time.ts @@ -1,11 +1,6 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -export default function formatTimestamp(timeStamp: number): string { - const date = new Date(timeStamp); - return new Intl.DateTimeFormat('en-US').format(date); -} - export function parseTimestamp(timestampMs: string): number { const timestamp = parseInt(timestampMs, 10); if (!Number.isFinite(timestamp)) { diff --git a/apps/wallet-dashboard/lib/utils/transaction.ts b/apps/wallet-dashboard/lib/utils/transaction.ts index bc7f08c2756..f89f3281619 100644 --- a/apps/wallet-dashboard/lib/utils/transaction.ts +++ b/apps/wallet-dashboard/lib/utils/transaction.ts @@ -1,9 +1,9 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { ExtendedTransaction, TransactionAction, TransactionState } from '@/lib/interfaces'; import { IotaTransactionBlockResponse } from '@iota/iota-sdk/client'; import { parseTimestamp } from './time'; +import { TransactionState, ExtendedTransaction, getTransactionAction } from '@iota/core'; const getTransactionTransactionState = (tx: IotaTransactionBlockResponse): TransactionState => { const executionStatus = tx.effects?.status.status; @@ -20,14 +20,6 @@ const getTransactionTransactionState = (tx: IotaTransactionBlockResponse): Trans return TransactionState.Pending; }; -export const getTransactionAction = ( - transaction: IotaTransactionBlockResponse, - currentAddress: string, -) => { - const isSender = transaction.transaction?.data.sender === currentAddress; - return isSender ? TransactionAction.Send : TransactionAction.Receive; -}; - export const getExtendedTransaction = ( tx: IotaTransactionBlockResponse, address: string, diff --git a/apps/wallet-dashboard/tailwind.config.ts b/apps/wallet-dashboard/tailwind.config.ts index 2ca1f1c0824..720d34d31fd 100644 --- a/apps/wallet-dashboard/tailwind.config.ts +++ b/apps/wallet-dashboard/tailwind.config.ts @@ -3,7 +3,7 @@ import type { Config } from 'tailwindcss'; // Note: exception for the tailwind preset import -import uiKitResponsivePreset from '../../apps/ui-kit/src/lib/tailwind/responsive.preset'; +import uiKitResponsivePreset from '../../apps/ui-kit/src/lib/tailwind/responsive.presets'; export default { presets: [uiKitResponsivePreset], diff --git a/apps/wallet/src/background/account-sources/AccountSource.ts b/apps/wallet/src/background/account-sources/accountSource.ts similarity index 97% rename from apps/wallet/src/background/account-sources/AccountSource.ts rename to apps/wallet/src/background/account-sources/accountSource.ts index 47cf674fcb1..54d49e5be40 100644 --- a/apps/wallet/src/background/account-sources/AccountSource.ts +++ b/apps/wallet/src/background/account-sources/accountSource.ts @@ -9,7 +9,7 @@ import { clearEphemeralValue, getEphemeralValue, setEphemeralValue, -} from '../session-ephemeral-values'; +} from '../sessionEphemeralValues'; export enum AccountSourceType { Mnemonic = 'mnemonic', diff --git a/apps/wallet/src/background/account-sources/index.ts b/apps/wallet/src/background/account-sources/index.ts index e22684b6a71..9524d8d7e22 100644 --- a/apps/wallet/src/background/account-sources/index.ts +++ b/apps/wallet/src/background/account-sources/index.ts @@ -6,13 +6,13 @@ import { createMessage, type Message } from '_src/shared/messaging/messages'; import { isMethodPayload, type MethodPayload, -} from '_src/shared/messaging/messages/payloads/MethodPayload'; +} from '_src/shared/messaging/messages/payloads/methodPayload'; -import { type UiConnection } from '../connections/UiConnection'; +import { type UiConnection } from '../connections/uiConnection'; import { getDB } from '../db'; -import { AccountSourceType, type AccountSourceSerialized } from './AccountSource'; -import { MnemonicAccountSource } from './MnemonicAccountSource'; -import { SeedAccountSource } from './SeedAccountSource'; +import { AccountSourceType, type AccountSourceSerialized } from './accountSource'; +import { MnemonicAccountSource } from './mnemonicAccountSource'; +import { SeedAccountSource } from './seedAccountSource'; import { toEntropy } from '_src/shared/utils'; function toAccountSource(accountSource: AccountSourceSerialized) { diff --git a/apps/wallet/src/background/account-sources/MnemonicAccountSource.ts b/apps/wallet/src/background/account-sources/mnemonicAccountSource.ts similarity index 97% rename from apps/wallet/src/background/account-sources/MnemonicAccountSource.ts rename to apps/wallet/src/background/account-sources/mnemonicAccountSource.ts index 72820f4497b..4030b2ead83 100644 --- a/apps/wallet/src/background/account-sources/MnemonicAccountSource.ts +++ b/apps/wallet/src/background/account-sources/mnemonicAccountSource.ts @@ -19,16 +19,16 @@ import Dexie from 'dexie'; import { getAccountSources } from '.'; import { getAllAccounts } from '../accounts'; -import { MnemonicAccount, type MnemonicSerializedAccount } from '../accounts/MnemonicAccount'; -import { setupAutoLockAlarm } from '../auto-lock-accounts'; +import { MnemonicAccount, type MnemonicSerializedAccount } from '../accounts/mnemonicAccount'; +import { setupAutoLockAlarm } from '../autoLockAccounts'; import { backupDB, getDB } from '../db'; -import { makeUniqueKey } from '../storage-utils'; +import { makeUniqueKey } from '../storageUtils'; import { AccountSource, AccountSourceType, type AccountSourceSerialized, type AccountSourceSerializedUI, -} from './AccountSource'; +} from './accountSource'; import { accountSourcesEvents } from './events'; import { type MakeDerivationOptions, makeDerivationPath } from './bip44Path'; diff --git a/apps/wallet/src/background/account-sources/SeedAccountSource.ts b/apps/wallet/src/background/account-sources/seedAccountSource.ts similarity index 97% rename from apps/wallet/src/background/account-sources/SeedAccountSource.ts rename to apps/wallet/src/background/account-sources/seedAccountSource.ts index ff4b3e094b9..69a1a202e1e 100644 --- a/apps/wallet/src/background/account-sources/SeedAccountSource.ts +++ b/apps/wallet/src/background/account-sources/seedAccountSource.ts @@ -9,16 +9,16 @@ import Dexie from 'dexie'; import { getAccountSources } from '.'; import { getAllAccounts } from '../accounts'; -import { SeedAccount, type SeedSerializedAccount } from '../accounts/SeedAccount'; -import { setupAutoLockAlarm } from '../auto-lock-accounts'; +import { SeedAccount, type SeedSerializedAccount } from '../accounts/seedAccount'; +import { setupAutoLockAlarm } from '../autoLockAccounts'; import { backupDB, getDB } from '../db'; -import { makeUniqueKey } from '../storage-utils'; +import { makeUniqueKey } from '../storageUtils'; import { AccountSource, AccountSourceType, type AccountSourceSerialized, type AccountSourceSerializedUI, -} from './AccountSource'; +} from './accountSource'; import { accountSourcesEvents } from './events'; import { type MakeDerivationOptions, makeDerivationPath } from './bip44Path'; diff --git a/apps/wallet/src/background/accounts/Account.ts b/apps/wallet/src/background/accounts/account.ts similarity index 98% rename from apps/wallet/src/background/accounts/Account.ts rename to apps/wallet/src/background/accounts/account.ts index 9ab33a5d47c..59549cb4de6 100644 --- a/apps/wallet/src/background/accounts/Account.ts +++ b/apps/wallet/src/background/accounts/account.ts @@ -6,13 +6,13 @@ import { type Serializable } from '_src/shared/cryptography/keystore'; import { toSerializedSignature, type Keypair } from '@iota/iota-sdk/cryptography'; import { blake2b } from '@noble/hashes/blake2b'; -import { setupAutoLockAlarm } from '../auto-lock-accounts'; +import { setupAutoLockAlarm } from '../autoLockAccounts'; import { getDB } from '../db'; import { clearEphemeralValue, getEphemeralValue, setEphemeralValue, -} from '../session-ephemeral-values'; +} from '../sessionEphemeralValues'; import { accountsEvents } from './events'; export enum AccountType { diff --git a/apps/wallet/src/background/accounts/ImportedAccount.ts b/apps/wallet/src/background/accounts/importedAccount.ts similarity index 99% rename from apps/wallet/src/background/accounts/ImportedAccount.ts rename to apps/wallet/src/background/accounts/importedAccount.ts index ac44a31282f..303dfed2de3 100644 --- a/apps/wallet/src/background/accounts/ImportedAccount.ts +++ b/apps/wallet/src/background/accounts/importedAccount.ts @@ -13,7 +13,7 @@ import { type SerializedAccount, type SerializedUIAccount, type SigningAccount, -} from './Account'; +} from './account'; type SessionStorageData = { keyPair: string }; type EncryptedData = { keyPair: string }; diff --git a/apps/wallet/src/background/accounts/index.ts b/apps/wallet/src/background/accounts/index.ts index 665a7b9eddb..189b6e1f1b4 100644 --- a/apps/wallet/src/background/accounts/index.ts +++ b/apps/wallet/src/background/accounts/index.ts @@ -6,30 +6,30 @@ import { createMessage, type Message } from '_src/shared/messaging/messages'; import { isMethodPayload, type MethodPayload, -} from '_src/shared/messaging/messages/payloads/MethodPayload'; +} from '_src/shared/messaging/messages/payloads/methodPayload'; import { type WalletStatusChange } from '_src/shared/messaging/messages/payloads/wallet-status-change'; import { fromB64 } from '@iota/iota-sdk/utils'; import Dexie from 'dexie'; import { getAccountSourceByID } from '../account-sources'; import { accountSourcesEvents } from '../account-sources/events'; -import { MnemonicAccountSource } from '../account-sources/MnemonicAccountSource'; -import { SeedAccountSource } from '../account-sources/SeedAccountSource'; -import { type UiConnection } from '../connections/UiConnection'; +import { MnemonicAccountSource } from '../account-sources/mnemonicAccountSource'; +import { SeedAccountSource } from '../account-sources/seedAccountSource'; +import { type UiConnection } from '../connections/uiConnection'; import { backupDB, getDB } from '../db'; -import { makeUniqueKey } from '../storage-utils'; +import { makeUniqueKey } from '../storageUtils'; import { AccountType, isKeyPairExportableAccount, isPasswordUnLockable, isSigningAccount, type SerializedAccount, -} from './Account'; +} from './account'; import { accountsEvents } from './events'; -import { ImportedAccount } from './ImportedAccount'; -import { LedgerAccount } from './LedgerAccount'; -import { MnemonicAccount } from './MnemonicAccount'; -import { SeedAccount } from './SeedAccount'; +import { ImportedAccount } from './importedAccount'; +import { LedgerAccount } from './ledgerAccount'; +import { MnemonicAccount } from './mnemonicAccount'; +import { SeedAccount } from './seedAccount'; function toAccount(account: SerializedAccount) { if (MnemonicAccount.isOfType(account)) { diff --git a/apps/wallet/src/background/accounts/isMainAccount.ts b/apps/wallet/src/background/accounts/isMainAccount.ts index 0e385c52cf0..9fd860bdbc5 100644 --- a/apps/wallet/src/background/accounts/isMainAccount.ts +++ b/apps/wallet/src/background/accounts/isMainAccount.ts @@ -1,11 +1,11 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { isLedgerAccountSerializedUI } from '_src/background/accounts/LedgerAccount'; -import { isMnemonicSerializedUiAccount } from '_src/background/accounts/MnemonicAccount'; -import { isSeedSerializedUiAccount } from '_src/background/accounts/SeedAccount'; +import { isLedgerAccountSerializedUI } from '_src/background/accounts/ledgerAccount'; +import { isMnemonicSerializedUiAccount } from '_src/background/accounts/mnemonicAccount'; +import { isSeedSerializedUiAccount } from '_src/background/accounts/seedAccount'; import { parseDerivationPath } from '_src/background/account-sources/bip44Path'; -import type { SerializedUIAccount } from '_src/background/accounts/Account'; +import type { SerializedUIAccount } from '_src/background/accounts/account'; export function isMainAccount(account: SerializedUIAccount | null) { if (!account) { diff --git a/apps/wallet/src/background/accounts/LedgerAccount.ts b/apps/wallet/src/background/accounts/ledgerAccount.ts similarity index 99% rename from apps/wallet/src/background/accounts/LedgerAccount.ts rename to apps/wallet/src/background/accounts/ledgerAccount.ts index fbb8ca111c2..477bf379ba9 100644 --- a/apps/wallet/src/background/accounts/LedgerAccount.ts +++ b/apps/wallet/src/background/accounts/ledgerAccount.ts @@ -10,7 +10,7 @@ import { type PasswordUnlockableAccount, type SerializedAccount, type SerializedUIAccount, -} from './Account'; +} from './account'; export interface LedgerAccountSerialized extends SerializedAccount { type: AccountType.LedgerDerived; diff --git a/apps/wallet/src/background/accounts/MnemonicAccount.ts b/apps/wallet/src/background/accounts/mnemonicAccount.ts similarity index 98% rename from apps/wallet/src/background/accounts/MnemonicAccount.ts rename to apps/wallet/src/background/accounts/mnemonicAccount.ts index 0167be027fd..e3c93c843f3 100644 --- a/apps/wallet/src/background/accounts/MnemonicAccount.ts +++ b/apps/wallet/src/background/accounts/mnemonicAccount.ts @@ -5,7 +5,7 @@ import { fromExportedKeypair } from '_src/shared/utils'; import { type Keypair } from '@iota/iota-sdk/cryptography'; -import { MnemonicAccountSource } from '../account-sources/MnemonicAccountSource'; +import { MnemonicAccountSource } from '../account-sources/mnemonicAccountSource'; import { Account, AccountType, @@ -14,7 +14,7 @@ import { type SerializedAccount, type SerializedUIAccount, type SigningAccount, -} from './Account'; +} from './account'; export interface MnemonicSerializedAccount extends SerializedAccount { type: AccountType.MnemonicDerived; diff --git a/apps/wallet/src/background/accounts/SeedAccount.ts b/apps/wallet/src/background/accounts/seedAccount.ts similarity index 98% rename from apps/wallet/src/background/accounts/SeedAccount.ts rename to apps/wallet/src/background/accounts/seedAccount.ts index e2667871adb..0f88a205117 100644 --- a/apps/wallet/src/background/accounts/SeedAccount.ts +++ b/apps/wallet/src/background/accounts/seedAccount.ts @@ -4,7 +4,7 @@ import { fromExportedKeypair } from '_src/shared/utils'; import { type Keypair } from '@iota/iota-sdk/cryptography'; -import { SeedAccountSource } from '../account-sources/SeedAccountSource'; +import { SeedAccountSource } from '../account-sources/seedAccountSource'; import { Account, AccountType, @@ -13,7 +13,7 @@ import { type SerializedAccount, type SerializedUIAccount, type SigningAccount, -} from './Account'; +} from './account'; export interface SeedSerializedAccount extends SerializedAccount { type: AccountType.SeedDerived; diff --git a/apps/wallet/src/background/Alarms.ts b/apps/wallet/src/background/alarms.ts similarity index 100% rename from apps/wallet/src/background/Alarms.ts rename to apps/wallet/src/background/alarms.ts diff --git a/apps/wallet/src/background/auto-lock-accounts.ts b/apps/wallet/src/background/autoLockAccounts.ts similarity index 97% rename from apps/wallet/src/background/auto-lock-accounts.ts rename to apps/wallet/src/background/autoLockAccounts.ts index 474a6846eed..d7287beb0a5 100644 --- a/apps/wallet/src/background/auto-lock-accounts.ts +++ b/apps/wallet/src/background/autoLockAccounts.ts @@ -4,7 +4,7 @@ import { throttle } from 'throttle-debounce'; -import Alarms from './Alarms'; +import Alarms from './alarms'; import { getDB, SETTINGS_KEYS } from './db'; export async function getAutoLockMinutes() { diff --git a/apps/wallet/src/background/connections/Connection.ts b/apps/wallet/src/background/connections/connection.ts similarity index 93% rename from apps/wallet/src/background/connections/Connection.ts rename to apps/wallet/src/background/connections/connection.ts index d7023c9478e..ad0992537c0 100644 --- a/apps/wallet/src/background/connections/Connection.ts +++ b/apps/wallet/src/background/connections/connection.ts @@ -3,7 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Message } from '_messages'; -import { PortStream } from '_messaging/PortStream'; +import { PortStream } from '_src/shared/messaging/portStream'; import { map, take } from 'rxjs'; import type { Runtime } from 'webextension-polyfill'; diff --git a/apps/wallet/src/background/connections/ContentScriptConnection.ts b/apps/wallet/src/background/connections/contentScriptConnection.ts similarity index 94% rename from apps/wallet/src/background/connections/ContentScriptConnection.ts rename to apps/wallet/src/background/connections/contentScriptConnection.ts index 8067c3ee7e5..10f50acc3e2 100644 --- a/apps/wallet/src/background/connections/ContentScriptConnection.ts +++ b/apps/wallet/src/background/connections/contentScriptConnection.ts @@ -4,10 +4,10 @@ import { createMessage } from '_messages'; import type { Message } from '_messages'; -import type { PortChannelName } from '_messaging/PortChannelName'; +import type { PortChannelName } from '_src/shared/messaging/portChannelName'; import { isBasePayload, type ErrorPayload } from '_payloads'; -import { isGetAccount } from '_payloads/account/GetAccount'; -import type { GetAccountResponse } from '_payloads/account/GetAccountResponse'; +import { isGetAccount } from '_src/shared/messaging/messages/payloads/account/getAccount'; +import type { GetAccountResponse } from '_src/shared/messaging/messages/payloads/account/getAccountResponse'; import type { SetNetworkPayload } from '_payloads/network'; import { isAcquirePermissionsRequest, @@ -23,19 +23,19 @@ import { type ExecuteTransactionResponse, type SignTransactionResponse, } from '_payloads/transactions'; -import Permissions from '_src/background/Permissions'; -import Transactions from '_src/background/Transactions'; +import Permissions from '_src/background/permissions'; +import Transactions from '_src/background/transactions'; import { isSignMessageRequest, type SignMessageRequest, -} from '_src/shared/messaging/messages/payloads/transactions/SignMessage'; +} from '_src/shared/messaging/messages/payloads/transactions/signMessage'; import { type IotaTransactionBlockResponse } from '@iota/iota-sdk/client'; import type { Runtime } from 'webextension-polyfill'; import { type SignedTransaction } from '@iota/wallet-standard'; import { getAccountsStatusData } from '../accounts'; -import NetworkEnv from '../NetworkEnv'; -import { Connection } from './Connection'; +import NetworkEnv from '../networkEnv'; +import { Connection } from './connection'; export class ContentScriptConnection extends Connection { public static readonly CHANNEL: PortChannelName = 'iota_content<->background'; diff --git a/apps/wallet/src/background/connections/index.ts b/apps/wallet/src/background/connections/index.ts index d6b5c3c591b..62ee3912a24 100644 --- a/apps/wallet/src/background/connections/index.ts +++ b/apps/wallet/src/background/connections/index.ts @@ -7,12 +7,12 @@ import type { SetNetworkPayload } from '_payloads/network'; import type { Permission } from '_payloads/permissions'; import type { WalletStatusChange, WalletStatusChangePayload } from '_payloads/wallet-status-change'; import type { NetworkEnvType } from '@iota/core'; -import { type UIAccessibleEntityType } from '_src/shared/messaging/messages/payloads/MethodPayload'; +import { type UIAccessibleEntityType } from '_src/shared/messaging/messages/payloads/methodPayload'; import Browser from 'webextension-polyfill'; -import type { Connection } from './Connection'; -import { ContentScriptConnection } from './ContentScriptConnection'; -import { UiConnection } from './UiConnection'; +import type { Connection } from './connection'; +import { ContentScriptConnection } from './contentScriptConnection'; +import { UiConnection } from './uiConnection'; const appOrigin = new URL(Browser.runtime.getURL('')).origin; diff --git a/apps/wallet/src/background/connections/UiConnection.ts b/apps/wallet/src/background/connections/uiConnection.ts similarity index 92% rename from apps/wallet/src/background/connections/UiConnection.ts rename to apps/wallet/src/background/connections/uiConnection.ts index 63cdbf79e19..f5115b1f58f 100644 --- a/apps/wallet/src/background/connections/UiConnection.ts +++ b/apps/wallet/src/background/connections/uiConnection.ts @@ -4,27 +4,27 @@ import { createMessage } from '_messages'; import type { Message } from '_messages'; -import type { PortChannelName } from '_messaging/PortChannelName'; +import type { PortChannelName } from '_src/shared/messaging/portChannelName'; import { isBasePayload, type ErrorPayload } from '_payloads'; import type { LoadedFeaturesPayload } from '_payloads/feature-gating'; import { isSetNetworkPayload, type SetNetworkPayload } from '_payloads/network'; import { isGetPermissionRequests, isPermissionResponse } from '_payloads/permissions'; import type { Permission, PermissionRequests } from '_payloads/permissions'; -import { isDisconnectApp } from '_payloads/permissions/DisconnectApp'; +import { isDisconnectApp } from '_src/shared/messaging/messages/payloads/permissions/disconnectApp'; import type { UpdateActiveOrigin } from '_payloads/tabs/updateActiveOrigin'; -import type { ApprovalRequest } from '_payloads/transactions/ApprovalRequest'; -import { isGetTransactionRequests } from '_payloads/transactions/ui/GetTransactionRequests'; -import type { GetTransactionRequestsResponse } from '_payloads/transactions/ui/GetTransactionRequestsResponse'; -import { isTransactionRequestResponse } from '_payloads/transactions/ui/TransactionRequestResponse'; -import Permissions from '_src/background/Permissions'; -import Tabs from '_src/background/Tabs'; -import Transactions from '_src/background/Transactions'; +import type { ApprovalRequest } from '_src/shared/messaging/messages/payloads/transactions/approvalRequest'; +import { isGetTransactionRequests } from '_src/shared/messaging/messages/payloads/transactions/ui/getTransactionRequests'; +import type { GetTransactionRequestsResponse } from '_src/shared/messaging/messages/payloads/transactions/ui/getTransactionRequestsResponse'; +import { isTransactionRequestResponse } from '_src/shared/messaging/messages/payloads/transactions/ui/transactionRequestResponse'; +import Permissions from '_src/background/permissions'; +import Tabs from '_src/background/tabs'; +import Transactions from '_src/background/transactions'; import { growthbook } from '_src/shared/experimentation/features'; import { isMethodPayload, type MethodPayload, type UIAccessibleEntityType, -} from '_src/shared/messaging/messages/payloads/MethodPayload'; +} from '_src/shared/messaging/messages/payloads/methodPayload'; import { toEntropy } from '_src/shared/utils'; import Dexie from 'dexie'; import { BehaviorSubject, filter, switchMap, takeUntil } from 'rxjs'; @@ -37,7 +37,7 @@ import { getAllSerializedUIAccountSources, } from '../account-sources'; import { accountSourcesEvents } from '../account-sources/events'; -import { MnemonicAccountSource } from '../account-sources/MnemonicAccountSource'; +import { MnemonicAccountSource } from '../account-sources/mnemonicAccountSource'; import { accountsHandleUIMessage, addNewAccounts, @@ -45,16 +45,16 @@ import { getAllSerializedUIAccounts, } from '../accounts'; import { accountsEvents } from '../accounts/events'; -import { getAutoLockMinutes, notifyUserActive, setAutoLockMinutes } from '../auto-lock-accounts'; +import { getAutoLockMinutes, notifyUserActive, setAutoLockMinutes } from '../autoLockAccounts'; import { backupDB, getDB, SETTINGS_KEYS } from '../db'; -import { clearStatus, doMigration, getStatus } from '../storage-migration'; -import NetworkEnv from '../NetworkEnv'; -import { Connection } from './Connection'; -import { SeedAccountSource } from '../account-sources/SeedAccountSource'; -import { AccountSourceType } from '../account-sources/AccountSource'; +import { clearStatus, doMigration, getStatus } from '../storageMigration'; +import NetworkEnv from '../networkEnv'; +import { Connection } from './connection'; +import { SeedAccountSource } from '../account-sources/seedAccountSource'; +import { AccountSourceType } from '../account-sources/accountSource'; import { isDeriveBipPathAccountsFinder, isPersistAccountsFinder } from '_payloads/accounts-finder'; -import type { SerializedAccount } from '../accounts/Account'; -import { LedgerAccount } from '../accounts/LedgerAccount'; +import type { SerializedAccount } from '../accounts/account'; +import { LedgerAccount } from '../accounts/ledgerAccount'; export class UiConnection extends Connection { public static readonly CHANNEL: PortChannelName = 'iota_ui<->background'; diff --git a/apps/wallet/src/background/db.ts b/apps/wallet/src/background/db.ts index 71ecbedcc82..43acb34afed 100644 --- a/apps/wallet/src/background/db.ts +++ b/apps/wallet/src/background/db.ts @@ -5,10 +5,10 @@ import Dexie, { type Table } from 'dexie'; import { exportDB, importDB } from 'dexie-export-import'; -import { type AccountSourceSerialized } from './account-sources/AccountSource'; -import { type SerializedAccount } from './accounts/Account'; +import { type AccountSourceSerialized } from './account-sources/accountSource'; +import { type SerializedAccount } from './accounts/account'; import { captureException } from './sentry'; -import { getFromLocalStorage, setToLocalStorage } from './storage-utils'; +import { getFromLocalStorage, setToLocalStorage } from './storageUtils'; const DB_NAME = 'IotaWallet DB'; const DB_LOCAL_STORAGE_BACKUP_KEY = 'indexed-db-backup'; diff --git a/apps/wallet/src/background/index.ts b/apps/wallet/src/background/index.ts index 338679105f2..4fb42a4ae0a 100644 --- a/apps/wallet/src/background/index.ts +++ b/apps/wallet/src/background/index.ts @@ -11,12 +11,12 @@ import { lockAllAccountSources } from './account-sources'; import { accountSourcesEvents } from './account-sources/events'; import { getAccountsStatusData, getAllAccounts, lockAllAccounts } from './accounts'; import { accountsEvents } from './accounts/events'; -import Alarms, { AUTO_LOCK_ALARM_NAME, CLEAN_UP_ALARM_NAME } from './Alarms'; +import Alarms, { AUTO_LOCK_ALARM_NAME, CLEAN_UP_ALARM_NAME } from './alarms'; import { Connections } from './connections'; -import NetworkEnv from './NetworkEnv'; -import Permissions from './Permissions'; +import NetworkEnv from './networkEnv'; +import Permissions from './permissions'; import { initSentry } from './sentry'; -import Transactions from './Transactions'; +import Transactions from './transactions'; growthbook.loadFeatures().catch(() => { // silence the error diff --git a/apps/wallet/src/background/NetworkEnv.ts b/apps/wallet/src/background/networkEnv.ts similarity index 100% rename from apps/wallet/src/background/NetworkEnv.ts rename to apps/wallet/src/background/networkEnv.ts diff --git a/apps/wallet/src/background/Permissions.ts b/apps/wallet/src/background/permissions.ts similarity index 98% rename from apps/wallet/src/background/Permissions.ts rename to apps/wallet/src/background/permissions.ts index 42c85b8cdf4..6fa604b55a0 100644 --- a/apps/wallet/src/background/Permissions.ts +++ b/apps/wallet/src/background/permissions.ts @@ -10,9 +10,9 @@ import type { Observable } from 'rxjs'; import { v4 as uuidV4 } from 'uuid'; import Browser from 'webextension-polyfill'; -import type { ContentScriptConnection } from './connections/ContentScriptConnection'; -import Tabs from './Tabs'; -import { Window } from './Window'; +import type { ContentScriptConnection } from './connections/contentScriptConnection'; +import Tabs from './tabs'; +import { Window } from './window'; const PERMISSIONS_STORAGE_KEY = 'permissions'; const PERMISSION_UI_URL = `${Browser.runtime.getURL('ui.html')}#/dapp/connect/`; diff --git a/apps/wallet/src/background/sentry.ts b/apps/wallet/src/background/sentry.ts index e95d0f9c70b..b5f70562c84 100644 --- a/apps/wallet/src/background/sentry.ts +++ b/apps/wallet/src/background/sentry.ts @@ -3,7 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 import { growthbook } from '_src/shared/experimentation/features'; -import { getSentryConfig } from '_src/shared/sentry-config'; +import { getSentryConfig } from '_src/shared/sentryConfig'; import * as Sentry from '@sentry/browser'; import { Feature } from '@iota/core'; diff --git a/apps/wallet/src/background/session-ephemeral-values.ts b/apps/wallet/src/background/sessionEphemeralValues.ts similarity index 94% rename from apps/wallet/src/background/session-ephemeral-values.ts rename to apps/wallet/src/background/sessionEphemeralValues.ts index ae820d67b13..b5a9c328f13 100644 --- a/apps/wallet/src/background/session-ephemeral-values.ts +++ b/apps/wallet/src/background/sessionEphemeralValues.ts @@ -7,7 +7,7 @@ import { getEncryptedFromSessionStorage, removeFromSessionStorage, setToSessionStorageEncrypted, -} from '_src/background/storage-utils'; +} from '_src/background/storageUtils'; export function getEphemeralValue<T extends Serializable>(id: string) { return getEncryptedFromSessionStorage<T>(id); diff --git a/apps/wallet/src/background/storage-migration.ts b/apps/wallet/src/background/storageMigration.ts similarity index 93% rename from apps/wallet/src/background/storage-migration.ts rename to apps/wallet/src/background/storageMigration.ts index a78813e380e..5c11b9bda19 100644 --- a/apps/wallet/src/background/storage-migration.ts +++ b/apps/wallet/src/background/storageMigration.ts @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { getFromLocalStorage } from './storage-utils'; +import { getFromLocalStorage } from './storageUtils'; export type Status = 'required' | 'inProgress' | 'ready'; diff --git a/apps/wallet/src/background/storage-utils.ts b/apps/wallet/src/background/storageUtils.ts similarity index 100% rename from apps/wallet/src/background/storage-utils.ts rename to apps/wallet/src/background/storageUtils.ts diff --git a/apps/wallet/src/background/Tabs.ts b/apps/wallet/src/background/tabs.ts similarity index 100% rename from apps/wallet/src/background/Tabs.ts rename to apps/wallet/src/background/tabs.ts diff --git a/apps/wallet/src/background/Transactions.ts b/apps/wallet/src/background/transactions.ts similarity index 92% rename from apps/wallet/src/background/Transactions.ts rename to apps/wallet/src/background/transactions.ts index 6c696bf0b12..262b546c558 100644 --- a/apps/wallet/src/background/Transactions.ts +++ b/apps/wallet/src/background/transactions.ts @@ -5,18 +5,18 @@ import { type ApprovalRequest, type TransactionDataType, -} from '_payloads/transactions/ApprovalRequest'; -import type { IotaSignTransactionSerialized } from '_payloads/transactions/ExecuteTransactionRequest'; -import { type SignMessageRequest } from '_payloads/transactions/SignMessage'; -import type { TransactionRequestResponse } from '_payloads/transactions/ui/TransactionRequestResponse'; -import type { ContentScriptConnection } from '_src/background/connections/ContentScriptConnection'; +} from '_src/shared/messaging/messages/payloads/transactions/approvalRequest'; +import type { IotaSignTransactionSerialized } from '_src/shared/messaging/messages/payloads/transactions/executeTransactionRequest'; +import { type SignMessageRequest } from '_src/shared/messaging/messages/payloads/transactions/signMessage'; +import type { TransactionRequestResponse } from '_src/shared/messaging/messages/payloads/transactions/ui/transactionRequestResponse'; +import type { ContentScriptConnection } from '_src/background/connections/contentScriptConnection'; import { type IotaTransactionBlockResponse } from '@iota/iota-sdk/client'; import { type SignedTransaction, type IotaSignPersonalMessageOutput } from '@iota/wallet-standard'; import { filter, lastValueFrom, map, race, Subject, take } from 'rxjs'; import { v4 as uuidV4 } from 'uuid'; import Browser from 'webextension-polyfill'; -import { Window } from './Window'; +import { Window } from './window'; const STALE_TRANSACTION_MILLISECONDS = 1000 * 60 * 60 * 3; // 3 hours const TX_STORE_KEY = 'transactions'; diff --git a/apps/wallet/src/background/Window.ts b/apps/wallet/src/background/window.ts similarity index 100% rename from apps/wallet/src/background/Window.ts rename to apps/wallet/src/background/window.ts diff --git a/apps/wallet/src/content-script/index.ts b/apps/wallet/src/content-script/index.ts index 9b3662e815d..11ce586b293 100644 --- a/apps/wallet/src/content-script/index.ts +++ b/apps/wallet/src/content-script/index.ts @@ -2,8 +2,8 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { injectDappInterface } from './interface-inject'; -import { setupMessagesProxy } from './messages-proxy'; +import { injectDappInterface } from './interfaceInject'; +import { setupMessagesProxy } from './messagesProxy'; injectDappInterface(); setupMessagesProxy(); diff --git a/apps/wallet/src/content-script/interface-inject.ts b/apps/wallet/src/content-script/interfaceInject.ts similarity index 100% rename from apps/wallet/src/content-script/interface-inject.ts rename to apps/wallet/src/content-script/interfaceInject.ts diff --git a/apps/wallet/src/content-script/messages-proxy.ts b/apps/wallet/src/content-script/messagesProxy.ts similarity index 89% rename from apps/wallet/src/content-script/messages-proxy.ts rename to apps/wallet/src/content-script/messagesProxy.ts index a366e0b5f64..198a4317f20 100644 --- a/apps/wallet/src/content-script/messages-proxy.ts +++ b/apps/wallet/src/content-script/messagesProxy.ts @@ -2,8 +2,8 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { PortStream } from '_messaging/PortStream'; -import { WindowMessageStream } from '_messaging/WindowMessageStream'; +import { PortStream } from '_src/shared/messaging/portStream'; +import { WindowMessageStream } from '_src/shared/messaging/windowMessageStream'; import type { Message } from '_src/shared/messaging/messages'; import { generateWalletMessageStreamIdentifiers } from '_src/shared/utils/generateWalletMessageStreamIdentifiers'; import { take } from 'rxjs'; diff --git a/apps/wallet/src/dapp-interface/index.ts b/apps/wallet/src/dapp-interface/index.ts index 1c27c20b54e..b79ccc1ed16 100644 --- a/apps/wallet/src/dapp-interface/index.ts +++ b/apps/wallet/src/dapp-interface/index.ts @@ -4,6 +4,6 @@ import { registerWallet } from '@iota/wallet-standard'; -import { IotaWallet } from './WalletStandardInterface'; +import { IotaWallet } from './walletStandardInterface'; registerWallet(new IotaWallet()); diff --git a/apps/wallet/src/dapp-interface/WalletStandardInterface.ts b/apps/wallet/src/dapp-interface/walletStandardInterface.ts similarity index 98% rename from apps/wallet/src/dapp-interface/WalletStandardInterface.ts rename to apps/wallet/src/dapp-interface/walletStandardInterface.ts index 5490718fdbc..03aaf9a10d2 100644 --- a/apps/wallet/src/dapp-interface/WalletStandardInterface.ts +++ b/apps/wallet/src/dapp-interface/walletStandardInterface.ts @@ -3,10 +3,10 @@ // SPDX-License-Identifier: Apache-2.0 import { createMessage } from '_messages'; -import { WindowMessageStream } from '_messaging/WindowMessageStream'; +import { WindowMessageStream } from '_src/shared/messaging/windowMessageStream'; import type { BasePayload, Payload } from '_payloads'; -import type { GetAccount } from '_payloads/account/GetAccount'; -import type { GetAccountResponse } from '_payloads/account/GetAccountResponse'; +import type { GetAccount } from '_src/shared/messaging/messages/payloads/account/getAccount'; +import type { GetAccountResponse } from '_src/shared/messaging/messages/payloads/account/getAccountResponse'; import type { SetNetworkPayload } from '_payloads/network'; import { ALL_PERMISSION_TYPES, @@ -22,7 +22,7 @@ import type { SignTransactionResponse, } from '_payloads/transactions'; import { getCustomNetwork, type NetworkEnvType } from '@iota/core'; -import { type SignMessageRequest } from '_src/shared/messaging/messages/payloads/transactions/SignMessage'; +import { type SignMessageRequest } from '_src/shared/messaging/messages/payloads/transactions/signMessage'; import { isWalletStatusChangePayload } from '_src/shared/messaging/messages/payloads/wallet-status-change'; import { getNetwork, Network, type ChainType } from '@iota/iota-sdk/client'; import { fromB64, toB64 } from '@iota/iota-sdk/utils'; diff --git a/apps/wallet/src/shared/iota-client.ts b/apps/wallet/src/shared/iotaClient.ts similarity index 96% rename from apps/wallet/src/shared/iota-client.ts rename to apps/wallet/src/shared/iotaClient.ts index 20af64d663b..8c0d49d7d8f 100644 --- a/apps/wallet/src/shared/iota-client.ts +++ b/apps/wallet/src/shared/iotaClient.ts @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import networkEnv from '_src/background/NetworkEnv'; +import networkEnv from '_src/background/networkEnv'; import { type NetworkEnvType, SentryHttpTransport } from '@iota/core'; import { getNetwork, Network, IotaClient, IotaHTTPTransport } from '@iota/iota-sdk/client'; diff --git a/apps/wallet/src/shared/messaging/messages/index.ts b/apps/wallet/src/shared/messaging/messages/index.ts index bfb0e742de3..82b4b20ae1e 100644 --- a/apps/wallet/src/shared/messaging/messages/index.ts +++ b/apps/wallet/src/shared/messaging/messages/index.ts @@ -2,4 +2,4 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -export * from './Message'; +export * from './message'; diff --git a/apps/wallet/src/shared/messaging/messages/Message.ts b/apps/wallet/src/shared/messaging/messages/message.ts similarity index 88% rename from apps/wallet/src/shared/messaging/messages/Message.ts rename to apps/wallet/src/shared/messaging/messages/message.ts index 369f7e9b9cd..23e65cc6612 100644 --- a/apps/wallet/src/shared/messaging/messages/Message.ts +++ b/apps/wallet/src/shared/messaging/messages/message.ts @@ -4,7 +4,7 @@ import { v4 as uuidV4 } from 'uuid'; -import type { Payload } from './payloads/Payload'; +import type { Payload } from './payloads/payload'; export type Message = { id: string; diff --git a/apps/wallet/src/shared/messaging/messages/payloads/account/GetAccount.ts b/apps/wallet/src/shared/messaging/messages/payloads/account/getAccount.ts similarity index 100% rename from apps/wallet/src/shared/messaging/messages/payloads/account/GetAccount.ts rename to apps/wallet/src/shared/messaging/messages/payloads/account/getAccount.ts diff --git a/apps/wallet/src/shared/messaging/messages/payloads/account/GetAccountResponse.ts b/apps/wallet/src/shared/messaging/messages/payloads/account/getAccountResponse.ts similarity index 100% rename from apps/wallet/src/shared/messaging/messages/payloads/account/GetAccountResponse.ts rename to apps/wallet/src/shared/messaging/messages/payloads/account/getAccountResponse.ts diff --git a/apps/wallet/src/shared/messaging/messages/payloads/accounts-finder/DeriveBipPathAccountsFinder.ts b/apps/wallet/src/shared/messaging/messages/payloads/accounts-finder/deriveBipPathAccountsFinder.ts similarity index 100% rename from apps/wallet/src/shared/messaging/messages/payloads/accounts-finder/DeriveBipPathAccountsFinder.ts rename to apps/wallet/src/shared/messaging/messages/payloads/accounts-finder/deriveBipPathAccountsFinder.ts diff --git a/apps/wallet/src/shared/messaging/messages/payloads/accounts-finder/index.ts b/apps/wallet/src/shared/messaging/messages/payloads/accounts-finder/index.ts index db6a662751c..f3012894048 100644 --- a/apps/wallet/src/shared/messaging/messages/payloads/accounts-finder/index.ts +++ b/apps/wallet/src/shared/messaging/messages/payloads/accounts-finder/index.ts @@ -1,6 +1,6 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -export * from './DeriveBipPathAccountsFinder'; -export * from './PersistAccountsFinder'; +export * from './deriveBipPathAccountsFinder'; +export * from './persistAccountsFinder'; export * from './types'; diff --git a/apps/wallet/src/shared/messaging/messages/payloads/accounts-finder/PersistAccountsFinder.ts b/apps/wallet/src/shared/messaging/messages/payloads/accounts-finder/persistAccountsFinder.ts similarity index 100% rename from apps/wallet/src/shared/messaging/messages/payloads/accounts-finder/PersistAccountsFinder.ts rename to apps/wallet/src/shared/messaging/messages/payloads/accounts-finder/persistAccountsFinder.ts diff --git a/apps/wallet/src/shared/messaging/messages/payloads/BasePayload.ts b/apps/wallet/src/shared/messaging/messages/payloads/basePayload.ts similarity index 96% rename from apps/wallet/src/shared/messaging/messages/payloads/BasePayload.ts rename to apps/wallet/src/shared/messaging/messages/payloads/basePayload.ts index 4de18c06bdc..52ab6d2e254 100644 --- a/apps/wallet/src/shared/messaging/messages/payloads/BasePayload.ts +++ b/apps/wallet/src/shared/messaging/messages/payloads/basePayload.ts @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import type { Payload } from './Payload'; +import type { Payload } from './payload'; export type PayloadType = | 'permission-request' diff --git a/apps/wallet/src/shared/messaging/messages/payloads/ErrorPayload.ts b/apps/wallet/src/shared/messaging/messages/payloads/errorPayload.ts similarity index 89% rename from apps/wallet/src/shared/messaging/messages/payloads/ErrorPayload.ts rename to apps/wallet/src/shared/messaging/messages/payloads/errorPayload.ts index bfd70d93483..95187f90d56 100644 --- a/apps/wallet/src/shared/messaging/messages/payloads/ErrorPayload.ts +++ b/apps/wallet/src/shared/messaging/messages/payloads/errorPayload.ts @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import type { Payload } from './Payload'; +import type { Payload } from './payload'; export interface ErrorPayload { error: true; diff --git a/apps/wallet/src/shared/messaging/messages/payloads/index.ts b/apps/wallet/src/shared/messaging/messages/payloads/index.ts index 5a8e3e4bb03..d9095538c30 100644 --- a/apps/wallet/src/shared/messaging/messages/payloads/index.ts +++ b/apps/wallet/src/shared/messaging/messages/payloads/index.ts @@ -2,6 +2,6 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -export * from './BasePayload'; -export * from './ErrorPayload'; -export * from './Payload'; +export * from './basePayload'; +export * from './errorPayload'; +export * from './payload'; diff --git a/apps/wallet/src/shared/messaging/messages/payloads/MethodPayload.ts b/apps/wallet/src/shared/messaging/messages/payloads/methodPayload.ts similarity index 93% rename from apps/wallet/src/shared/messaging/messages/payloads/MethodPayload.ts rename to apps/wallet/src/shared/messaging/messages/payloads/methodPayload.ts index 8672bc8653d..d4de79ecdc7 100644 --- a/apps/wallet/src/shared/messaging/messages/payloads/MethodPayload.ts +++ b/apps/wallet/src/shared/messaging/messages/payloads/methodPayload.ts @@ -5,12 +5,12 @@ import type { AccountSourceType, AccountSourceSerializedUI, -} from '_src/background/account-sources/AccountSource'; -import type { AccountType, SerializedUIAccount } from '_src/background/accounts/Account'; -import { type Status } from '_src/background/storage-migration'; +} from '_src/background/account-sources/accountSource'; +import type { AccountType, SerializedUIAccount } from '_src/background/accounts/account'; +import { type Status } from '_src/background/storageMigration'; -import { isBasePayload } from './BasePayload'; -import type { Payload } from './Payload'; +import { isBasePayload } from './basePayload'; +import type { Payload } from './payload'; export type UIAccessibleEntityType = 'accountSources' | 'accounts'; export type LedgerAccountsPublicKeys = { diff --git a/apps/wallet/src/shared/messaging/messages/payloads/Payload.ts b/apps/wallet/src/shared/messaging/messages/payloads/payload.ts similarity index 63% rename from apps/wallet/src/shared/messaging/messages/payloads/Payload.ts rename to apps/wallet/src/shared/messaging/messages/payloads/payload.ts index c498bf73bbe..0a852ad8257 100644 --- a/apps/wallet/src/shared/messaging/messages/payloads/Payload.ts +++ b/apps/wallet/src/shared/messaging/messages/payloads/payload.ts @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import type { BasePayload } from './BasePayload'; -import type { ErrorPayload } from './ErrorPayload'; +import type { BasePayload } from './basePayload'; +import type { ErrorPayload } from './errorPayload'; export type Payload = BasePayload | ErrorPayload; diff --git a/apps/wallet/src/shared/messaging/messages/payloads/permissions/AcquirePermissionsRequest.ts b/apps/wallet/src/shared/messaging/messages/payloads/permissions/acquirePermissionsRequest.ts similarity index 91% rename from apps/wallet/src/shared/messaging/messages/payloads/permissions/AcquirePermissionsRequest.ts rename to apps/wallet/src/shared/messaging/messages/payloads/permissions/acquirePermissionsRequest.ts index e78a952a67f..e34ec0f864b 100644 --- a/apps/wallet/src/shared/messaging/messages/payloads/permissions/AcquirePermissionsRequest.ts +++ b/apps/wallet/src/shared/messaging/messages/payloads/permissions/acquirePermissionsRequest.ts @@ -5,7 +5,7 @@ import { isBasePayload } from '_payloads'; import type { BasePayload, Payload } from '_payloads'; -import type { PermissionType } from './PermissionType'; +import type { PermissionType } from './permissionType'; export interface AcquirePermissionsRequest extends BasePayload { type: 'acquire-permissions-request'; diff --git a/apps/wallet/src/shared/messaging/messages/payloads/permissions/AcquirePermissionsResponse.ts b/apps/wallet/src/shared/messaging/messages/payloads/permissions/acquirePermissionsResponse.ts similarity index 100% rename from apps/wallet/src/shared/messaging/messages/payloads/permissions/AcquirePermissionsResponse.ts rename to apps/wallet/src/shared/messaging/messages/payloads/permissions/acquirePermissionsResponse.ts diff --git a/apps/wallet/src/shared/messaging/messages/payloads/permissions/DisconnectApp.ts b/apps/wallet/src/shared/messaging/messages/payloads/permissions/disconnectApp.ts similarity index 100% rename from apps/wallet/src/shared/messaging/messages/payloads/permissions/DisconnectApp.ts rename to apps/wallet/src/shared/messaging/messages/payloads/permissions/disconnectApp.ts diff --git a/apps/wallet/src/shared/messaging/messages/payloads/permissions/GetPermissionRequests.ts b/apps/wallet/src/shared/messaging/messages/payloads/permissions/getPermissionRequests.ts similarity index 100% rename from apps/wallet/src/shared/messaging/messages/payloads/permissions/GetPermissionRequests.ts rename to apps/wallet/src/shared/messaging/messages/payloads/permissions/getPermissionRequests.ts diff --git a/apps/wallet/src/shared/messaging/messages/payloads/permissions/HasPermissionsRequest.ts b/apps/wallet/src/shared/messaging/messages/payloads/permissions/hasPermissionsRequest.ts similarity index 90% rename from apps/wallet/src/shared/messaging/messages/payloads/permissions/HasPermissionsRequest.ts rename to apps/wallet/src/shared/messaging/messages/payloads/permissions/hasPermissionsRequest.ts index 507970c5843..103b6812258 100644 --- a/apps/wallet/src/shared/messaging/messages/payloads/permissions/HasPermissionsRequest.ts +++ b/apps/wallet/src/shared/messaging/messages/payloads/permissions/hasPermissionsRequest.ts @@ -5,7 +5,7 @@ import { isBasePayload } from '_payloads'; import type { BasePayload, Payload } from '_payloads'; -import type { PermissionType } from './PermissionType'; +import type { PermissionType } from './permissionType'; export interface HasPermissionsRequest extends BasePayload { type: 'has-permissions-request'; diff --git a/apps/wallet/src/shared/messaging/messages/payloads/permissions/HasPermissionsResponse.ts b/apps/wallet/src/shared/messaging/messages/payloads/permissions/hasPermissionsResponse.ts similarity index 100% rename from apps/wallet/src/shared/messaging/messages/payloads/permissions/HasPermissionsResponse.ts rename to apps/wallet/src/shared/messaging/messages/payloads/permissions/hasPermissionsResponse.ts diff --git a/apps/wallet/src/shared/messaging/messages/payloads/permissions/index.ts b/apps/wallet/src/shared/messaging/messages/payloads/permissions/index.ts index 1e232093c81..68bca0392c9 100644 --- a/apps/wallet/src/shared/messaging/messages/payloads/permissions/index.ts +++ b/apps/wallet/src/shared/messaging/messages/payloads/permissions/index.ts @@ -2,12 +2,12 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -export * from './GetPermissionRequests'; -export * from './PermissionRequests'; -export * from './PermissionResponse'; -export * from './PermissionType'; -export * from './Permission'; -export * from './HasPermissionsRequest'; -export * from './HasPermissionsResponse'; -export * from './AcquirePermissionsRequest'; -export * from './AcquirePermissionsResponse'; +export * from './getPermissionRequests'; +export * from './permissionRequests'; +export * from './permissionResponse'; +export * from './permissionType'; +export * from './permission'; +export * from './hasPermissionsRequest'; +export * from './hasPermissionsResponse'; +export * from './acquirePermissionsRequest'; +export * from './acquirePermissionsResponse'; diff --git a/apps/wallet/src/shared/messaging/messages/payloads/permissions/Permission.ts b/apps/wallet/src/shared/messaging/messages/payloads/permissions/permission.ts similarity index 91% rename from apps/wallet/src/shared/messaging/messages/payloads/permissions/Permission.ts rename to apps/wallet/src/shared/messaging/messages/payloads/permissions/permission.ts index 61a79756ebd..c9e7fe93dd0 100644 --- a/apps/wallet/src/shared/messaging/messages/payloads/permissions/Permission.ts +++ b/apps/wallet/src/shared/messaging/messages/payloads/permissions/permission.ts @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import type { PermissionType } from './PermissionType'; +import type { PermissionType } from './permissionType'; //TODO: add description, name, tags //TODO add PageLink for instance where the origin and the wallet landing page are different. diff --git a/apps/wallet/src/shared/messaging/messages/payloads/permissions/PermissionRequests.ts b/apps/wallet/src/shared/messaging/messages/payloads/permissions/permissionRequests.ts similarity index 91% rename from apps/wallet/src/shared/messaging/messages/payloads/permissions/PermissionRequests.ts rename to apps/wallet/src/shared/messaging/messages/payloads/permissions/permissionRequests.ts index 0bae8c97003..52b98ea1177 100644 --- a/apps/wallet/src/shared/messaging/messages/payloads/permissions/PermissionRequests.ts +++ b/apps/wallet/src/shared/messaging/messages/payloads/permissions/permissionRequests.ts @@ -4,7 +4,7 @@ import { isBasePayload } from '_payloads'; import type { BasePayload, Payload } from '_payloads'; -import type { Permission } from './Permission'; +import type { Permission } from './permission'; export interface PermissionRequests extends BasePayload { type: 'permission-request'; diff --git a/apps/wallet/src/shared/messaging/messages/payloads/permissions/PermissionResponse.ts b/apps/wallet/src/shared/messaging/messages/payloads/permissions/permissionResponse.ts similarity index 100% rename from apps/wallet/src/shared/messaging/messages/payloads/permissions/PermissionResponse.ts rename to apps/wallet/src/shared/messaging/messages/payloads/permissions/permissionResponse.ts diff --git a/apps/wallet/src/shared/messaging/messages/payloads/permissions/PermissionType.ts b/apps/wallet/src/shared/messaging/messages/payloads/permissions/permissionType.ts similarity index 100% rename from apps/wallet/src/shared/messaging/messages/payloads/permissions/PermissionType.ts rename to apps/wallet/src/shared/messaging/messages/payloads/permissions/permissionType.ts diff --git a/apps/wallet/src/shared/messaging/messages/payloads/transactions/ApprovalRequest.ts b/apps/wallet/src/shared/messaging/messages/payloads/transactions/approvalRequest.ts similarity index 96% rename from apps/wallet/src/shared/messaging/messages/payloads/transactions/ApprovalRequest.ts rename to apps/wallet/src/shared/messaging/messages/payloads/transactions/approvalRequest.ts index 80685dd2aa6..1b71203744f 100644 --- a/apps/wallet/src/shared/messaging/messages/payloads/transactions/ApprovalRequest.ts +++ b/apps/wallet/src/shared/messaging/messages/payloads/transactions/approvalRequest.ts @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { type SignedTransaction } from '_src/ui/app/WalletSigner'; +import { type SignedTransaction } from '_src/ui/app/walletSigner'; import type { IotaTransactionBlockResponse } from '@iota/iota-sdk/client'; import { type IotaSignAndExecuteTransactionInput, diff --git a/apps/wallet/src/shared/messaging/messages/payloads/transactions/ExecuteTransactionRequest.ts b/apps/wallet/src/shared/messaging/messages/payloads/transactions/executeTransactionRequest.ts similarity index 94% rename from apps/wallet/src/shared/messaging/messages/payloads/transactions/ExecuteTransactionRequest.ts rename to apps/wallet/src/shared/messaging/messages/payloads/transactions/executeTransactionRequest.ts index b7d636006e2..c363f0bd9c9 100644 --- a/apps/wallet/src/shared/messaging/messages/payloads/transactions/ExecuteTransactionRequest.ts +++ b/apps/wallet/src/shared/messaging/messages/payloads/transactions/executeTransactionRequest.ts @@ -6,7 +6,7 @@ import { isBasePayload } from '_payloads'; import type { BasePayload, Payload } from '_payloads'; import { type IotaSignTransactionInput } from '@iota/wallet-standard'; -import { type TransactionDataType } from './ApprovalRequest'; +import { type TransactionDataType } from './approvalRequest'; export interface ExecuteTransactionRequest extends BasePayload { type: 'execute-transaction-request'; diff --git a/apps/wallet/src/shared/messaging/messages/payloads/transactions/ExecuteTransactionResponse.ts b/apps/wallet/src/shared/messaging/messages/payloads/transactions/executeTransactionResponse.ts similarity index 100% rename from apps/wallet/src/shared/messaging/messages/payloads/transactions/ExecuteTransactionResponse.ts rename to apps/wallet/src/shared/messaging/messages/payloads/transactions/executeTransactionResponse.ts diff --git a/apps/wallet/src/shared/messaging/messages/payloads/transactions/index.ts b/apps/wallet/src/shared/messaging/messages/payloads/transactions/index.ts index ee98d0e2753..a8f2f2f4e55 100644 --- a/apps/wallet/src/shared/messaging/messages/payloads/transactions/index.ts +++ b/apps/wallet/src/shared/messaging/messages/payloads/transactions/index.ts @@ -2,5 +2,5 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -export * from './ExecuteTransactionRequest'; -export * from './ExecuteTransactionResponse'; +export * from './executeTransactionRequest'; +export * from './executeTransactionResponse'; diff --git a/apps/wallet/src/shared/messaging/messages/payloads/transactions/SignMessage.ts b/apps/wallet/src/shared/messaging/messages/payloads/transactions/signMessage.ts similarity index 85% rename from apps/wallet/src/shared/messaging/messages/payloads/transactions/SignMessage.ts rename to apps/wallet/src/shared/messaging/messages/payloads/transactions/signMessage.ts index 4dd520639b1..1ba70eb17a2 100644 --- a/apps/wallet/src/shared/messaging/messages/payloads/transactions/SignMessage.ts +++ b/apps/wallet/src/shared/messaging/messages/payloads/transactions/signMessage.ts @@ -4,8 +4,8 @@ import { type IotaSignPersonalMessageOutput } from '@iota/wallet-standard'; -import { isBasePayload, type BasePayload } from '../BasePayload'; -import { type Payload } from '../Payload'; +import { isBasePayload, type BasePayload } from '../basePayload'; +import { type Payload } from '../payload'; export interface SignMessageRequest extends BasePayload { type: 'sign-personal-message-request'; diff --git a/apps/wallet/src/shared/messaging/messages/payloads/transactions/ui/GetTransactionRequests.ts b/apps/wallet/src/shared/messaging/messages/payloads/transactions/ui/getTransactionRequests.ts similarity index 100% rename from apps/wallet/src/shared/messaging/messages/payloads/transactions/ui/GetTransactionRequests.ts rename to apps/wallet/src/shared/messaging/messages/payloads/transactions/ui/getTransactionRequests.ts diff --git a/apps/wallet/src/shared/messaging/messages/payloads/transactions/ui/GetTransactionRequestsResponse.ts b/apps/wallet/src/shared/messaging/messages/payloads/transactions/ui/getTransactionRequestsResponse.ts similarity index 84% rename from apps/wallet/src/shared/messaging/messages/payloads/transactions/ui/GetTransactionRequestsResponse.ts rename to apps/wallet/src/shared/messaging/messages/payloads/transactions/ui/getTransactionRequestsResponse.ts index df6f7df89ab..5bcb3534579 100644 --- a/apps/wallet/src/shared/messaging/messages/payloads/transactions/ui/GetTransactionRequestsResponse.ts +++ b/apps/wallet/src/shared/messaging/messages/payloads/transactions/ui/getTransactionRequestsResponse.ts @@ -4,7 +4,7 @@ import { isBasePayload } from '_payloads'; import type { BasePayload, Payload } from '_payloads'; -import type { ApprovalRequest } from '_payloads/transactions/ApprovalRequest'; +import type { ApprovalRequest } from '_src/shared/messaging/messages/payloads/transactions/approvalRequest'; export interface GetTransactionRequestsResponse extends BasePayload { type: 'get-transaction-requests-response'; diff --git a/apps/wallet/src/shared/messaging/messages/payloads/transactions/ui/TransactionRequestResponse.ts b/apps/wallet/src/shared/messaging/messages/payloads/transactions/ui/transactionRequestResponse.ts similarity index 93% rename from apps/wallet/src/shared/messaging/messages/payloads/transactions/ui/TransactionRequestResponse.ts rename to apps/wallet/src/shared/messaging/messages/payloads/transactions/ui/transactionRequestResponse.ts index ccfc53a55c3..427e5e18a02 100644 --- a/apps/wallet/src/shared/messaging/messages/payloads/transactions/ui/TransactionRequestResponse.ts +++ b/apps/wallet/src/shared/messaging/messages/payloads/transactions/ui/transactionRequestResponse.ts @@ -4,7 +4,7 @@ import { isBasePayload } from '_payloads'; import type { BasePayload, Payload } from '_payloads'; -import { type SignedTransaction } from '_src/ui/app/WalletSigner'; +import { type SignedTransaction } from '_src/ui/app/walletSigner'; import type { IotaTransactionBlockResponse } from '@iota/iota-sdk/client'; import { type IotaSignPersonalMessageOutput } from '@iota/wallet-standard'; diff --git a/apps/wallet/src/shared/messaging/PortChannelName.ts b/apps/wallet/src/shared/messaging/portChannelName.ts similarity index 100% rename from apps/wallet/src/shared/messaging/PortChannelName.ts rename to apps/wallet/src/shared/messaging/portChannelName.ts diff --git a/apps/wallet/src/shared/messaging/PortStream.ts b/apps/wallet/src/shared/messaging/portStream.ts similarity index 97% rename from apps/wallet/src/shared/messaging/PortStream.ts rename to apps/wallet/src/shared/messaging/portStream.ts index 728635900a5..d5262182870 100644 --- a/apps/wallet/src/shared/messaging/PortStream.ts +++ b/apps/wallet/src/shared/messaging/portStream.ts @@ -9,7 +9,7 @@ import type { Runtime } from 'webextension-polyfill'; import type { Message } from './messages'; import { isErrorPayload } from './messages/payloads'; -import type { PortChannelName } from './PortChannelName'; +import type { PortChannelName } from './portChannelName'; export class PortStream { private _messagesStream: Observable<Message>; diff --git a/apps/wallet/src/shared/messaging/WindowMessageStream.ts b/apps/wallet/src/shared/messaging/windowMessageStream.ts similarity index 100% rename from apps/wallet/src/shared/messaging/WindowMessageStream.ts rename to apps/wallet/src/shared/messaging/windowMessageStream.ts diff --git a/apps/wallet/src/shared/sentry-config.ts b/apps/wallet/src/shared/sentryConfig.ts similarity index 100% rename from apps/wallet/src/shared/sentry-config.ts rename to apps/wallet/src/shared/sentryConfig.ts diff --git a/apps/wallet/src/types/node-env.d.ts b/apps/wallet/src/types/nodeEnv.d.ts similarity index 100% rename from apps/wallet/src/types/node-env.d.ts rename to apps/wallet/src/types/nodeEnv.d.ts diff --git a/apps/wallet/src/types/scss-modules.d.ts b/apps/wallet/src/types/scssModules.d.ts similarity index 100% rename from apps/wallet/src/types/scss-modules.d.ts rename to apps/wallet/src/types/scssModules.d.ts diff --git a/apps/wallet/src/types/webextension-polyfill.d.ts b/apps/wallet/src/types/webExtensionPolyfill.d.ts similarity index 100% rename from apps/wallet/src/types/webextension-polyfill.d.ts rename to apps/wallet/src/types/webExtensionPolyfill.d.ts diff --git a/apps/wallet/src/ui/app/accounts-finder/accounts-finder.test.ts b/apps/wallet/src/ui/app/accounts-finder/accounts-finder.test.ts index f9cba5ad5f9..b7ffa940f6e 100644 --- a/apps/wallet/src/ui/app/accounts-finder/accounts-finder.test.ts +++ b/apps/wallet/src/ui/app/accounts-finder/accounts-finder.test.ts @@ -1,7 +1,7 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { recoverAccounts, mergeAccounts } from './accounts-finder'; +import { recoverAccounts, mergeAccounts } from './utils'; import { assert, test } from 'vitest'; import { FindBalance } from './types'; diff --git a/apps/wallet/src/ui/app/accounts-finder/AccountsFinder.ts b/apps/wallet/src/ui/app/accounts-finder/accountsFinder.ts similarity index 99% rename from apps/wallet/src/ui/app/accounts-finder/AccountsFinder.ts rename to apps/wallet/src/ui/app/accounts-finder/accountsFinder.ts index fadd3ca1b97..1205d75ae63 100644 --- a/apps/wallet/src/ui/app/accounts-finder/AccountsFinder.ts +++ b/apps/wallet/src/ui/app/accounts-finder/accountsFinder.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { AccountFromFinder, AddressFromFinder } from '_src/shared/accounts'; -import { diffAddressesBipPaths, mergeAccounts, recoverAccounts } from './accounts-finder'; +import { diffAddressesBipPaths, mergeAccounts, recoverAccounts } from './utils'; import type { IotaClient } from '@iota/iota-sdk/client'; import { getEmptyBalance } from './helpers'; import type { FindBalance } from './types'; diff --git a/apps/wallet/src/ui/app/accounts-finder/index.ts b/apps/wallet/src/ui/app/accounts-finder/index.ts index d29d857a2b7..503eb19b16e 100644 --- a/apps/wallet/src/ui/app/accounts-finder/index.ts +++ b/apps/wallet/src/ui/app/accounts-finder/index.ts @@ -1,4 +1,4 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -export * from './accounts-finder'; -export * from './AccountsFinder'; +export * from './utils'; +export * from './accountsFinder'; diff --git a/apps/wallet/src/ui/app/accounts-finder/accounts-finder.ts b/apps/wallet/src/ui/app/accounts-finder/utils.ts similarity index 100% rename from apps/wallet/src/ui/app/accounts-finder/accounts-finder.ts rename to apps/wallet/src/ui/app/accounts-finder/utils.ts diff --git a/apps/wallet/src/ui/app/ApiProvider.ts b/apps/wallet/src/ui/app/apiProvider.ts similarity index 94% rename from apps/wallet/src/ui/app/ApiProvider.ts rename to apps/wallet/src/ui/app/apiProvider.ts index 188dafd82f8..853de3a5d7b 100644 --- a/apps/wallet/src/ui/app/ApiProvider.ts +++ b/apps/wallet/src/ui/app/apiProvider.ts @@ -2,14 +2,14 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { AccountType, type SerializedUIAccount } from '_src/background/accounts/Account'; -import { getIotaClient } from '_src/shared/iota-client'; +import { AccountType, type SerializedUIAccount } from '_src/background/accounts/account'; +import { getIotaClient } from '_src/shared/iotaClient'; import { getDefaultNetwork, Network, type IotaClient } from '@iota/iota-sdk/client'; import type { BackgroundClient } from './background-client'; -import { BackgroundServiceSigner } from './background-client/BackgroundServiceSigner'; +import { BackgroundServiceSigner } from './background-client/backgroundServiceSigner'; import { queryClient } from './helpers/queryClient'; -import { type WalletSigner } from './WalletSigner'; +import { type WalletSigner } from './walletSigner'; const ACCOUNT_TYPES_WITH_BACKGROUND_SIGNER: AccountType[] = [ AccountType.MnemonicDerived, diff --git a/apps/wallet/src/ui/app/background-client/BackgroundServiceSigner.ts b/apps/wallet/src/ui/app/background-client/backgroundServiceSigner.ts similarity index 94% rename from apps/wallet/src/ui/app/background-client/BackgroundServiceSigner.ts rename to apps/wallet/src/ui/app/background-client/backgroundServiceSigner.ts index e7991e7bfc1..a61cfaa60de 100644 --- a/apps/wallet/src/ui/app/background-client/BackgroundServiceSigner.ts +++ b/apps/wallet/src/ui/app/background-client/backgroundServiceSigner.ts @@ -2,11 +2,11 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { type SerializedUIAccount } from '_src/background/accounts/Account'; +import { type SerializedUIAccount } from '_src/background/accounts/account'; import { type IotaClient } from '@iota/iota-sdk/client'; import type { BackgroundClient } from '.'; -import { WalletSigner } from '../WalletSigner'; +import { WalletSigner } from '../walletSigner'; export class BackgroundServiceSigner extends WalletSigner { readonly #account: SerializedUIAccount; diff --git a/apps/wallet/src/ui/app/background-client/index.ts b/apps/wallet/src/ui/app/background-client/index.ts index a6da569d7fc..f6238fb7e61 100644 --- a/apps/wallet/src/ui/app/background-client/index.ts +++ b/apps/wallet/src/ui/app/background-client/index.ts @@ -4,40 +4,40 @@ import { createMessage } from '_messages'; import type { Message } from '_messages'; -import { PortStream } from '_messaging/PortStream'; +import { PortStream } from '_src/shared/messaging/portStream'; import { type BasePayload } from '_payloads'; import { isLoadedFeaturesPayload } from '_payloads/feature-gating'; import { isSetNetworkPayload, type SetNetworkPayload } from '_payloads/network'; import { isPermissionRequests } from '_payloads/permissions'; import type { GetPermissionRequests, PermissionResponse } from '_payloads/permissions'; -import type { DisconnectApp } from '_payloads/permissions/DisconnectApp'; +import type { DisconnectApp } from '_src/shared/messaging/messages/payloads/permissions/disconnectApp'; import { isUpdateActiveOrigin } from '_payloads/tabs/updateActiveOrigin'; -import type { GetTransactionRequests } from '_payloads/transactions/ui/GetTransactionRequests'; -import { isGetTransactionRequestsResponse } from '_payloads/transactions/ui/GetTransactionRequestsResponse'; -import type { TransactionRequestResponse } from '_payloads/transactions/ui/TransactionRequestResponse'; +import type { GetTransactionRequests } from '_src/shared/messaging/messages/payloads/transactions/ui/getTransactionRequests'; +import { isGetTransactionRequestsResponse } from '_src/shared/messaging/messages/payloads/transactions/ui/getTransactionRequestsResponse'; +import type { TransactionRequestResponse } from '_src/shared/messaging/messages/payloads/transactions/ui/transactionRequestResponse'; import { changeActiveNetwork, setActiveOrigin } from '_redux/slices/app'; import { setPermissions } from '_redux/slices/permissions'; import { setTransactionRequests } from '_redux/slices/transaction-requests'; -import { type MnemonicSerializedUiAccount } from '_src/background/accounts/MnemonicAccount'; -import { type SeedSerializedUiAccount } from '_src/background/accounts/SeedAccount'; +import { type MnemonicSerializedUiAccount } from '_src/background/accounts/mnemonicAccount'; +import { type SeedSerializedUiAccount } from '_src/background/accounts/seedAccount'; import type { NetworkEnvType } from '@iota/core'; import { isMethodPayload, type MethodPayload, type UIAccessibleEntityType, -} from '_src/shared/messaging/messages/payloads/MethodPayload'; -import { type SignedMessage, type SignedTransaction } from '_src/ui/app/WalletSigner'; +} from '_src/shared/messaging/messages/payloads/methodPayload'; +import { type SignedMessage, type SignedTransaction } from '_src/ui/app/walletSigner'; import type { AppDispatch } from '_store'; import { type IotaTransactionBlockResponse } from '@iota/iota-sdk/client'; import { toB64 } from '@iota/iota-sdk/utils'; import { type QueryKey } from '@tanstack/react-query'; import { lastValueFrom, map, take } from 'rxjs'; -import { growthbook } from '../experimentation/feature-gating'; -import { ACCOUNTS_QUERY_KEY } from '../helpers/query-client-keys'; +import { growthbook } from '../experimentation/featureGating'; +import { ACCOUNTS_QUERY_KEY } from '../helpers/queryClientKeys'; import { queryClient } from '../helpers/queryClient'; import { ACCOUNT_SOURCES_QUERY_KEY } from '../hooks/useAccountSources'; -import { AccountSourceType } from '_src/background/account-sources/AccountSource'; +import { AccountSourceType } from '_src/background/account-sources/accountSource'; import { type DeriveBipPathAccountsFinder, isDeriveBipPathAccountsFinderResponse, diff --git a/apps/wallet/src/ui/app/components/MovedAssetNotification.tsx b/apps/wallet/src/ui/app/components/MovedAssetNotification.tsx new file mode 100644 index 00000000000..f6521663de8 --- /dev/null +++ b/apps/wallet/src/ui/app/components/MovedAssetNotification.tsx @@ -0,0 +1,33 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +import { type Toast, toast } from 'react-hot-toast'; +import { ButtonUnstyled } from '@iota/apps-ui-kit'; + +interface MovedAssetNotificationProps { + t: Toast; + destination: string; + onUndo: () => void; +} + +export function MovedAssetNotification({ t, destination, onUndo }: MovedAssetNotificationProps) { + return ( + <div + className="flex w-full flex-row items-baseline gap-x-xxs" + onClick={() => toast.dismiss(t.id)} + > + <ButtonUnstyled className="text-body-sm text-neutral-12 dark:text-neutral-92"> + Moved to {destination} + </ButtonUnstyled> + <ButtonUnstyled + onClick={() => { + onUndo(); + toast.dismiss(t.id); + }} + className="ml-auto mr-sm text-body-sm text-neutral-12 dark:text-neutral-92" + > + UNDO + </ButtonUnstyled> + </div> + ); +} diff --git a/apps/wallet/src/ui/app/components/accounts/AccountBalanceItem.tsx b/apps/wallet/src/ui/app/components/accounts/AccountBalanceItem.tsx index a068e239e8e..2a9ea8bc8ac 100644 --- a/apps/wallet/src/ui/app/components/accounts/AccountBalanceItem.tsx +++ b/apps/wallet/src/ui/app/components/accounts/AccountBalanceItem.tsx @@ -3,7 +3,7 @@ import { formatAddress } from '@iota/iota-sdk/utils'; import { useCopyToClipboard } from '../../hooks/useCopyToClipboard'; -import { type SerializedUIAccount } from '_src/background/accounts/Account'; +import { type SerializedUIAccount } from '_src/background/accounts/account'; import { useBalance, useFormatCoin } from '@iota/core'; import { Copy } from '@iota/ui-icons'; import { Panel, ButtonUnstyled } from '@iota/apps-ui-kit'; diff --git a/apps/wallet/src/ui/app/components/accounts/AccountIcon.tsx b/apps/wallet/src/ui/app/components/accounts/AccountIcon.tsx index 5ae5de338f1..aef918f8583 100644 --- a/apps/wallet/src/ui/app/components/accounts/AccountIcon.tsx +++ b/apps/wallet/src/ui/app/components/accounts/AccountIcon.tsx @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { AccountType, type SerializedUIAccount } from '_src/background/accounts/Account'; +import { AccountType, type SerializedUIAccount } from '_src/background/accounts/account'; import { Ledger, IotaLogoMark } from '@iota/ui-icons'; interface AccountIconProps { diff --git a/apps/wallet/src/ui/app/components/accounts/AccountItemApproveConnection.tsx b/apps/wallet/src/ui/app/components/accounts/AccountItemApproveConnection.tsx index 15a9e219084..754f7b1c5e4 100644 --- a/apps/wallet/src/ui/app/components/accounts/AccountItemApproveConnection.tsx +++ b/apps/wallet/src/ui/app/components/accounts/AccountItemApproveConnection.tsx @@ -3,7 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 import { AccountIcon, useUnlockAccount } from '_components'; -import { type SerializedUIAccount } from '_src/background/accounts/Account'; +import { type SerializedUIAccount } from '_src/background/accounts/account'; import { formatAddress } from '@iota/iota-sdk/utils'; import { Account } from '@iota/apps-ui-kit'; import { formatAccountName } from '../../helpers'; diff --git a/apps/wallet/src/ui/app/components/accounts/AccountListItem.tsx b/apps/wallet/src/ui/app/components/accounts/AccountListItem.tsx index 12047afaaab..c336228f749 100644 --- a/apps/wallet/src/ui/app/components/accounts/AccountListItem.tsx +++ b/apps/wallet/src/ui/app/components/accounts/AccountListItem.tsx @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { type SerializedUIAccount } from '_src/background/accounts/Account'; +import { type SerializedUIAccount } from '_src/background/accounts/account'; import { AccountItem } from './AccountItem'; import { IotaLogoMark } from '@iota/ui-icons'; diff --git a/apps/wallet/src/ui/app/components/accounts/AccountMultiSelect.tsx b/apps/wallet/src/ui/app/components/accounts/AccountMultiSelect.tsx index 972be18e5a9..ddaf5344cb8 100644 --- a/apps/wallet/src/ui/app/components/accounts/AccountMultiSelect.tsx +++ b/apps/wallet/src/ui/app/components/accounts/AccountMultiSelect.tsx @@ -3,7 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 import { AccountItemApproveConnection, SelectAllButton } from '_components'; -import { type SerializedUIAccount } from '_src/background/accounts/Account'; +import { type SerializedUIAccount } from '_src/background/accounts/account'; import * as ToggleGroup from '@radix-ui/react-toggle-group'; import { useState } from 'react'; diff --git a/apps/wallet/src/ui/app/components/accounts/PasswordInputDialog.tsx b/apps/wallet/src/ui/app/components/accounts/PasswordInputDialog.tsx index 642449d78c7..e23623c7830 100644 --- a/apps/wallet/src/ui/app/components/accounts/PasswordInputDialog.tsx +++ b/apps/wallet/src/ui/app/components/accounts/PasswordInputDialog.tsx @@ -10,7 +10,7 @@ import { z } from 'zod'; import { useAccountSources } from '../../hooks/useAccountSources'; import { useBackgroundClient } from '../../hooks/useBackgroundClient'; import { Form } from '../../shared/forms/Form'; -import { AccountSourceType } from '_src/background/account-sources/AccountSource'; +import { AccountSourceType } from '_src/background/account-sources/accountSource'; import { Button, ButtonHtmlType, diff --git a/apps/wallet/src/ui/app/components/accounts/RecoverAccountsGroup.tsx b/apps/wallet/src/ui/app/components/accounts/RecoverAccountsGroup.tsx index 6550e25fffa..199c6e6a392 100644 --- a/apps/wallet/src/ui/app/components/accounts/RecoverAccountsGroup.tsx +++ b/apps/wallet/src/ui/app/components/accounts/RecoverAccountsGroup.tsx @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { type SerializedUIAccount } from '_src/background/accounts/Account'; +import { type SerializedUIAccount } from '_src/background/accounts/account'; import { AccountListItem } from './AccountListItem'; import { Button, ButtonSize, ButtonType, Tooltip, TooltipPosition } from '@iota/apps-ui-kit'; import { CheckmarkFilled, Key } from '@iota/ui-icons'; diff --git a/apps/wallet/src/ui/app/components/accounts/UnlockAccountButton.tsx b/apps/wallet/src/ui/app/components/accounts/UnlockAccountButton.tsx index 025ff894c73..a6a8e4bed00 100644 --- a/apps/wallet/src/ui/app/components/accounts/UnlockAccountButton.tsx +++ b/apps/wallet/src/ui/app/components/accounts/UnlockAccountButton.tsx @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { type SerializedUIAccount } from '_src/background/accounts/Account'; +import { type SerializedUIAccount } from '_src/background/accounts/account'; import { useUnlockAccount } from './UnlockAccountContext'; import { Button, ButtonType } from '@iota/apps-ui-kit'; diff --git a/apps/wallet/src/ui/app/components/accounts/UnlockAccountContext.tsx b/apps/wallet/src/ui/app/components/accounts/UnlockAccountContext.tsx index 1fdc63bc2d3..16831f20c1c 100644 --- a/apps/wallet/src/ui/app/components/accounts/UnlockAccountContext.tsx +++ b/apps/wallet/src/ui/app/components/accounts/UnlockAccountContext.tsx @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { type SerializedUIAccount } from '_src/background/accounts/Account'; +import { type SerializedUIAccount } from '_src/background/accounts/account'; import { createContext, useCallback, useContext, useState, type ReactNode, useRef } from 'react'; import { toast } from 'react-hot-toast'; import { useBackgroundClient } from '../../hooks/useBackgroundClient'; diff --git a/apps/wallet/src/ui/app/components/accounts/UnlockAccountModal.tsx b/apps/wallet/src/ui/app/components/accounts/UnlockAccountModal.tsx index 8f778ee6d7f..ef0535425b7 100644 --- a/apps/wallet/src/ui/app/components/accounts/UnlockAccountModal.tsx +++ b/apps/wallet/src/ui/app/components/accounts/UnlockAccountModal.tsx @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { type SerializedUIAccount } from '_src/background/accounts/Account'; +import { type SerializedUIAccount } from '_src/background/accounts/account'; import { toast } from 'react-hot-toast'; import { useBackgroundClient } from '../../hooks/useBackgroundClient'; diff --git a/apps/wallet/src/ui/app/components/index.ts b/apps/wallet/src/ui/app/components/index.ts index 6166f65e8f4..da27863a37e 100644 --- a/apps/wallet/src/ui/app/components/index.ts +++ b/apps/wallet/src/ui/app/components/index.ts @@ -32,3 +32,4 @@ export * from './receipt-card/TxnAmount'; export * from './transactions-card'; export * from './user-approve-container'; export * from './filters-tags'; +export * from './MovedAssetNotification'; diff --git a/apps/wallet/src/ui/app/components/ledger/useDeriveLedgerAccounts.ts b/apps/wallet/src/ui/app/components/ledger/useDeriveLedgerAccounts.ts index f20776577ae..171f5d39648 100644 --- a/apps/wallet/src/ui/app/components/ledger/useDeriveLedgerAccounts.ts +++ b/apps/wallet/src/ui/app/components/ledger/useDeriveLedgerAccounts.ts @@ -2,13 +2,13 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { type LedgerAccountSerializedUI } from '_src/background/accounts/LedgerAccount'; +import { type LedgerAccountSerializedUI } from '_src/background/accounts/ledgerAccount'; import type IotaLedgerClient from '@iota/ledgerjs-hw-app-iota'; import { Ed25519PublicKey } from '@iota/iota-sdk/keypairs/ed25519'; import { useQuery, type UseQueryOptions } from '@tanstack/react-query'; import { useIotaLedgerClient } from './IotaLedgerClientProvider'; -import { AccountType } from '_src/background/accounts/Account'; +import { AccountType } from '_src/background/accounts/account'; type LedgerAccountKeys = 'address' | 'publicKey' | 'type' | 'derivationPath'; diff --git a/apps/wallet/src/ui/app/components/transactions-card/TxnIcon.tsx b/apps/wallet/src/ui/app/components/transactions-card/TxnIcon.tsx deleted file mode 100644 index 598b68a32e5..00000000000 --- a/apps/wallet/src/ui/app/components/transactions-card/TxnIcon.tsx +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -import { LoadingIndicator } from '@iota/apps-ui-kit'; -import { ArrowBottomLeft, ArrowTopRight, Info, IotaLogoMark, Person, Stake } from '@iota/ui-icons'; - -const ICON_COLORS = { - primary: 'text-primary-30', - error: 'text-error-30', -}; - -const icons = { - Send: <ArrowTopRight className={ICON_COLORS.primary} />, - Receive: <ArrowBottomLeft className={ICON_COLORS.primary} />, - Transaction: <ArrowTopRight className={ICON_COLORS.primary} />, - Staked: <Stake className={ICON_COLORS.primary} />, - Unstaked: <Stake className={ICON_COLORS.primary} />, - Rewards: <IotaLogoMark className={ICON_COLORS.primary} />, - Failed: <Info className={ICON_COLORS.error} />, - Loading: <LoadingIndicator />, - PersonalMessage: <Person className={ICON_COLORS.primary} />, -}; - -interface TxnItemIconProps { - txnFailed?: boolean; - variant: keyof typeof icons; -} - -export function TxnIcon({ txnFailed, variant }: TxnItemIconProps) { - return <div className="[&_svg]:h-5 [&_svg]:w-5">{icons[txnFailed ? 'Failed' : variant]}</div>; -} diff --git a/apps/wallet/src/ui/app/components/transactions-card/index.tsx b/apps/wallet/src/ui/app/components/transactions-card/index.tsx index ab15c187695..29609de25d3 100644 --- a/apps/wallet/src/ui/app/components/transactions-card/index.tsx +++ b/apps/wallet/src/ui/app/components/transactions-card/index.tsx @@ -6,13 +6,13 @@ import { useRecognizedPackages } from '_src/ui/app/hooks/useRecognizedPackages'; import { formatDate, getBalanceChangeSummary, - getLabel, + getTransactionAction, useFormatCoin, useTransactionSummary, + TransactionIcon, } from '@iota/core'; import type { IotaTransactionBlockResponse } from '@iota/iota-sdk/client'; import { Link } from 'react-router-dom'; -import { TxnIcon } from './TxnIcon'; import { Card, CardType, @@ -64,9 +64,9 @@ export function TransactionCard({ txn, address }: TransactionCardProps) { > <Card type={CardType.Default} isHoverable> <CardImage type={ImageType.BgSolid} shape={ImageShape.SquareRounded}> - <TxnIcon + <TransactionIcon txnFailed={executionStatus !== 'success' || !!error} - variant={getLabel(txn, address)} + variant={getTransactionAction(txn, address)} /> </CardImage> <CardBody diff --git a/apps/wallet/src/ui/app/experimentation/feature-gating.ts b/apps/wallet/src/ui/app/experimentation/featureGating.ts similarity index 100% rename from apps/wallet/src/ui/app/experimentation/feature-gating.ts rename to apps/wallet/src/ui/app/experimentation/featureGating.ts diff --git a/apps/wallet/src/ui/app/helpers/accounts.ts b/apps/wallet/src/ui/app/helpers/accounts.ts index 55f3d9a5d87..215afff629e 100644 --- a/apps/wallet/src/ui/app/helpers/accounts.ts +++ b/apps/wallet/src/ui/app/helpers/accounts.ts @@ -2,9 +2,9 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { AccountType, type SerializedUIAccount } from '_src/background/accounts/Account'; -import { isMnemonicSerializedUiAccount } from '_src/background/accounts/MnemonicAccount'; -import { isSeedSerializedUiAccount } from '_src/background/accounts/SeedAccount'; +import { AccountType, type SerializedUIAccount } from '_src/background/accounts/account'; +import { isMnemonicSerializedUiAccount } from '_src/background/accounts/mnemonicAccount'; +import { isSeedSerializedUiAccount } from '_src/background/accounts/seedAccount'; export function getKey(account: SerializedUIAccount): string { if (isMnemonicSerializedUiAccount(account)) return account.sourceID; diff --git a/apps/wallet/src/ui/app/helpers/query-client-keys.ts b/apps/wallet/src/ui/app/helpers/queryClientKeys.ts similarity index 100% rename from apps/wallet/src/ui/app/helpers/query-client-keys.ts rename to apps/wallet/src/ui/app/helpers/queryClientKeys.ts diff --git a/apps/wallet/src/ui/app/helpers/sentry.ts b/apps/wallet/src/ui/app/helpers/sentry.ts index 7be751f15d2..0db9f04076b 100644 --- a/apps/wallet/src/ui/app/helpers/sentry.ts +++ b/apps/wallet/src/ui/app/helpers/sentry.ts @@ -2,11 +2,11 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { growthbook } from '_src/ui/app/experimentation/feature-gating'; +import { growthbook } from '_src/ui/app/experimentation/featureGating'; import * as Sentry from '@sentry/react'; import { Feature } from '@iota/core'; -import { getSentryConfig } from '../../../shared/sentry-config'; +import { getSentryConfig } from '../../../shared/sentryConfig'; export default function initSentry() { Sentry.init( diff --git a/apps/wallet/src/ui/app/hooks/useAccountSources.ts b/apps/wallet/src/ui/app/hooks/useAccountSources.ts index f5828295431..0059e441303 100644 --- a/apps/wallet/src/ui/app/hooks/useAccountSources.ts +++ b/apps/wallet/src/ui/app/hooks/useAccountSources.ts @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { type AccountSourceSerializedUI } from '_src/background/account-sources/AccountSource'; +import { type AccountSourceSerializedUI } from '_src/background/account-sources/accountSource'; import { useQuery } from '@tanstack/react-query'; import { useBackgroundClient } from './useBackgroundClient'; diff --git a/apps/wallet/src/ui/app/hooks/useAccounts.ts b/apps/wallet/src/ui/app/hooks/useAccounts.ts index a548c0fab97..b369ccc571a 100644 --- a/apps/wallet/src/ui/app/hooks/useAccounts.ts +++ b/apps/wallet/src/ui/app/hooks/useAccounts.ts @@ -2,10 +2,10 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { type SerializedUIAccount } from '_src/background/accounts/Account'; +import { type SerializedUIAccount } from '_src/background/accounts/account'; import { useQuery } from '@tanstack/react-query'; -import { ACCOUNTS_QUERY_KEY } from '../helpers/query-client-keys'; +import { ACCOUNTS_QUERY_KEY } from '../helpers/queryClientKeys'; import { useBackgroundClient } from './useBackgroundClient'; export function useAccounts() { diff --git a/apps/wallet/src/ui/app/hooks/useAccountsFinder.ts b/apps/wallet/src/ui/app/hooks/useAccountsFinder.ts index ae85a99612b..7ba9534970f 100644 --- a/apps/wallet/src/ui/app/hooks/useAccountsFinder.ts +++ b/apps/wallet/src/ui/app/hooks/useAccountsFinder.ts @@ -12,7 +12,7 @@ import type { } from '_src/shared/messaging/messages/payloads/accounts-finder'; import { makeDerivationPath } from '_src/background/account-sources/bip44Path'; import { Ed25519PublicKey } from '@iota/iota-sdk/keypairs/ed25519'; -import { IOTA_BIP44_COIN_TYPE } from '../redux/slices/iota-objects/Coin'; +import { IOTA_BIP44_COIN_TYPE } from '../redux/slices/iota-objects/coin'; import { IOTA_TYPE_ARG } from '@iota/iota-sdk/utils'; export interface UseAccountFinderOptions { diff --git a/apps/wallet/src/ui/app/hooks/useAppSelector.ts b/apps/wallet/src/ui/app/hooks/useAppSelector.ts index 73eef316546..41c80fa95d2 100644 --- a/apps/wallet/src/ui/app/hooks/useAppSelector.ts +++ b/apps/wallet/src/ui/app/hooks/useAppSelector.ts @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import type { RootState } from '_redux/RootReducer'; +import type { RootState } from '_src/ui/app/redux/rootReducer'; import { useSelector } from 'react-redux'; import type { TypedUseSelectorHook } from 'react-redux'; diff --git a/apps/wallet/src/ui/app/hooks/useBackgroundClient.ts b/apps/wallet/src/ui/app/hooks/useBackgroundClient.ts index ef19242b4d2..5d28ea623aa 100644 --- a/apps/wallet/src/ui/app/hooks/useBackgroundClient.ts +++ b/apps/wallet/src/ui/app/hooks/useBackgroundClient.ts @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { thunkExtras } from '../redux/store/thunk-extras'; +import { thunkExtras } from '../redux/store/thunkExtras'; export function useBackgroundClient() { return thunkExtras.background; diff --git a/apps/wallet/src/ui/app/hooks/useCountAccountByType.ts b/apps/wallet/src/ui/app/hooks/useCountAccountByType.ts index 0f722f25c72..d03c318d624 100644 --- a/apps/wallet/src/ui/app/hooks/useCountAccountByType.ts +++ b/apps/wallet/src/ui/app/hooks/useCountAccountByType.ts @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { type AccountType } from '_src/background/accounts/Account'; +import { type AccountType } from '_src/background/accounts/account'; import { useMemo } from 'react'; import { useAccounts } from './useAccounts'; diff --git a/apps/wallet/src/ui/app/hooks/useCreateAccountMutation.ts b/apps/wallet/src/ui/app/hooks/useCreateAccountMutation.ts index 843f4462a53..5a05f0dd60b 100644 --- a/apps/wallet/src/ui/app/hooks/useCreateAccountMutation.ts +++ b/apps/wallet/src/ui/app/hooks/useCreateAccountMutation.ts @@ -7,7 +7,7 @@ import { useMutation } from '@tanstack/react-query'; import { useAccountsFormContext, AccountsFormType, type AccountsFormValues } from '_components'; import { useBackgroundClient } from './useBackgroundClient'; -import { AccountType } from '_src/background/accounts/Account'; +import { AccountType } from '_src/background/accounts/account'; function validateAccountFormValues<T extends AccountsFormType>( createType: T, diff --git a/apps/wallet/src/ui/app/hooks/useExportPassphraseMutation.ts b/apps/wallet/src/ui/app/hooks/useExportPassphraseMutation.ts index a55ff565788..4fcbc57cdba 100644 --- a/apps/wallet/src/ui/app/hooks/useExportPassphraseMutation.ts +++ b/apps/wallet/src/ui/app/hooks/useExportPassphraseMutation.ts @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { type MethodPayload } from '_src/shared/messaging/messages/payloads/MethodPayload'; +import { type MethodPayload } from '_src/shared/messaging/messages/payloads/methodPayload'; import { entropyToMnemonic, toEntropy } from '_src/shared/utils'; import { useMutation } from '@tanstack/react-query'; diff --git a/apps/wallet/src/ui/app/hooks/useExportSeedMutation.ts b/apps/wallet/src/ui/app/hooks/useExportSeedMutation.ts index ba08ea658e1..fb53230b57e 100644 --- a/apps/wallet/src/ui/app/hooks/useExportSeedMutation.ts +++ b/apps/wallet/src/ui/app/hooks/useExportSeedMutation.ts @@ -1,7 +1,7 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { type MethodPayload } from '_src/shared/messaging/messages/payloads/MethodPayload'; +import { type MethodPayload } from '_src/shared/messaging/messages/payloads/methodPayload'; import { useMutation } from '@tanstack/react-query'; import { useBackgroundClient } from './useBackgroundClient'; diff --git a/apps/wallet/src/ui/app/hooks/useFullscreenGuard.ts b/apps/wallet/src/ui/app/hooks/useFullscreenGuard.ts index 6e38ea7e66a..b0e0fda7a24 100644 --- a/apps/wallet/src/ui/app/hooks/useFullscreenGuard.ts +++ b/apps/wallet/src/ui/app/hooks/useFullscreenGuard.ts @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { AppType } from '_redux/slices/app/AppType'; +import { AppType } from '_src/ui/app/redux/slices/app/appType'; import { openInNewTab } from '_shared/utils'; import { useEffect, useRef } from 'react'; diff --git a/apps/wallet/src/ui/app/hooks/useInitialPageView.ts b/apps/wallet/src/ui/app/hooks/useInitialPageView.ts index 1fde2375182..b3cfcbe159e 100644 --- a/apps/wallet/src/ui/app/hooks/useInitialPageView.ts +++ b/apps/wallet/src/ui/app/hooks/useInitialPageView.ts @@ -9,7 +9,7 @@ import { useEffect } from 'react'; import { useLocation } from 'react-router-dom'; import Browser from 'webextension-polyfill'; -import { AppType } from '../redux/slices/app/AppType'; +import { AppType } from '../redux/slices/app/appType'; import { useActiveAccount } from './useActiveAccount'; import useAppSelector from './useAppSelector'; diff --git a/apps/wallet/src/ui/app/hooks/useRecoveryDataMutation.ts b/apps/wallet/src/ui/app/hooks/useRecoveryDataMutation.ts index 0567bef0896..8db1f1d483d 100644 --- a/apps/wallet/src/ui/app/hooks/useRecoveryDataMutation.ts +++ b/apps/wallet/src/ui/app/hooks/useRecoveryDataMutation.ts @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { type PasswordRecoveryData } from '_src/shared/messaging/messages/payloads/MethodPayload'; +import { type PasswordRecoveryData } from '_src/shared/messaging/messages/payloads/methodPayload'; import { useMutation } from '@tanstack/react-query'; import { useForgotPasswordContext } from '../pages/accounts/forgot-password/ForgotPasswordPage'; diff --git a/apps/wallet/src/ui/app/hooks/useSigner.ts b/apps/wallet/src/ui/app/hooks/useSigner.ts index a7e6398a071..3fa8ba95b2c 100644 --- a/apps/wallet/src/ui/app/hooks/useSigner.ts +++ b/apps/wallet/src/ui/app/hooks/useSigner.ts @@ -2,14 +2,14 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { type SerializedUIAccount } from '_src/background/accounts/Account'; -import { isLedgerAccountSerializedUI } from '_src/background/accounts/LedgerAccount'; +import { type SerializedUIAccount } from '_src/background/accounts/account'; +import { isLedgerAccountSerializedUI } from '_src/background/accounts/ledgerAccount'; import { useIotaClient } from '@iota/dapp-kit'; -import { walletApiProvider } from '../ApiProvider'; +import { walletApiProvider } from '../apiProvider'; import { useIotaLedgerClient } from '_components'; -import { LedgerSigner } from '../LedgerSigner'; -import { type WalletSigner } from '../WalletSigner'; +import { LedgerSigner } from '../ledgerSigner'; +import { type WalletSigner } from '../walletSigner'; import { useBackgroundClient } from './useBackgroundClient'; export function useSigner(account: SerializedUIAccount | null): WalletSigner | null { diff --git a/apps/wallet/src/ui/app/index.tsx b/apps/wallet/src/ui/app/index.tsx index 5203194cb24..f0b48b724b2 100644 --- a/apps/wallet/src/ui/app/index.tsx +++ b/apps/wallet/src/ui/app/index.tsx @@ -4,9 +4,9 @@ import { useAppDispatch, useAppSelector } from '_hooks'; import { setNavVisibility } from '_redux/slices/app'; -import { isLedgerAccountSerializedUI } from '_src/background/accounts/LedgerAccount'; +import { isLedgerAccountSerializedUI } from '_src/background/accounts/ledgerAccount'; import { persistableStorage } from '_src/shared/analytics/amplitude'; -import { type LedgerAccountsPublicKeys } from '_src/shared/messaging/messages/payloads/MethodPayload'; +import { type LedgerAccountsPublicKeys } from '_src/shared/messaging/messages/payloads/methodPayload'; import { toB64 } from '@iota/iota-sdk/utils'; import { useEffect, useMemo } from 'react'; import { Navigate, Route, Routes, useLocation } from 'react-router-dom'; @@ -52,7 +52,7 @@ import { import { TokenDetailsPage } from './pages/home/tokens/TokenDetailsPage'; import { RestrictedPage } from './pages/restricted'; import { SiteConnectPage } from './pages/site-connect'; -import { AppType } from './redux/slices/app/AppType'; +import { AppType } from './redux/slices/app/appType'; import { StakingPage } from './staking/home'; import { StorageMigrationPage } from './pages/StorageMigrationPage'; import { useStorageMigrationStatus } from './hooks/useStorageMigrationStatus'; diff --git a/apps/wallet/src/ui/app/LedgerSigner.ts b/apps/wallet/src/ui/app/ledgerSigner.ts similarity index 98% rename from apps/wallet/src/ui/app/LedgerSigner.ts rename to apps/wallet/src/ui/app/ledgerSigner.ts index 2d824f45324..2ac65e1ca5c 100644 --- a/apps/wallet/src/ui/app/LedgerSigner.ts +++ b/apps/wallet/src/ui/app/ledgerSigner.ts @@ -7,7 +7,7 @@ import { type IotaClient } from '@iota/iota-sdk/client'; import { toSerializedSignature, type SignatureScheme } from '@iota/iota-sdk/cryptography'; import { Ed25519PublicKey } from '@iota/iota-sdk/keypairs/ed25519'; -import { WalletSigner } from './WalletSigner'; +import { WalletSigner } from './walletSigner'; export class LedgerSigner extends WalletSigner { #iotaLedgerClient: IotaLedgerClient | null; diff --git a/apps/wallet/src/ui/app/pages/accounts/AddAccountPage.tsx b/apps/wallet/src/ui/app/pages/accounts/AddAccountPage.tsx index 6f352beb796..d703fb4d6c8 100644 --- a/apps/wallet/src/ui/app/pages/accounts/AddAccountPage.tsx +++ b/apps/wallet/src/ui/app/pages/accounts/AddAccountPage.tsx @@ -25,7 +25,7 @@ import { import { getLedgerConnectionErrorMessage } from '../../helpers/errorMessages'; import { useAppSelector } from '../../hooks'; import { useCreateAccountsMutation } from '../../hooks/useCreateAccountMutation'; -import { AppType } from '../../redux/slices/app/AppType'; +import { AppType } from '../../redux/slices/app/appType'; import { Create, ImportPass, Key, Seed, Ledger } from '@iota/ui-icons'; async function openTabWithSearchParam(searchParam: string, searchParamValue: string) { diff --git a/apps/wallet/src/ui/app/pages/accounts/BackupMnemonicPage.tsx b/apps/wallet/src/ui/app/pages/accounts/BackupMnemonicPage.tsx index 3c0d667ddc0..6913d54831f 100644 --- a/apps/wallet/src/ui/app/pages/accounts/BackupMnemonicPage.tsx +++ b/apps/wallet/src/ui/app/pages/accounts/BackupMnemonicPage.tsx @@ -12,7 +12,7 @@ import { } from '@iota/apps-ui-kit'; import { Exclamation, Info } from '@iota/ui-icons'; import { HideShowDisplayBox, Loading, PageTemplate } from '_components'; -import { AccountSourceType } from '_src/background/account-sources/AccountSource'; +import { AccountSourceType } from '_src/background/account-sources/accountSource'; import { useEffect, useMemo, useState } from 'react'; import { Navigate, useNavigate, useParams } from 'react-router-dom'; import { useAccountSources } from '../../hooks/useAccountSources'; diff --git a/apps/wallet/src/ui/app/pages/accounts/ExportPassphrasePage.tsx b/apps/wallet/src/ui/app/pages/accounts/ExportPassphrasePage.tsx index 53287018e22..990b7566cd7 100644 --- a/apps/wallet/src/ui/app/pages/accounts/ExportPassphrasePage.tsx +++ b/apps/wallet/src/ui/app/pages/accounts/ExportPassphrasePage.tsx @@ -6,7 +6,7 @@ import { HideShowDisplayBox, VerifyPasswordModal, Loading, Overlay } from '_comp import { Navigate, useNavigate, useParams } from 'react-router-dom'; import { useAccountSources } from '../../hooks/useAccountSources'; import { useExportPassphraseMutation } from '../../hooks/useExportPassphraseMutation'; -import { AccountSourceType } from '_src/background/account-sources/AccountSource'; +import { AccountSourceType } from '_src/background/account-sources/accountSource'; import { InfoBox, InfoBoxType, InfoBoxStyle } from '@iota/apps-ui-kit'; import { Info } from '@iota/ui-icons'; diff --git a/apps/wallet/src/ui/app/pages/accounts/ExportSeedPage.tsx b/apps/wallet/src/ui/app/pages/accounts/ExportSeedPage.tsx index a14ab150a52..373e9d686a8 100644 --- a/apps/wallet/src/ui/app/pages/accounts/ExportSeedPage.tsx +++ b/apps/wallet/src/ui/app/pages/accounts/ExportSeedPage.tsx @@ -5,7 +5,7 @@ import { HideShowDisplayBox, VerifyPasswordModal, Loading, Overlay } from '_comp import { Navigate, useNavigate, useParams } from 'react-router-dom'; import { useAccountSources } from '../../hooks/useAccountSources'; import { useExportSeedMutation } from '../../hooks/useExportSeedMutation'; -import { AccountSourceType } from '_src/background/account-sources/AccountSource'; +import { AccountSourceType } from '_src/background/account-sources/accountSource'; import { InfoBox, InfoBoxType, InfoBoxStyle } from '@iota/apps-ui-kit'; import { Info } from '@iota/ui-icons'; diff --git a/apps/wallet/src/ui/app/pages/accounts/ProtectAccountPage.tsx b/apps/wallet/src/ui/app/pages/accounts/ProtectAccountPage.tsx index 6cd3d880426..36e8cad8de9 100644 --- a/apps/wallet/src/ui/app/pages/accounts/ProtectAccountPage.tsx +++ b/apps/wallet/src/ui/app/pages/accounts/ProtectAccountPage.tsx @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { isMnemonicSerializedUiAccount } from '_src/background/accounts/MnemonicAccount'; +import { isMnemonicSerializedUiAccount } from '_src/background/accounts/mnemonicAccount'; import { useCallback, useEffect, useMemo, useState } from 'react'; import { toast } from 'react-hot-toast'; import { Navigate, useNavigate, useSearchParams } from 'react-router-dom'; @@ -18,8 +18,8 @@ import { useAccounts } from '../../hooks/useAccounts'; import { autoLockDataToMinutes } from '../../hooks/useAutoLockMinutes'; import { useAutoLockMinutesMutation } from '../../hooks/useAutoLockMinutesMutation'; import { useCreateAccountsMutation } from '../../hooks/useCreateAccountMutation'; -import { isSeedSerializedUiAccount } from '_src/background/accounts/SeedAccount'; -import { isLedgerAccountSerializedUI } from '_src/background/accounts/LedgerAccount'; +import { isSeedSerializedUiAccount } from '_src/background/accounts/seedAccount'; +import { isLedgerAccountSerializedUI } from '_src/background/accounts/ledgerAccount'; import { AllowedAccountSourceTypes } from '../../accounts-finder'; import { useFeature } from '@growthbook/growthbook-react'; import { Feature } from '@iota/core'; diff --git a/apps/wallet/src/ui/app/pages/accounts/forgot-password/ForgotPasswordIndexPage.tsx b/apps/wallet/src/ui/app/pages/accounts/forgot-password/ForgotPasswordIndexPage.tsx index 5c994dd90c3..0cc3f7ac51e 100644 --- a/apps/wallet/src/ui/app/pages/accounts/forgot-password/ForgotPasswordIndexPage.tsx +++ b/apps/wallet/src/ui/app/pages/accounts/forgot-password/ForgotPasswordIndexPage.tsx @@ -6,7 +6,7 @@ import { useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; import { useAccountSources } from '../../../hooks/useAccountSources'; -import { AccountSourceType } from '_src/background/account-sources/AccountSource'; +import { AccountSourceType } from '_src/background/account-sources/accountSource'; export function ForgotPasswordIndexPage() { const allAccountSources = useAccountSources(); diff --git a/apps/wallet/src/ui/app/pages/accounts/forgot-password/ForgotPasswordPage.tsx b/apps/wallet/src/ui/app/pages/accounts/forgot-password/ForgotPasswordPage.tsx index ebc1e4e60c1..a13e93f6448 100644 --- a/apps/wallet/src/ui/app/pages/accounts/forgot-password/ForgotPasswordPage.tsx +++ b/apps/wallet/src/ui/app/pages/accounts/forgot-password/ForgotPasswordPage.tsx @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { type PasswordRecoveryData } from '_src/shared/messaging/messages/payloads/MethodPayload'; +import { type PasswordRecoveryData } from '_src/shared/messaging/messages/payloads/methodPayload'; import { createContext, useCallback, useContext, useState } from 'react'; import { Outlet } from 'react-router-dom'; diff --git a/apps/wallet/src/ui/app/pages/accounts/forgot-password/RecoverManyPage.tsx b/apps/wallet/src/ui/app/pages/accounts/forgot-password/RecoverManyPage.tsx index 61ae8475f46..525b555fac2 100644 --- a/apps/wallet/src/ui/app/pages/accounts/forgot-password/RecoverManyPage.tsx +++ b/apps/wallet/src/ui/app/pages/accounts/forgot-password/RecoverManyPage.tsx @@ -17,8 +17,8 @@ import { useNavigate } from 'react-router-dom'; import { useAccountGroups } from '../../../hooks/useAccountGroups'; import { useAccountSources } from '../../../hooks/useAccountSources'; import { useForgotPasswordContext } from './ForgotPasswordPage'; -import { AccountSourceType } from '_src/background/account-sources/AccountSource'; -import { AccountType } from '_src/background/accounts/Account'; +import { AccountSourceType } from '_src/background/account-sources/accountSource'; +import { AccountType } from '_src/background/accounts/account'; import { Button, ButtonType } from '@iota/apps-ui-kit'; export function RecoverManyPage() { diff --git a/apps/wallet/src/ui/app/pages/accounts/forgot-password/RecoverPage.tsx b/apps/wallet/src/ui/app/pages/accounts/forgot-password/RecoverPage.tsx index ae04304d2de..54065f9713b 100644 --- a/apps/wallet/src/ui/app/pages/accounts/forgot-password/RecoverPage.tsx +++ b/apps/wallet/src/ui/app/pages/accounts/forgot-password/RecoverPage.tsx @@ -9,7 +9,7 @@ import { useEffect } from 'react'; import toast from 'react-hot-toast'; import { useNavigate } from 'react-router-dom'; import { useAccountSources } from '../../../hooks/useAccountSources'; -import { AccountSourceType } from '_src/background/account-sources/AccountSource'; +import { AccountSourceType } from '_src/background/account-sources/accountSource'; import { PageTemplate } from '_src/ui/app/components/PageTemplate'; export function RecoverPage() { diff --git a/apps/wallet/src/ui/app/pages/accounts/manage/AccountGroup.tsx b/apps/wallet/src/ui/app/pages/accounts/manage/AccountGroup.tsx index 016f3e51dff..80ad4f0e5f9 100644 --- a/apps/wallet/src/ui/app/pages/accounts/manage/AccountGroup.tsx +++ b/apps/wallet/src/ui/app/pages/accounts/manage/AccountGroup.tsx @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { AccountType, type SerializedUIAccount } from '_src/background/accounts/Account'; +import { AccountType, type SerializedUIAccount } from '_src/background/accounts/account'; import { AccountsFormType, useAccountsFormContext, VerifyPasswordModal } from '_components'; import { useAccountSources } from '_src/ui/app/hooks/useAccountSources'; import { useCreateAccountsMutation } from '_src/ui/app/hooks/useCreateAccountMutation'; diff --git a/apps/wallet/src/ui/app/pages/accounts/manage/AccountGroupItem.tsx b/apps/wallet/src/ui/app/pages/accounts/manage/AccountGroupItem.tsx index 6762b389280..78e7a82e307 100644 --- a/apps/wallet/src/ui/app/pages/accounts/manage/AccountGroupItem.tsx +++ b/apps/wallet/src/ui/app/pages/accounts/manage/AccountGroupItem.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { AccountType, type SerializedUIAccount } from '_src/background/accounts/Account'; +import { AccountType, type SerializedUIAccount } from '_src/background/accounts/account'; import { useState, useRef } from 'react'; import clsx from 'clsx'; import { formatAddress } from '@iota/iota-sdk/utils'; diff --git a/apps/wallet/src/ui/app/pages/accounts/manage/ManageAccountsPage.tsx b/apps/wallet/src/ui/app/pages/accounts/manage/ManageAccountsPage.tsx index 73859789962..ba0b6d7f348 100644 --- a/apps/wallet/src/ui/app/pages/accounts/manage/ManageAccountsPage.tsx +++ b/apps/wallet/src/ui/app/pages/accounts/manage/ManageAccountsPage.tsx @@ -3,7 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 import { useRef } from 'react'; import { Button, ButtonType } from '@iota/apps-ui-kit'; -import { type AccountType } from '_src/background/accounts/Account'; +import { type AccountType } from '_src/background/accounts/account'; import { useInitializedGuard } from '_src/ui/app/hooks'; import { useAccountGroups } from '_src/ui/app/hooks/useAccountGroups'; import { useNavigate } from 'react-router-dom'; diff --git a/apps/wallet/src/ui/app/pages/accounts/manage/accounts-finder/AccountsFinderView.tsx b/apps/wallet/src/ui/app/pages/accounts/manage/accounts-finder/AccountsFinderView.tsx index 97353451383..6e040de36ae 100644 --- a/apps/wallet/src/ui/app/pages/accounts/manage/accounts-finder/AccountsFinderView.tsx +++ b/apps/wallet/src/ui/app/pages/accounts/manage/accounts-finder/AccountsFinderView.tsx @@ -12,8 +12,8 @@ import { import { AccountSourceType, type AccountSourceSerializedUI, -} from '_src/background/account-sources/AccountSource'; -import { AccountType } from '_src/background/accounts/Account'; +} from '_src/background/account-sources/accountSource'; +import { AccountType } from '_src/background/accounts/account'; import { type SourceStrategyToFind } from '_src/shared/messaging/messages/payloads/accounts-finder'; import { AllowedAccountSourceTypes } from '_src/ui/app/accounts-finder'; import { getKey } from '_src/ui/app/helpers/accounts'; diff --git a/apps/wallet/src/ui/app/pages/approval-request/SignMessageRequest.tsx b/apps/wallet/src/ui/app/pages/approval-request/SignMessageRequest.tsx index 7f708d31f9f..7834bd959b2 100644 --- a/apps/wallet/src/ui/app/pages/approval-request/SignMessageRequest.tsx +++ b/apps/wallet/src/ui/app/pages/approval-request/SignMessageRequest.tsx @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { type SignPersonalMessageApprovalRequest } from '_payloads/transactions/ApprovalRequest'; +import { type SignPersonalMessageApprovalRequest } from '_src/shared/messaging/messages/payloads/transactions/approvalRequest'; import { toUtf8OrB64 } from '_src/shared/utils'; import { useMemo } from 'react'; import { UserApproveContainer } from '_components'; diff --git a/apps/wallet/src/ui/app/pages/approval-request/index.tsx b/apps/wallet/src/ui/app/pages/approval-request/index.tsx index 14c7dafa767..093c74c619e 100644 --- a/apps/wallet/src/ui/app/pages/approval-request/index.tsx +++ b/apps/wallet/src/ui/app/pages/approval-request/index.tsx @@ -5,13 +5,13 @@ import { isSignPersonalMessageApprovalRequest, isTransactionApprovalRequest, -} from '_payloads/transactions/ApprovalRequest'; +} from '_src/shared/messaging/messages/payloads/transactions/approvalRequest'; import { useEffect, useMemo } from 'react'; import { useParams } from 'react-router-dom'; import { Loading } from '_components'; import { useAppSelector } from '../../hooks'; -import { type RootState } from '../../redux/RootReducer'; +import { type RootState } from '../../redux/rootReducer'; import { txRequestsSelectors } from '../../redux/slices/transaction-requests'; import { SignMessageRequest } from './SignMessageRequest'; import { TransactionRequest } from './transaction-request'; diff --git a/apps/wallet/src/ui/app/pages/approval-request/transaction-request/index.tsx b/apps/wallet/src/ui/app/pages/approval-request/transaction-request/index.tsx index e3cf45db226..5271335b484 100644 --- a/apps/wallet/src/ui/app/pages/approval-request/transaction-request/index.tsx +++ b/apps/wallet/src/ui/app/pages/approval-request/transaction-request/index.tsx @@ -4,7 +4,7 @@ import { ExplorerLinkHelper, UserApproveContainer } from '_components'; import { useActiveAddress, useAppDispatch, useTransactionData, useTransactionDryRun } from '_hooks'; -import { type TransactionApprovalRequest } from '_payloads/transactions/ApprovalRequest'; +import { type TransactionApprovalRequest } from '_src/shared/messaging/messages/payloads/transactions/approvalRequest'; import { respondToTransactionRequest } from '_redux/slices/transaction-requests'; import { ampli } from '_src/shared/analytics/ampli'; import { useAccountByAddress } from '_src/ui/app/hooks/useAccountByAddress'; @@ -16,7 +16,7 @@ import { Transaction } from '@iota/iota-sdk/transactions'; import { useMemo, useState } from 'react'; import { ConfirmationModal } from '../../../shared/ConfirmationModal'; -import { TransactionDetails } from './TransactionDetails'; +import { TransactionDetails } from './transaction-details'; export interface TransactionRequestProps { txRequest: TransactionApprovalRequest; diff --git a/apps/wallet/src/ui/app/pages/approval-request/transaction-request/TransactionDetails/Command.tsx b/apps/wallet/src/ui/app/pages/approval-request/transaction-request/transaction-details/Command.tsx similarity index 100% rename from apps/wallet/src/ui/app/pages/approval-request/transaction-request/TransactionDetails/Command.tsx rename to apps/wallet/src/ui/app/pages/approval-request/transaction-request/transaction-details/Command.tsx diff --git a/apps/wallet/src/ui/app/pages/approval-request/transaction-request/TransactionDetails/Input.tsx b/apps/wallet/src/ui/app/pages/approval-request/transaction-request/transaction-details/Input.tsx similarity index 100% rename from apps/wallet/src/ui/app/pages/approval-request/transaction-request/TransactionDetails/Input.tsx rename to apps/wallet/src/ui/app/pages/approval-request/transaction-request/transaction-details/Input.tsx diff --git a/apps/wallet/src/ui/app/pages/approval-request/transaction-request/TransactionDetails/index.tsx b/apps/wallet/src/ui/app/pages/approval-request/transaction-request/transaction-details/index.tsx similarity index 100% rename from apps/wallet/src/ui/app/pages/approval-request/transaction-request/TransactionDetails/index.tsx rename to apps/wallet/src/ui/app/pages/approval-request/transaction-request/transaction-details/index.tsx diff --git a/apps/wallet/src/ui/app/pages/home/apps/index.tsx b/apps/wallet/src/ui/app/pages/home/apps/index.tsx index f3c065e5e1b..935ead51287 100644 --- a/apps/wallet/src/ui/app/pages/home/apps/index.tsx +++ b/apps/wallet/src/ui/app/pages/home/apps/index.tsx @@ -4,7 +4,7 @@ import { useFeature } from '@growthbook/growthbook-react'; import { FiltersPortal, ConnectedAppsCard, type DAppEntry } from '_components'; -import { getFromSessionStorage, setToSessionStorage } from '_src/background/storage-utils'; +import { getFromSessionStorage, setToSessionStorage } from '_src/background/storageUtils'; import { Feature } from '@iota/core'; import { useUnlockedGuard } from '_src/ui/app/hooks/useUnlockedGuard'; import { useEffect } from 'react'; diff --git a/apps/wallet/src/ui/app/pages/home/assets/HiddenAssetsProvider.tsx b/apps/wallet/src/ui/app/pages/home/assets/HiddenAssetsProvider.tsx deleted file mode 100644 index ff94f428a74..00000000000 --- a/apps/wallet/src/ui/app/pages/home/assets/HiddenAssetsProvider.tsx +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -import { get, set } from 'idb-keyval'; -import { createContext, useCallback, useContext, useEffect, useState, type ReactNode } from 'react'; -import { type Toast, toast } from 'react-hot-toast'; -import { ButtonUnstyled } from '@iota/apps-ui-kit'; - -const HIDDEN_ASSET_IDS = 'hidden-asset-ids'; - -type HiddenAssets = - | { - type: 'loading'; - } - | { - type: 'loaded'; - assetIds: string[]; - }; - -interface HiddenAssetContext { - hiddenAssets: HiddenAssets; - setHiddenAssetIds: (hiddenAssetIds: string[]) => void; - hideAsset: (assetId: string) => void; - showAsset: (assetId: string) => void; -} - -export const HiddenAssetsContext = createContext<HiddenAssetContext>({ - hiddenAssets: { - type: 'loading', - }, - setHiddenAssetIds: () => {}, - hideAsset: () => {}, - showAsset: () => {}, -}); - -export const HiddenAssetsProvider = ({ children }: { children: ReactNode }) => { - const [hiddenAssets, setHiddenAssets] = useState<HiddenAssets>({ - type: 'loading', - }); - - const hiddenAssetIds = hiddenAssets.type === 'loaded' ? hiddenAssets.assetIds : []; - - useEffect(() => { - (async () => { - const hiddenAssets = (await get<string[]>(HIDDEN_ASSET_IDS)) ?? []; - setHiddenAssetIds(hiddenAssets); - })(); - }, []); - - function setHiddenAssetIds(hiddenAssetIds: string[]) { - setHiddenAssets({ - type: 'loaded', - assetIds: hiddenAssetIds, - }); - } - - const hideAssetId = useCallback( - async (newAssetId: string) => { - if (hiddenAssetIds.includes(newAssetId)) return; - - const newHiddenAssetIds = [...hiddenAssetIds, newAssetId]; - setHiddenAssetIds(newHiddenAssetIds); - await set(HIDDEN_ASSET_IDS, newHiddenAssetIds); - - const undoHideAsset = async (assetId: string) => { - try { - let updatedHiddenAssetIds; - setHiddenAssets((previous) => { - const previousIds = previous.type === 'loaded' ? previous.assetIds : []; - updatedHiddenAssetIds = previousIds.filter((id) => id !== assetId); - return { - type: 'loaded', - assetIds: updatedHiddenAssetIds, - }; - }); - await set(HIDDEN_ASSET_IDS, updatedHiddenAssetIds); - } catch (error) { - // Handle any error that occurred during the unhide process - toast.error('Failed to unhide asset.'); - // Restore the asset ID back to the hidden asset IDs list - setHiddenAssetIds([...hiddenAssetIds, assetId]); - await set(HIDDEN_ASSET_IDS, hiddenAssetIds); - } - }; - - const showAssetHiddenToast = async (objectId: string) => { - toast.success( - (t) => ( - <MovedAssetNotification - t={t} - destination="Hidden Assets" - onUndo={() => undoHideAsset(objectId)} - /> - ), - { - duration: 4000, - }, - ); - }; - showAssetHiddenToast(newAssetId); - }, - [hiddenAssetIds], - ); - - const showAssetId = useCallback( - async (newAssetId: string) => { - if (!hiddenAssetIds.includes(newAssetId)) return; - - try { - const updatedHiddenAssetIds = hiddenAssetIds.filter((id) => id !== newAssetId); - setHiddenAssetIds(updatedHiddenAssetIds); - await set(HIDDEN_ASSET_IDS, updatedHiddenAssetIds); - } catch (error) { - // Handle any error that occurred during the unhide process - toast.error('Failed to show asset.'); - // Restore the asset ID back to the hidden asset IDs list - setHiddenAssetIds([...hiddenAssetIds, newAssetId]); - await set(HIDDEN_ASSET_IDS, hiddenAssetIds); - } - - const undoShowAsset = async (assetId: string) => { - let newHiddenAssetIds; - setHiddenAssets((previous) => { - const previousIds = previous.type === 'loaded' ? previous.assetIds : []; - newHiddenAssetIds = [...previousIds, assetId]; - return { - type: 'loaded', - assetIds: newHiddenAssetIds, - }; - }); - await set(HIDDEN_ASSET_IDS, newHiddenAssetIds); - }; - - const assetShownToast = async (objectId: string) => { - toast.success( - (t) => ( - <MovedAssetNotification - t={t} - destination="Visual Assets" - onUndo={() => undoShowAsset(objectId)} - /> - ), - { - duration: 4000, - }, - ); - }; - - assetShownToast(newAssetId); - }, - [hiddenAssetIds], - ); - - const showAsset = (objectId: string) => { - showAssetId(objectId); - }; - - return ( - <HiddenAssetsContext.Provider - value={{ - hiddenAssets: - hiddenAssets.type === 'loaded' - ? { ...hiddenAssets, assetIds: Array.from(new Set(hiddenAssetIds)) } - : { type: 'loading' }, - setHiddenAssetIds, - hideAsset: hideAssetId, - showAsset, - }} - > - {children} - </HiddenAssetsContext.Provider> - ); -}; - -export const useHiddenAssets = () => { - return useContext(HiddenAssetsContext); -}; - -interface MovedAssetNotificationProps { - t: Toast; - destination: string; - onUndo: () => void; -} -function MovedAssetNotification({ t, destination, onUndo }: MovedAssetNotificationProps) { - return ( - <div - className="flex w-full flex-row items-baseline gap-x-xxs" - onClick={() => toast.dismiss(t.id)} - > - <ButtonUnstyled className="text-body-sm text-neutral-12 dark:text-neutral-92"> - Moved to {destination} - </ButtonUnstyled> - <ButtonUnstyled - onClick={() => { - onUndo(); - toast.dismiss(t.id); - }} - className="ml-auto mr-sm text-body-sm text-neutral-12 dark:text-neutral-92" - > - UNDO - </ButtonUnstyled> - </div> - ); -} diff --git a/apps/wallet/src/ui/app/pages/home/assets/index.tsx b/apps/wallet/src/ui/app/pages/home/assets/index.tsx index e26f9407b3b..b1b2b0dbc7e 100644 --- a/apps/wallet/src/ui/app/pages/home/assets/index.tsx +++ b/apps/wallet/src/ui/app/pages/home/assets/index.tsx @@ -5,7 +5,7 @@ import { useUnlockedGuard } from '_src/ui/app/hooks/useUnlockedGuard'; import { Route, Routes } from 'react-router-dom'; import { NftsPage } from '..'; -import { HiddenAssetsProvider } from './HiddenAssetsProvider'; +import { HiddenAssetsProvider } from '@iota/core'; export function AssetsPage() { if (useUnlockedGuard()) { diff --git a/apps/wallet/src/ui/app/pages/home/nft-details/index.tsx b/apps/wallet/src/ui/app/pages/home/nft-details/index.tsx index f0ae3b9ec50..c0886d36c9b 100644 --- a/apps/wallet/src/ui/app/pages/home/nft-details/index.tsx +++ b/apps/wallet/src/ui/app/pages/home/nft-details/index.tsx @@ -33,12 +33,12 @@ export function NFTDetailsPage() { const isPending = isLoading || isGuardLoading; function handleMoreAboutKiosk() { - window.open('https://docs.iota.org/references/ts-sdk/kiosk/', '_blank'); + window.open('https://docs.iota.org/ts-sdk/kiosk/', '_blank'); } function handleMarketplace() { // TODO: https://github.com/iotaledger/iota/issues/4024 - window.open('https://docs.iota.org/references/ts-sdk/kiosk/', '_blank'); + window.open('https://docs.iota.org/ts-sdk/kiosk/', '_blank'); } function handleSend() { diff --git a/apps/wallet/src/ui/app/pages/home/nfts/HiddenAsset.tsx b/apps/wallet/src/ui/app/pages/home/nfts/HiddenAsset.tsx index 58ffb29a897..59bc52ff5b3 100644 --- a/apps/wallet/src/ui/app/pages/home/nfts/HiddenAsset.tsx +++ b/apps/wallet/src/ui/app/pages/home/nfts/HiddenAsset.tsx @@ -2,17 +2,18 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { ErrorBoundary } from '_components'; +import { ErrorBoundary, MovedAssetNotification } from '_components'; import { ampli } from '_src/shared/analytics/ampli'; import { type IotaObjectData } from '@iota/iota-sdk/client'; import { useNavigate } from 'react-router-dom'; -import { useHiddenAssets } from '../assets/HiddenAssetsProvider'; +import { toast } from 'react-hot-toast'; import { getKioskIdFromOwnerCap, isKioskOwnerToken, useGetNFTDisplay, useGetObject, useKioskClient, + useHiddenAssets, } from '@iota/core'; import { Card, @@ -39,7 +40,7 @@ export interface HiddenAssetProps { } export function HiddenAsset(item: HiddenAssetProps) { - const { showAsset } = useHiddenAssets(); + const { showAsset, hideAsset } = useHiddenAssets(); const kioskClient = useKioskClient(); const navigate = useNavigate(); const { objectId, type } = item.data!; @@ -65,6 +66,23 @@ export function HiddenAsset(item: HiddenAssetProps) { collectibleType: type!, }); } + + function handleShowAsset() { + showAsset(objectId); + toast.success( + (t) => ( + <MovedAssetNotification + t={t} + destination="Visual Assets" + onUndo={() => hideAsset(objectId)} + /> + ), + { + duration: 4000, + }, + ); + } + return ( <ErrorBoundary> <Card type={CardType.Default} onClick={handleHiddenAssetClick}> @@ -88,9 +106,7 @@ export function HiddenAsset(item: HiddenAssetProps) { <CardBody title={nftMeta?.name ?? 'Asset'} subtitle={formatAddress(objectId)} /> <CardAction type={CardActionType.Link} - onClick={() => { - showAsset(objectId); - }} + onClick={handleShowAsset} icon={<VisibilityOff />} /> </Card> diff --git a/apps/wallet/src/ui/app/pages/home/nfts/VisualAssets.tsx b/apps/wallet/src/ui/app/pages/home/nfts/VisualAssets.tsx index c4e1e046bc5..9e1654738bd 100644 --- a/apps/wallet/src/ui/app/pages/home/nfts/VisualAssets.tsx +++ b/apps/wallet/src/ui/app/pages/home/nfts/VisualAssets.tsx @@ -2,13 +2,17 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { ErrorBoundary, NFTDisplayCard } from '_components'; +import { ErrorBoundary, NFTDisplayCard, MovedAssetNotification } from '_components'; import { ampli } from '_src/shared/analytics/ampli'; import { type IotaObjectData } from '@iota/iota-sdk/client'; import { Link } from 'react-router-dom'; - -import { useHiddenAssets } from '../assets/HiddenAssetsProvider'; -import { getKioskIdFromOwnerCap, isKioskOwnerToken, useKioskClient } from '@iota/core'; +import { toast } from 'react-hot-toast'; +import { + useHiddenAssets, + getKioskIdFromOwnerCap, + isKioskOwnerToken, + useKioskClient, +} from '@iota/core'; import { VisibilityOff } from '@iota/ui-icons'; interface VisualAssetsProps { @@ -16,17 +20,34 @@ interface VisualAssetsProps { } export function VisualAssets({ items }: VisualAssetsProps) { - const { hideAsset } = useHiddenAssets(); + const { hideAsset, showAsset } = useHiddenAssets(); const kioskClient = useKioskClient(); - function handleHideAsset(event: React.MouseEvent<HTMLButtonElement>, object: IotaObjectData) { + async function handleHideAsset( + event: React.MouseEvent<HTMLButtonElement>, + object: IotaObjectData, + ) { event.preventDefault(); event.stopPropagation(); ampli.clickedHideAsset({ objectId: object.objectId, collectibleType: object.type!, }); - hideAsset(object.objectId); + + await hideAsset(object.objectId); + + toast.success( + (t) => ( + <MovedAssetNotification + t={t} + destination="Hidden Assets" + onUndo={() => showAsset(object.objectId)} + /> + ), + { + duration: 4000, + }, + ); } return ( diff --git a/apps/wallet/src/ui/app/pages/home/nfts/index.tsx b/apps/wallet/src/ui/app/pages/home/nfts/index.tsx index 30d5af7b648..e90fbc2ae18 100644 --- a/apps/wallet/src/ui/app/pages/home/nfts/index.tsx +++ b/apps/wallet/src/ui/app/pages/home/nfts/index.tsx @@ -13,19 +13,11 @@ import { } from '@iota/apps-ui-kit'; import { useActiveAddress } from '_app/hooks/useActiveAddress'; import { Loading, NoData, PageTemplate } from '_components'; -import { useGetNFTs } from '_src/ui/app/hooks/useGetNFTs'; -import { useEffect, useMemo, useRef, useState } from 'react'; import { HiddenAssets } from './HiddenAssets'; import { NonVisualAssets } from './NonVisualAssets'; import { VisualAssets } from './VisualAssets'; import { Warning } from '@iota/ui-icons'; -import { useOnScreen } from '@iota/core'; - -enum AssetCategory { - Visual = 'Visual', - Other = 'Other', - Hidden = 'Hidden', -} +import { useHiddenAssets, usePageAssets, AssetCategory } from '@iota/core'; const ASSET_CATEGORIES = [ { @@ -43,102 +35,22 @@ const ASSET_CATEGORIES = [ ]; export function NftsPage() { - const [selectedAssetCategory, setSelectedAssetCategory] = useState<AssetCategory | null>(null); - const observerElem = useRef<HTMLDivElement | null>(null); - const { isIntersecting } = useOnScreen(observerElem); - const accountAddress = useActiveAddress(); + const { hiddenAssets } = useHiddenAssets(); + const { - data: ownedAssets, - hasNextPage, - isFetchingNextPage, - fetchNextPage, - error, isPending, + isAssetsLoaded, isError, - } = useGetNFTs(accountAddress); - - const isAssetsLoaded = !!ownedAssets; - - const isSpinnerVisible = isFetchingNextPage && hasNextPage; - - const filteredAssets = (() => { - if (!ownedAssets) return []; - switch (selectedAssetCategory) { - case AssetCategory.Visual: - return ownedAssets.visual; - case AssetCategory.Other: - return ownedAssets.other; - default: - return []; - } - })(); - - const filteredHiddenAssets = useMemo(() => { - return ( - ownedAssets?.hidden - .flatMap((data) => { - return { - data: data, - display: data?.display?.data, - }; - }) - .sort((nftA, nftB) => { - const nameA = nftA.display?.name || ''; - const nameB = nftB.display?.name || ''; - - if (nameA < nameB) { - return -1; - } else if (nameA > nameB) { - return 1; - } - return 0; - }) ?? [] - ); - }, [ownedAssets]); - - useEffect(() => { - if (isIntersecting && hasNextPage && !isFetchingNextPage) { - fetchNextPage(); - } - }, [isIntersecting, fetchNextPage, hasNextPage, isFetchingNextPage]); - - useEffect(() => { - let computeSelectedCategory = false; - if ( - (selectedAssetCategory === AssetCategory.Visual && ownedAssets?.visual.length === 0) || - (selectedAssetCategory === AssetCategory.Other && ownedAssets?.other.length === 0) || - (selectedAssetCategory === AssetCategory.Hidden && ownedAssets?.hidden.length === 0) || - !selectedAssetCategory - ) { - computeSelectedCategory = true; - } - if (computeSelectedCategory && ownedAssets) { - const defaultCategory = - ownedAssets.visual.length > 0 - ? AssetCategory.Visual - : ownedAssets.other.length > 0 - ? AssetCategory.Other - : ownedAssets.hidden.length > 0 - ? AssetCategory.Hidden - : null; - setSelectedAssetCategory(defaultCategory); - } - }, [ownedAssets]); - - useEffect(() => { - // Fetch the next page if there are no visual assets, other + hidden assets are present in multiples of 50, and there are more pages to fetch - if ( - hasNextPage && - ownedAssets?.visual.length === 0 && - ownedAssets?.other.length + ownedAssets?.hidden.length > 0 && - (ownedAssets.other.length + ownedAssets.hidden.length) % 50 === 0 && - !isFetchingNextPage - ) { - fetchNextPage(); - setSelectedAssetCategory(null); - } - }, [hasNextPage, ownedAssets, isFetchingNextPage]); + error, + ownedAssets, + filteredAssets, + filteredHiddenAssets, + selectedAssetCategory, + setSelectedAssetCategory, + isSpinnerVisible, + observerElem, + } = usePageAssets(accountAddress, hiddenAssets); return ( <PageTemplate title="Assets" isTitleCentered> diff --git a/apps/wallet/src/ui/app/pages/home/tokens/ReceiveTokensDialog.tsx b/apps/wallet/src/ui/app/pages/home/tokens/ReceiveTokensDialog.tsx index d790d723b1f..50342a3d85a 100644 --- a/apps/wallet/src/ui/app/pages/home/tokens/ReceiveTokensDialog.tsx +++ b/apps/wallet/src/ui/app/pages/home/tokens/ReceiveTokensDialog.tsx @@ -10,7 +10,7 @@ import { useIotaLedgerClient } from '_src/ui/app/components'; import { isLedgerAccountSerializedUI, type LedgerAccountSerializedUI, -} from '_src/background/accounts/LedgerAccount'; +} from '_src/background/accounts/ledgerAccount'; import { useActiveAccount } from '_src/ui/app/hooks/useActiveAccount'; interface ReceiveTokensDialogProps { diff --git a/apps/wallet/src/ui/app/pages/site-connect/index.tsx b/apps/wallet/src/ui/app/pages/site-connect/index.tsx index fa8738150af..4ee8cd1ee4f 100644 --- a/apps/wallet/src/ui/app/pages/site-connect/index.tsx +++ b/apps/wallet/src/ui/app/pages/site-connect/index.tsx @@ -10,9 +10,9 @@ import { UserApproveContainer, } from '_components'; import { useAppDispatch, useAppSelector } from '_hooks'; -import type { RootState } from '_redux/RootReducer'; +import type { RootState } from '_src/ui/app/redux/rootReducer'; import { permissionsSelectors, respondToPermissionRequest } from '_redux/slices/permissions'; -import { type SerializedUIAccount } from '_src/background/accounts/Account'; +import { type SerializedUIAccount } from '_src/background/accounts/account'; import { ampli } from '_src/shared/analytics/ampli'; import { useCallback, useEffect, useMemo, useState } from 'react'; import { useParams } from 'react-router-dom'; diff --git a/apps/wallet/src/ui/app/redux/RootReducer.ts b/apps/wallet/src/ui/app/redux/rootReducer.ts similarity index 100% rename from apps/wallet/src/ui/app/redux/RootReducer.ts rename to apps/wallet/src/ui/app/redux/rootReducer.ts diff --git a/apps/wallet/src/ui/app/redux/slices/app/AppType.ts b/apps/wallet/src/ui/app/redux/slices/app/appType.ts similarity index 100% rename from apps/wallet/src/ui/app/redux/slices/app/AppType.ts rename to apps/wallet/src/ui/app/redux/slices/app/appType.ts diff --git a/apps/wallet/src/ui/app/redux/slices/app/index.ts b/apps/wallet/src/ui/app/redux/slices/app/index.ts index 35600347357..0a6189c6ada 100644 --- a/apps/wallet/src/ui/app/redux/slices/app/index.ts +++ b/apps/wallet/src/ui/app/redux/slices/app/index.ts @@ -2,15 +2,15 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { walletApiProvider } from '_app/ApiProvider'; -import type { RootState } from '_redux/RootReducer'; +import { walletApiProvider } from '_src/ui/app/apiProvider'; +import type { RootState } from '_src/ui/app/redux/rootReducer'; import type { NetworkEnvType } from '@iota/core'; -import type { AppThunkConfig } from '_store/thunk-extras'; +import type { AppThunkConfig } from '_src/ui/app/redux/store/thunkExtras'; import { getDefaultNetwork, type Network } from '@iota/iota-sdk/client'; import { createAsyncThunk, createSlice } from '@reduxjs/toolkit'; import type { PayloadAction } from '@reduxjs/toolkit'; -import { AppType } from './AppType'; +import { AppType } from './appType'; type AppState = { appType: AppType; diff --git a/apps/wallet/src/ui/app/redux/slices/iota-objects/Coin.ts b/apps/wallet/src/ui/app/redux/slices/iota-objects/coin.ts similarity index 96% rename from apps/wallet/src/ui/app/redux/slices/iota-objects/Coin.ts rename to apps/wallet/src/ui/app/redux/slices/iota-objects/coin.ts index d624c690069..267b4f573ee 100644 --- a/apps/wallet/src/ui/app/redux/slices/iota-objects/Coin.ts +++ b/apps/wallet/src/ui/app/redux/slices/iota-objects/coin.ts @@ -4,7 +4,7 @@ import type { IotaMoveObject, IotaObjectData } from '@iota/iota-sdk/client'; -const COIN_TYPE = '0x2::coin::Coin'; +export const COIN_TYPE = '0x2::coin::Coin'; const COIN_TYPE_ARG_REGEX = /^0x2::coin::Coin<(.+)>$/; export const IOTA_BIP44_COIN_TYPE = 4218; diff --git a/apps/wallet/src/ui/app/redux/slices/permissions/index.ts b/apps/wallet/src/ui/app/redux/slices/permissions/index.ts index 4912cd8720b..349d54bd8bf 100644 --- a/apps/wallet/src/ui/app/redux/slices/permissions/index.ts +++ b/apps/wallet/src/ui/app/redux/slices/permissions/index.ts @@ -3,8 +3,8 @@ // SPDX-License-Identifier: Apache-2.0 import type { Permission } from '_messages/payloads/permissions'; -import type { RootState } from '_redux/RootReducer'; -import type { AppThunkConfig } from '_store/thunk-extras'; +import type { RootState } from '_src/ui/app/redux/rootReducer'; +import type { AppThunkConfig } from '_src/ui/app/redux/store/thunkExtras'; import { createAsyncThunk, createEntityAdapter, diff --git a/apps/wallet/src/ui/app/redux/slices/transaction-requests/index.ts b/apps/wallet/src/ui/app/redux/slices/transaction-requests/index.ts index 3b5e0ee7fdc..7c7d1ca8b6e 100644 --- a/apps/wallet/src/ui/app/redux/slices/transaction-requests/index.ts +++ b/apps/wallet/src/ui/app/redux/slices/transaction-requests/index.ts @@ -2,15 +2,15 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import type { ApprovalRequest } from '_payloads/transactions/ApprovalRequest'; -import type { RootState } from '_redux/RootReducer'; +import type { ApprovalRequest } from '_src/shared/messaging/messages/payloads/transactions/approvalRequest'; +import type { RootState } from '_src/ui/app/redux/rootReducer'; import { getSignerOperationErrorMessage } from '_src/ui/app/helpers/errorMessages'; import { type SignedMessage, type SignedTransaction, type WalletSigner, -} from '_src/ui/app/WalletSigner'; -import type { AppThunkConfig } from '_store/thunk-extras'; +} from '_src/ui/app/walletSigner'; +import type { AppThunkConfig } from '_src/ui/app/redux/store/thunkExtras'; import { type IotaTransactionBlockResponse } from '@iota/iota-sdk/client'; import { Transaction } from '@iota/iota-sdk/transactions'; import { fromB64 } from '@iota/iota-sdk/utils'; diff --git a/apps/wallet/src/ui/app/redux/store/index.ts b/apps/wallet/src/ui/app/redux/store/index.ts index 3e5d2305941..e21ef95d800 100644 --- a/apps/wallet/src/ui/app/redux/store/index.ts +++ b/apps/wallet/src/ui/app/redux/store/index.ts @@ -2,10 +2,10 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import rootReducer from '_redux/RootReducer'; +import rootReducer from '_src/ui/app/redux/rootReducer'; import { configureStore } from '@reduxjs/toolkit'; -import { thunkExtras } from './thunk-extras'; +import { thunkExtras } from './thunkExtras'; const store = configureStore({ reducer: rootReducer, diff --git a/apps/wallet/src/ui/app/redux/store/thunk-extras.ts b/apps/wallet/src/ui/app/redux/store/thunkExtras.ts similarity index 77% rename from apps/wallet/src/ui/app/redux/store/thunk-extras.ts rename to apps/wallet/src/ui/app/redux/store/thunkExtras.ts index 583943762f3..3e7becadb78 100644 --- a/apps/wallet/src/ui/app/redux/store/thunk-extras.ts +++ b/apps/wallet/src/ui/app/redux/store/thunkExtras.ts @@ -3,8 +3,8 @@ // SPDX-License-Identifier: Apache-2.0 import { BackgroundClient } from '_app/background-client'; -import { growthbook } from '_app/experimentation/feature-gating'; -import type { RootState } from '_redux/RootReducer'; +import { growthbook } from '_src/ui/app/experimentation/featureGating'; +import type { RootState } from '_src/ui/app/redux/rootReducer'; import type { AppDispatch } from '_store'; export const thunkExtras = { diff --git a/apps/wallet/src/ui/app/shared/dapp-status/actions/index.ts b/apps/wallet/src/ui/app/shared/dapp-status/actions/index.ts index 17015037fb0..81e6989d859 100644 --- a/apps/wallet/src/ui/app/shared/dapp-status/actions/index.ts +++ b/apps/wallet/src/ui/app/shared/dapp-status/actions/index.ts @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import type { AppThunkConfig } from '_redux/store/thunk-extras'; +import type { AppThunkConfig } from '_src/ui/app/redux/store/thunkExtras'; import { createAsyncThunk } from '@reduxjs/toolkit'; export const appDisconnect = createAsyncThunk< diff --git a/apps/wallet/src/ui/app/shared/page-main-layout/PageMainLayout.tsx b/apps/wallet/src/ui/app/shared/page-main-layout/PageMainLayout.tsx index 28be9deb7e8..36ab5368c10 100644 --- a/apps/wallet/src/ui/app/shared/page-main-layout/PageMainLayout.tsx +++ b/apps/wallet/src/ui/app/shared/page-main-layout/PageMainLayout.tsx @@ -6,15 +6,15 @@ import { ErrorBoundary, MenuContent, Navigation, WalletSettingsButton } from '_c import cn from 'clsx'; import { createContext, type ReactNode, useState } from 'react'; import { useAppSelector } from '../../hooks'; -import { AppType } from '../../redux/slices/app/AppType'; +import { AppType } from '../../redux/slices/app/appType'; import { DappStatus } from '../dapp-status'; import { Header } from '../header/Header'; import { Toaster } from '../toaster'; import { IotaLogoMark, Ledger } from '@iota/ui-icons'; import { useActiveAccount } from '../../hooks/useActiveAccount'; import { Link } from 'react-router-dom'; -import { isLedgerAccountSerializedUI } from '_src/background/accounts/LedgerAccount'; -import { type SerializedUIAccount } from '_src/background/accounts/Account'; +import { isLedgerAccountSerializedUI } from '_src/background/accounts/ledgerAccount'; +import { type SerializedUIAccount } from '_src/background/accounts/account'; import { formatAccountName } from '../../helpers'; export const PageMainLayoutContext = createContext<HTMLDivElement | null>(null); diff --git a/apps/wallet/src/ui/app/staking/stake/StakingCard.tsx b/apps/wallet/src/ui/app/staking/stake/StakingCard.tsx index 0b1174941f3..b28f0bbb38b 100644 --- a/apps/wallet/src/ui/app/staking/stake/StakingCard.tsx +++ b/apps/wallet/src/ui/app/staking/stake/StakingCard.tsx @@ -3,7 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 import { Loading } from '_components'; -import { Coin } from '_redux/slices/iota-objects/Coin'; +import { Coin } from '_src/ui/app/redux/slices/iota-objects/coin'; import { ampli } from '_src/shared/analytics/ampli'; import { createStakeTransaction, diff --git a/apps/wallet/src/ui/app/WalletSigner.ts b/apps/wallet/src/ui/app/walletSigner.ts similarity index 100% rename from apps/wallet/src/ui/app/WalletSigner.ts rename to apps/wallet/src/ui/app/walletSigner.ts diff --git a/apps/wallet/src/ui/index.tsx b/apps/wallet/src/ui/index.tsx index 90c43f75e57..aea104119c2 100644 --- a/apps/wallet/src/ui/index.tsx +++ b/apps/wallet/src/ui/index.tsx @@ -7,12 +7,12 @@ import '@fontsource-variable/red-hat-mono'; import { ErrorBoundary } from '_components'; import { initAppType } from '_redux/slices/app'; -import { AppType, getFromLocationSearch } from '_redux/slices/app/AppType'; +import { AppType, getFromLocationSearch } from '_src/ui/app/redux/slices/app/appType'; import { initAmplitude } from '_src/shared/analytics/amplitude'; import { setAttributes } from '_src/shared/experimentation/features'; import initSentry from '_src/ui/app/helpers/sentry'; import store from '_store'; -import { thunkExtras } from '_store/thunk-extras'; +import { thunkExtras } from '_src/ui/app/redux/store/thunkExtras'; import { KioskClientProvider, ThemeProvider } from '@iota/core'; import { GrowthBookProvider } from '@growthbook/growthbook-react'; import { IotaClientProvider } from '@iota/dapp-kit'; @@ -23,11 +23,11 @@ import { createRoot } from 'react-dom/client'; import { Provider } from 'react-redux'; import { HashRouter } from 'react-router-dom'; import { App } from './app'; -import { walletApiProvider } from './app/ApiProvider'; +import { walletApiProvider } from './app/apiProvider'; import { AccountsFormProvider } from './app/components/accounts/AccountsFormContext'; import { UnlockAccountProvider } from './app/components/accounts/UnlockAccountContext'; import { IotaLedgerClientProvider } from './app/components/ledger/IotaLedgerClientProvider'; -import { growthbook } from './app/experimentation/feature-gating'; +import { growthbook } from './app/experimentation/featureGating'; import { persister, queryClient } from './app/helpers/queryClient'; import { useAppSelector } from './app/hooks'; diff --git a/apps/wallet/tailwind.config.ts b/apps/wallet/tailwind.config.ts index 088b09b22c6..e837e56436f 100644 --- a/apps/wallet/tailwind.config.ts +++ b/apps/wallet/tailwind.config.ts @@ -5,7 +5,7 @@ import { type Config } from 'tailwindcss'; import animatePlugin from 'tailwindcss-animate'; // Note: exception for the tailwind preset import -import uiKitStaticPreset from '../../apps/ui-kit/src/lib/tailwind/static.preset'; +import uiKitStaticPreset from '../../apps/ui-kit/src/lib/tailwind/static.presets'; export default { presets: [uiKitStaticPreset], diff --git a/apps/wallet/tests/balanceChanges.spec.ts b/apps/wallet/tests/balance-changes.spec.ts similarity index 100% rename from apps/wallet/tests/balanceChanges.spec.ts rename to apps/wallet/tests/balance-changes.spec.ts diff --git a/apps/wallet/tests/demo-app/src/index.tsx b/apps/wallet/tests/demo-app/src/index.tsx index 8ee934abd37..09f32b3a042 100644 --- a/apps/wallet/tests/demo-app/src/index.tsx +++ b/apps/wallet/tests/demo-app/src/index.tsx @@ -2,7 +2,7 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import { type IotaWallet } from '_src/dapp-interface/WalletStandardInterface'; +import { type IotaWallet } from '_src/dapp-interface/walletStandardInterface'; import { Transaction } from '@iota/iota-sdk/transactions'; import { getWallets, ReadonlyWalletAccount, type Wallet } from '@iota/wallet-standard'; import { useEffect, useState } from 'react'; diff --git a/apps/wallet/tests/sites-to-cs-api.spec.ts b/apps/wallet/tests/sites-to-cs-api.spec.ts index 3ed5774e19f..b4e2ec028e5 100644 --- a/apps/wallet/tests/sites-to-cs-api.spec.ts +++ b/apps/wallet/tests/sites-to-cs-api.spec.ts @@ -5,7 +5,7 @@ import { type Page } from '@playwright/test'; import { expect, test } from './fixtures'; import { createWallet } from './utils/auth'; -import { demoDappConnect } from './utils/dapp-connect'; +import { demoDappConnect } from './utils/dappConnect'; import dotenv from 'dotenv'; dotenv.config(); diff --git a/apps/wallet/tests/sites-to-cs-messaging.spec.ts b/apps/wallet/tests/sites-to-cs-messaging.spec.ts index aac667175db..eca803c5263 100644 --- a/apps/wallet/tests/sites-to-cs-messaging.spec.ts +++ b/apps/wallet/tests/sites-to-cs-messaging.spec.ts @@ -5,7 +5,7 @@ import { type Page } from '@playwright/test'; import { expect, test } from './fixtures'; import { createWallet } from './utils/auth'; -import { demoDappConnect } from './utils/dapp-connect'; +import { demoDappConnect } from './utils/dappConnect'; import { generateWalletMessageStreamIdentifiers } from '../src/shared/utils/generateWalletMessageStreamIdentifiers'; import dotenv from 'dotenv'; diff --git a/apps/wallet/tests/utils/dapp-connect.ts b/apps/wallet/tests/utils/dappConnect.ts similarity index 100% rename from apps/wallet/tests/utils/dapp-connect.ts rename to apps/wallet/tests/utils/dappConnect.ts diff --git a/bridge/evm/contracts/utils/BridgeUtils.sol b/bridge/evm/contracts/utils/BridgeUtils.sol index 2b094549f6b..0d9f501a0d9 100644 --- a/bridge/evm/contracts/utils/BridgeUtils.sol +++ b/bridge/evm/contracts/utils/BridgeUtils.sol @@ -225,9 +225,9 @@ library BridgeUtils { // why `add(recipientAddressLength, offset)`? // At this point, offset = 35, recipientAddressLength = 20. `mload(add(payload, 55))` - // reads the next 32 bytes from bytes 23 in paylod, because the first 32 bytes + // reads the next 32 bytes from bytes 23 in payload, because the first 32 bytes // of payload stores its length. So in reality, bytes 23 - 54 is loaded. During - // casting to address (20 bytes), the least sigificiant bytes are retained, namely + // casting to address (20 bytes), the least significant bytes are retained, namely // `recipientAddress` is bytes 35-54 assembly { recipientAddress := mload(add(_payload, add(recipientAddressLength, offset))) @@ -245,9 +245,9 @@ library BridgeUtils { // Why `add(amountLength, offset)`? // At this point, offset = 56, amountLength = 8. `mload(add(payload, 64))` - // reads the next 32 bytes from bytes 32 in paylod, because the first 32 bytes + // reads the next 32 bytes from bytes 32 in payload, because the first 32 bytes // of payload stores its length. So in reality, bytes 32 - 63 is loaded. During - // casting to uint64 (8 bytes), the least sigificiant bytes are retained, namely + // casting to uint64 (8 bytes), the least significant bytes are retained, namely // `recipientAddress` is bytes 56-63 assembly { amount := mload(add(_payload, add(amountLength, offset))) diff --git a/crates/iota-analytics-indexer/src/lib.rs b/crates/iota-analytics-indexer/src/lib.rs index a2d4b25b894..eaef0cbd712 100644 --- a/crates/iota-analytics-indexer/src/lib.rs +++ b/crates/iota-analytics-indexer/src/lib.rs @@ -109,7 +109,7 @@ pub struct AnalyticsIndexerConfig { pub file_type: FileType, #[clap( long, - default_value = "https://checkpoints.mainnet.iota.io", + default_value = "https://checkpoints.mainnet.iota.cafe", global = true )] pub remote_store_url: String, diff --git a/crates/iota-cluster-test/src/cluster.rs b/crates/iota-cluster-test/src/cluster.rs index 3c1d993f992..edf61868092 100644 --- a/crates/iota-cluster-test/src/cluster.rs +++ b/crates/iota-cluster-test/src/cluster.rs @@ -34,16 +34,10 @@ use tracing::info; use super::config::{ClusterTestOpt, Env}; -const DEVNET_FAUCET_ADDR: &str = "https://faucet.devnet.iota.io:443"; -const STAGING_FAUCET_ADDR: &str = "https://faucet.staging.iota.io:443"; -const CONTINUOUS_FAUCET_ADDR: &str = "https://faucet.ci.iota.io:443"; -const CONTINUOUS_NOMAD_FAUCET_ADDR: &str = "https://faucet.nomad.ci.iota.io:443"; -const TESTNET_FAUCET_ADDR: &str = "https://faucet.testnet.iota.io:443"; -const DEVNET_FULLNODE_ADDR: &str = "https://rpc.devnet.iota.io:443"; -const STAGING_FULLNODE_ADDR: &str = "https://fullnode.staging.iota.io:443"; -const CONTINUOUS_FULLNODE_ADDR: &str = "https://fullnode.ci.iota.io:443"; -const CONTINUOUS_NOMAD_FULLNODE_ADDR: &str = "https://fullnode.nomad.ci.iota.io:443"; -const TESTNET_FULLNODE_ADDR: &str = "https://fullnode.testnet.iota.io:443"; +const DEVNET_FAUCET_ADDR: &str = "https://faucet.devnet.iota.cafe:443"; +const TESTNET_FAUCET_ADDR: &str = "https://faucet.testnet.iota.cafe:443"; +const DEVNET_FULLNODE_ADDR: &str = "https://api.devnet.iota.cafe:443"; +const TESTNET_FULLNODE_ADDR: &str = "https://api.testnet.iota.cafe:443"; pub struct ClusterFactory; @@ -94,18 +88,6 @@ impl Cluster for RemoteRunningCluster { String::from(DEVNET_FULLNODE_ADDR), String::from(DEVNET_FAUCET_ADDR), ), - Env::Staging => ( - String::from(STAGING_FULLNODE_ADDR), - String::from(STAGING_FAUCET_ADDR), - ), - Env::Ci => ( - String::from(CONTINUOUS_FULLNODE_ADDR), - String::from(CONTINUOUS_FAUCET_ADDR), - ), - Env::CiNomad => ( - String::from(CONTINUOUS_NOMAD_FULLNODE_ADDR), - String::from(CONTINUOUS_NOMAD_FAUCET_ADDR), - ), Env::Testnet => ( String::from(TESTNET_FULLNODE_ADDR), String::from(TESTNET_FAUCET_ADDR), diff --git a/crates/iota-cluster-test/src/config.rs b/crates/iota-cluster-test/src/config.rs index 85814590fab..29beab71456 100644 --- a/crates/iota-cluster-test/src/config.rs +++ b/crates/iota-cluster-test/src/config.rs @@ -11,9 +11,6 @@ use regex::Regex; #[derive(Parser, Clone, ValueEnum, Debug)] pub enum Env { Devnet, - Staging, - Ci, - CiNomad, Testnet, CustomRemote, NewLocal, diff --git a/crates/iota-config/src/lib.rs b/crates/iota-config/src/lib.rs index bdb16c8865f..b098549321a 100644 --- a/crates/iota-config/src/lib.rs +++ b/crates/iota-config/src/lib.rs @@ -35,7 +35,7 @@ pub const IOTA_KEYSTORE_ALIASES_FILENAME: &str = "iota.aliases"; pub const IOTA_BENCHMARK_GENESIS_GAS_KEYSTORE_FILENAME: &str = "benchmark.keystore"; pub const IOTA_GENESIS_FILENAME: &str = "genesis.blob"; pub const IOTA_GENESIS_MIGRATION_TX_DATA_FILENAME: &str = "migration.blob"; -pub const IOTA_DEV_NET_URL: &str = "https://fullnode.devnet.iota.io:443"; +pub const IOTA_DEV_NET_URL: &str = "https://api.devnet.iota.cafe:443"; pub const AUTHORITIES_DB_NAME: &str = "authorities_db"; pub const CONSENSUS_DB_NAME: &str = "consensus_db"; diff --git a/crates/iota-config/src/node.rs b/crates/iota-config/src/node.rs index a667163af7d..441daddea72 100644 --- a/crates/iota-config/src/node.rs +++ b/crates/iota-config/src/node.rs @@ -311,7 +311,7 @@ pub fn default_zklogin_oauth_providers() -> BTreeMap<Chain, BTreeSet<String>> { fn default_transaction_kv_store_config() -> TransactionKeyValueStoreReadConfig { TransactionKeyValueStoreReadConfig { - base_url: "https://transactions.iota.io/".to_string(), + base_url: "https://transactions.iota.cafe/".to_string(), } } diff --git a/crates/iota-config/src/p2p.rs b/crates/iota-config/src/p2p.rs index 58a43c224b0..21fa661c274 100644 --- a/crates/iota-config/src/p2p.rs +++ b/crates/iota-config/src/p2p.rs @@ -321,7 +321,7 @@ pub struct DiscoveryConfig { #[serde(skip_serializing_if = "Option::is_none")] pub access_type: Option<AccessType>, - /// Like `seed_peers` in `P2pConfig`, allowlisted peers will awlays be + /// Like `seed_peers` in `P2pConfig`, allowlisted peers will always be /// allowed to establish connection with this node regardless of the /// concurrency limit. Unlike `seed_peers`, a node does not reach out to /// `allowlisted_peers` preferentially. It is also used to determine if diff --git a/crates/iota-core/src/transaction_orchestrator.rs b/crates/iota-core/src/transaction_orchestrator.rs index 9aee380abea..cf6ef27c734 100644 --- a/crates/iota-core/src/transaction_orchestrator.rs +++ b/crates/iota-core/src/transaction_orchestrator.rs @@ -673,7 +673,7 @@ impl TransactionOrchestratorMetrics { ) .unwrap(), wait_for_finality_finished: register_int_counter_with_registry!( - "tx_orchestrator_wait_for_finality_fnished", + "tx_orchestrator_wait_for_finality_finished", "Total number of txns Transaction Orchestrator gets responses from Quorum Driver before timeout, either success or failure", registry, ) diff --git a/crates/iota-core/src/unit_tests/congestion_control_tests.rs b/crates/iota-core/src/unit_tests/congestion_control_tests.rs index 6dc1763f5b9..0141bd51582 100644 --- a/crates/iota-core/src/unit_tests/congestion_control_tests.rs +++ b/crates/iota-core/src/unit_tests/congestion_control_tests.rs @@ -206,7 +206,7 @@ impl TestSetup { } } -// Creates a transaction that touchs the shared objects `shared_object_1` and +// Creates a transaction that touches the shared objects `shared_object_1` and // `shared_object_2`, and `owned_object`, and executes the transaction in // `authority_state`. Returns the transaction and the effects of the execution. async fn update_objects( diff --git a/crates/iota-e2e-tests/tests/passkey_e2e_tests.rs b/crates/iota-e2e-tests/tests/passkey_e2e_tests.rs index 82c9c4a9d91..5a2053a136a 100644 --- a/crates/iota-e2e-tests/tests/passkey_e2e_tests.rs +++ b/crates/iota-e2e-tests/tests/passkey_e2e_tests.rs @@ -97,7 +97,7 @@ async fn create_credential_and_sign_test_tx( let store: Option<Passkey> = None; let my_authenticator = Authenticator::new(my_aaguid, store, user_validation_method); let mut my_client = Client::new(my_authenticator); - let origin = Url::parse("https://www.iota.io").unwrap(); + let origin = Url::parse("https://www.iota.org").unwrap(); // Create credential. let challenge_bytes_from_rp: Bytes = random_vec(32).into(); diff --git a/crates/iota-indexer/README.md b/crates/iota-indexer/README.md index b7126faad67..cfecc4b92b9 100644 --- a/crates/iota-indexer/README.md +++ b/crates/iota-indexer/README.md @@ -63,13 +63,13 @@ To run the indexer as a standalone service with an existing fullnode, follow the ```sh # Change the RPC_CLIENT_URL to http://0.0.0.0:9000 to run indexer against local validator & fullnode -cargo run --bin iota-indexer -- --db-url "postgres://postgres:postgrespw@localhost/iota_indexer" --rpc-client-url "https://fullnode.devnet.iota.io:443" --fullnode-sync-worker --reset-db +cargo run --bin iota-indexer -- --db-url "postgres://postgres:postgrespw@localhost/iota_indexer" --rpc-client-url "https://api.devnet.iota.cafe:443" --fullnode-sync-worker --reset-db ``` - to run indexer as a reader which exposes a JSON RPC service with following [APIs](https://docs.iota.org/iota-api-ref). ``` -cargo run --bin iota-indexer -- --db-url "postgres://postgres:postgrespw@localhost/iota_indexer" --rpc-client-url "https://fullnode.devnet.iota.io:443" --rpc-server-worker +cargo run --bin iota-indexer -- --db-url "postgres://postgres:postgrespw@localhost/iota_indexer" --rpc-client-url "https://api.devnet.iota.cafe:443" --rpc-server-worker ``` More available flags can be found in this [file](https://github.com/iotaledger/iota/blob/develop/crates/iota-indexer/src/lib.rs). @@ -171,5 +171,5 @@ Note that you need an existing database for this to work. Using the DATABASE_URL ```sh # Change the RPC_CLIENT_URL to http://0.0.0.0:9000 to run indexer against local validator & fullnode -cargo run --bin iota-indexer --features mysql-feature --no-default-features -- --db-url "<DATABASE_URL>" --rpc-client-url "https://fullnode.devnet.iota.io:443" --fullnode-sync-worker --reset-db +cargo run --bin iota-indexer --features mysql-feature --no-default-features -- --db-url "<DATABASE_URL>" --rpc-client-url "https://api.devnet.iota.cafe:443" --fullnode-sync-worker --reset-db ``` diff --git a/crates/iota-indexer/src/lib.rs b/crates/iota-indexer/src/lib.rs index 4593d1b75f2..76d1696c44d 100644 --- a/crates/iota-indexer/src/lib.rs +++ b/crates/iota-indexer/src/lib.rs @@ -67,7 +67,7 @@ pub struct IndexerConfig { pub db_name: Option<String>, #[clap(long, default_value = "http://0.0.0.0:9000", global = true)] pub rpc_client_url: String, - #[clap(long, default_value = Some("https://checkpoints.mainnet.iota.io"), global = true)] + #[clap(long, default_value = Some("https://checkpoints.mainnet.iota.cafe"), global = true)] pub remote_store_url: Option<String>, #[clap(long, default_value = "0.0.0.0", global = true)] pub client_metric_host: String, @@ -149,7 +149,7 @@ impl Default for IndexerConfig { db_port: None, db_name: None, rpc_client_url: "http://127.0.0.1:9000".to_string(), - remote_store_url: Some("https://checkpoints.mainnet.iota.io".to_string()), + remote_store_url: Some("https://checkpoints.mainnet.iota.cafe".to_string()), client_metric_host: "0.0.0.0".to_string(), client_metric_port: 9184, rpc_server_url: "0.0.0.0".to_string(), diff --git a/crates/iota-indexer/src/models/large_objects.rs b/crates/iota-indexer/src/models/large_objects.rs index e5f179e1ba6..a386eb620a4 100644 --- a/crates/iota-indexer/src/models/large_objects.rs +++ b/crates/iota-indexer/src/models/large_objects.rs @@ -78,7 +78,8 @@ pub fn put_large_object_in_chunks<T: R2D2Connection + Send + 'static>( let offset = (chunk_num * chunk_size) as i64; tracing::trace!("Storing large-object chunk at offset {}", offset); // TODO: (to treat in a different issue): - // remove dangling chunks (either by using a transaction or by handlng manually) + // remove dangling chunks (either by using a transaction or by handling + // manually) // // additionally we could apply a backoff retry strategy transactional_blocking_with_retry!( diff --git a/crates/iota-json-rpc/src/lib.rs b/crates/iota-json-rpc/src/lib.rs index 4332692fac1..26db25d957a 100644 --- a/crates/iota-json-rpc/src/lib.rs +++ b/crates/iota-json-rpc/src/lib.rs @@ -70,8 +70,8 @@ pub struct JsonRpcServerBuilder { pub fn iota_rpc_doc(version: &str) -> Project { Project::new( version, - "Iota JSON-RPC", - "Iota JSON-RPC API for interaction with Iota Full node. Make RPC calls using https://fullnode.NETWORK.iota.io:443, where NETWORK is the network you want to use (testnet, devnet, mainnet). By default, local networks use port 9000.", + "IOTA JSON-RPC", + "IOTA JSON-RPC API for interaction with Iota Full node. Make RPC calls using https://api.NETWORK.iota.cafe:443, where NETWORK is the network you want to use (testnet, devnet, mainnet). By default, local networks use port 9000.", "IOTA Foundation", "https://iota.org", "info@iota.org", diff --git a/crates/iota-light-client/README.md b/crates/iota-light-client/README.md index 917a59a5213..4564de9edb5 100644 --- a/crates/iota-light-client/README.md +++ b/crates/iota-light-client/README.md @@ -23,7 +23,7 @@ The light client requires a config file and a directory to cache checkpoints, an The config file for the light client takes a URL for a full node, a directory (that must exist) and within the directory to name of the genesis blob for the Iota network. ``` -full_node_url: "http://ord-mnt-rpcbig-06.mainnet.iota.io:9000" +full_node_url: "https://api.testnet.iota.cafe:443" checkpoint_summary_dir: "checkpoints_dir" genesis_filename: "genesis.blob" ``` diff --git a/crates/iota-metric-checker/README.md b/crates/iota-metric-checker/README.md index 599b271d082..cc7d0e90947 100644 --- a/crates/iota-metric-checker/README.md +++ b/crates/iota-metric-checker/README.md @@ -5,7 +5,7 @@ The `iota-metric-checker` crate is used for querying prometheus metrics and vali ### Example Usage ``` -RUST_LOG=debug cargo run --package iota-metric-checker --bin iota-metric-checker -- --api-key xxxxxxxx --api-user xxxx_metrics --config checks.yaml --url https://xxxx.iota.io/prometheus +RUST_LOG=debug cargo run --package iota-metric-checker --bin iota-metric-checker -- --api-key xxxxxxxx --api-user xxxx_metrics --config checks.yaml --url https://xxxx.iota.cafe/prometheus ``` ### Example Config diff --git a/crates/iota-node/src/main.rs b/crates/iota-node/src/main.rs index b15ad961bfe..debd3a54968 100644 --- a/crates/iota-node/src/main.rs +++ b/crates/iota-node/src/main.rs @@ -81,7 +81,7 @@ fn main() { drop(metrics_rt); - info!("Iota Node version: {VERSION}"); + info!("IOTA Node version: {VERSION}"); info!( "Supported protocol versions: {:?}", config.supported_protocol_versions diff --git a/crates/iota-open-rpc/spec/openrpc.json b/crates/iota-open-rpc/spec/openrpc.json index 95f08307724..e87b68d3ced 100644 --- a/crates/iota-open-rpc/spec/openrpc.json +++ b/crates/iota-open-rpc/spec/openrpc.json @@ -1,8 +1,8 @@ { "openrpc": "1.2.6", "info": { - "title": "Iota JSON-RPC", - "description": "Iota JSON-RPC API for interaction with Iota Full node. Make RPC calls using https://fullnode.NETWORK.iota.io:443, where NETWORK is the network you want to use (testnet, devnet, mainnet). By default, local networks use port 9000.", + "title": "IOTA JSON-RPC", + "description": "IOTA JSON-RPC API for interaction with Iota Full node. Make RPC calls using https://api.NETWORK.iota.cafe:443, where NETWORK is the network you want to use (testnet, devnet, mainnet). By default, local networks use port 9000.", "contact": { "name": "IOTA Foundation", "url": "https://iota.org", diff --git a/crates/iota-replay/src/config.rs b/crates/iota-replay/src/config.rs index 8186b3c2f2b..ee5d74b64d2 100644 --- a/crates/iota-replay/src/config.rs +++ b/crates/iota-replay/src/config.rs @@ -122,7 +122,7 @@ impl Default for ReplayableNetworkConfigSet { name: "mainnet".to_string(), epoch_zero_start_timestamp: 0, epoch_zero_rgp: 0, - public_full_node: url_from_str("https://fullnode.mainnet.iota.io:443") + public_full_node: url_from_str("https://api.mainnet.iota.cafe") .expect("invalid socket address") .to_string(), }; diff --git a/crates/iota-rosetta/README.md b/crates/iota-rosetta/README.md index ae79306cb62..d5d9a86af67 100644 --- a/crates/iota-rosetta/README.md +++ b/crates/iota-rosetta/README.md @@ -1,4 +1,4 @@ -# Rosetta API for Iota +# Rosetta API for IOTA [Rosetta](https://www.rosetta-api.org/docs/welcome.html) is an open-source specification and set of tools for blockchain integration. Rosetta’s goal is to make blockchain integration simpler, faster, and more reliable than using a native @@ -6,7 +6,7 @@ integration. ## Overview -Iota-Rosetta is an implementation of the Rosetta API for the Iota network, the Iota-Rosetta server uses the Iota fullnode to +Iota-Rosetta is an implementation of the Rosetta API for the Iota network, the Iota-Rosetta server uses the IOTA fullnode to read and write transactions to the Iota network. ## Local network quick start @@ -15,12 +15,12 @@ read and write transactions to the Iota network. #### 0. Checkout and build Iota -Checkout the [Iota source code](https://github.com/iotaledger/iota) and compile using `cargo build --release`, the binaries will be located in `target/release` directory. +Checkout the [IOTA source code](https://github.com/iotaledger/iota) and compile using `cargo build --release`, the binaries will be located in `target/release` directory. #### 1. Genesis `./iota genesis -f` -The Iota genesis process will create configs and coins for testing, the config files are stored in `~/.iota/iota_config` by +The IOTA genesis process will create configs and coins for testing, the config files are stored in `~/.iota/iota_config` by default. #### 2. Start local network diff --git a/crates/iota-rpc-loadgen/src/payload/rpc_command_processor.rs b/crates/iota-rpc-loadgen/src/payload/rpc_command_processor.rs index 89814c720f6..8ad34e28cff 100644 --- a/crates/iota-rpc-loadgen/src/payload/rpc_command_processor.rs +++ b/crates/iota-rpc-loadgen/src/payload/rpc_command_processor.rs @@ -662,7 +662,7 @@ fn num_transactions_needed(num_coins: usize, new_coins_per_txn: usize) -> usize if num_coins == 1 { return 0; } - (num_coins + new_coins_per_txn - 1) / new_coins_per_txn + num_coins.div_ceil(new_coins_per_txn) } /// Calculate the split amounts for a given number of coins, amount per coin, diff --git a/crates/iota-sdk/README.md b/crates/iota-sdk/README.md index 9c98c127ceb..abe850783e3 100644 --- a/crates/iota-sdk/README.md +++ b/crates/iota-sdk/README.md @@ -19,13 +19,17 @@ use iota_sdk::IotaClientBuilder; #[tokio::main] async fn main() -> Result<(), anyhow::Error> { - // Iota testnet -- https://api.testnet.iota.cafe + // IOTA testnet -- https://api.testnet.iota.cafe let iota_testnet = IotaClientBuilder::default().build_testnet().await?; - println!("Iota testnet version: {}", iota_testnet.api_version()); + println!("IOTA testnet version: {}", iota_testnet.api_version()); - // Iota devnet -- https://api.devnet.iota.cafe + // IOTA devnet -- https://api.devnet.iota.cafe let iota_devnet = IotaClientBuilder::default().build_devnet().await?; - println!("Iota devnet version: {}", iota_devnet.api_version()); + println!("IOTA devnet version: {}", iota_devnet.api_version()); + + // IOTA mainnet -- https://api.mainnet.iota.cafe + let iota_mainnet = IotaClientBuilder::default().build_mainnet().await?; + println!("IOTA mainnet version: {}", iota_mainnet.api_version()); Ok(()) } @@ -145,9 +149,9 @@ See the programmable transactions [example](https://github.com/iotaledger/iota/b 1. [Connect to IOTA Devnet](https://docs.iota.org/developer/getting-started/connect). 1. [Make sure you have two addresses with gas](https://docs.iota.org/developer/getting-started/get-address) by using the `new-address` command to create new addresses: ```shell - iota client new-address ed25519 + iota client new-address --key-scheme ed25519 ``` - You must specify the key scheme, one of `ed25519` or `secp256k1` or `secp256r1`. + You can specify the key scheme, one of `ed25519` or `secp256k1` or `secp256r1`. You can skip this step if you are going to play with a friend. :) 1. [Request IOTA tokens](https://docs.iota.org/developer/getting-started/get-coins) for all addresses that will be used to join the game. diff --git a/crates/iota-sdk/examples/iota_client.rs b/crates/iota-sdk/examples/iota_client.rs index 80fca08fe8d..7412db59d71 100644 --- a/crates/iota-sdk/examples/iota_client.rs +++ b/crates/iota-sdk/examples/iota_client.rs @@ -28,14 +28,21 @@ async fn main() -> Result<(), anyhow::Error> { // IOTA devnet -- https://api.devnet.iota.cafe let devnet_client = IotaClientBuilder::default().build_devnet().await?; - println!("Iota devnet version: {}", devnet_client.api_version()); + println!("IOTA devnet version: {}", devnet_client.api_version()); // IOTA testnet -- https://api.testnet.iota.cafe let testnet_client = IotaClientBuilder::default().build_testnet().await?; println!("IOTA testnet version: {}", testnet_client.api_version()); - println!("{:?}", local_client.available_rpc_methods()); - println!("{:?}", local_client.available_subscriptions()); + // IOTA mainnet -- https://api.mainnet.iota.cafe + let mainnet_client = IotaClientBuilder::default().build_mainnet().await?; + println!("IOTA mainnet version: {}", mainnet_client.api_version()); + + println!("rpc methods: {:?}", testnet_client.available_rpc_methods()); + println!( + "available subscriptions: {:?}", + testnet_client.available_subscriptions() + ); Ok(()) } diff --git a/crates/iota-sdk/src/lib.rs b/crates/iota-sdk/src/lib.rs index bf2227e19ee..d872a02aac8 100644 --- a/crates/iota-sdk/src/lib.rs +++ b/crates/iota-sdk/src/lib.rs @@ -122,6 +122,7 @@ pub const IOTA_DEVNET_URL: &str = "https://api.devnet.iota.cafe"; pub const IOTA_DEVNET_GAS_URL: &str = "https://faucet.devnet.iota.cafe/v1/gas"; pub const IOTA_TESTNET_URL: &str = "https://api.testnet.iota.cafe"; pub const IOTA_TESTNET_GAS_URL: &str = "https://faucet.testnet.iota.cafe/v1/gas"; +pub const IOTA_MAINNET_URL: &str = "https://api.mainnet.iota.cafe"; /// Builder for creating an [IotaClient] for connecting to the Iota network. /// @@ -354,6 +355,28 @@ impl IotaClientBuilder { self.build(IOTA_TESTNET_URL).await } + /// Returns an [IotaClient] object that is ready to interact with the IOTA + /// mainnet. + /// + /// For connecting to a custom URI, use the `build` function instead. + /// + /// # Examples + /// + /// ```rust,no_run + /// use iota_sdk::IotaClientBuilder; + /// + /// #[tokio::main] + /// async fn main() -> Result<(), anyhow::Error> { + /// let iota = IotaClientBuilder::default().build_mainnet().await?; + /// + /// println!("{:?}", iota.api_version()); + /// Ok(()) + /// } + /// ``` + pub async fn build_mainnet(self) -> IotaRpcResult<IotaClient> { + self.build(IOTA_MAINNET_URL).await + } + /// Return the server information as a `ServerInfo` structure. /// /// Fails with an error if it cannot call the RPC discover. diff --git a/crates/iota-source-validation-service/src/lib.rs b/crates/iota-source-validation-service/src/lib.rs index e7ad95b1883..88b61406525 100644 --- a/crates/iota-source-validation-service/src/lib.rs +++ b/crates/iota-source-validation-service/src/lib.rs @@ -46,14 +46,14 @@ pub const HOST_PORT_ENV: &str = "HOST_PORT"; pub const IOTA_SOURCE_VALIDATION_VERSION_HEADER: &str = "x-iota-source-validation-version"; pub const IOTA_SOURCE_VALIDATION_VERSION: &str = "0.1"; -pub const MAINNET_URL: &str = "https://fullnode.mainnet.iota.io:443"; -pub const TESTNET_URL: &str = "https://fullnode.testnet.iota.io:443"; -pub const DEVNET_URL: &str = "https://fullnode.devnet.iota.io:443"; +pub const MAINNET_URL: &str = "https://api.mainnet.iota.cafe:443"; +pub const TESTNET_URL: &str = "https://api.testnet.iota.cafe:443"; +pub const DEVNET_URL: &str = "https://api.devnet.iota.cafe:443"; pub const LOCALNET_URL: &str = "http://127.0.0.1:9000"; -pub const MAINNET_WS_URL: &str = "wss://rpc.mainnet.iota.io:443"; -pub const TESTNET_WS_URL: &str = "wss://rpc.testnet.iota.io:443"; -pub const DEVNET_WS_URL: &str = "wss://rpc.devnet.iota.io:443"; +pub const MAINNET_WS_URL: &str = "wss://api.mainnet.iota.cafe:443"; +pub const TESTNET_WS_URL: &str = "wss://api.testnet.iota.cafe:443"; +pub const DEVNET_WS_URL: &str = "wss://api.devnet.iota.cafe:443"; pub const LOCALNET_WS_URL: &str = "ws://127.0.0.1:9000"; pub const WS_PING_INTERVAL: Duration = Duration::from_millis(20_000); diff --git a/crates/iota-storage/src/bin/http_kv_tool.rs b/crates/iota-storage/src/bin/http_kv_tool.rs index 10f3cf35330..ad312984070 100644 --- a/crates/iota-storage/src/bin/http_kv_tool.rs +++ b/crates/iota-storage/src/bin/http_kv_tool.rs @@ -24,8 +24,8 @@ use iota_types::{ #[derive(Parser)] #[command(rename_all = "kebab-case")] struct Options { - // default value of 'https://transactions.iota.io/' - #[arg(short, long, default_value = "https://transactions.iota.io/mainnet")] + // default value of 'https://transactions.iota.cafe/' + #[arg(short, long, default_value = "https://transactions.iota.cafe/mainnet")] base_url: String, #[arg(short, long)] diff --git a/crates/iota-storage/src/sharded_lru.rs b/crates/iota-storage/src/sharded_lru.rs index 3ad58f739bd..72167040ebc 100644 --- a/crates/iota-storage/src/sharded_lru.rs +++ b/crates/iota-storage/src/sharded_lru.rs @@ -27,7 +27,7 @@ where V: Send + Sync + Clone, { pub fn new(capacity: u64, num_shards: u64) -> Self { - let cap_per_shard = (capacity + num_shards - 1) / num_shards; + let cap_per_shard = capacity.div_ceil(num_shards); let hasher = RandomState::default(); Self { hasher, diff --git a/crates/iota-tool/Cargo.toml b/crates/iota-tool/Cargo.toml index 92e9e719bda..efc7fb672b7 100644 --- a/crates/iota-tool/Cargo.toml +++ b/crates/iota-tool/Cargo.toml @@ -9,7 +9,7 @@ publish = false [dependencies] # external dependencies anemo.workspace = true -anemo-cli = { git = "https://github.com/mystenlabs/anemo.git", rev = "dbb5a074c2d25660525ab5d36d65ff0cb8051949" } +anemo-cli = { git = "https://github.com/mystenlabs/anemo.git", rev = "e609f7697ed6169bf0760882a0b6c032a57e4f3b" } anyhow.workspace = true bcs.workspace = true clap.workspace = true diff --git a/crates/iota-tool/src/commands.rs b/crates/iota-tool/src/commands.rs index f0c8625a389..262e9f332f8 100644 --- a/crates/iota-tool/src/commands.rs +++ b/crates/iota-tool/src/commands.rs @@ -707,9 +707,9 @@ impl ToolCommand { let aws_endpoint = env::var("AWS_SNAPSHOT_ENDPOINT").ok().or_else(|| { if no_sign_request { if network == Chain::Mainnet { - Some("https://dbfiles.mainnet.iota.cafe/formal".to_string()) + Some("https://formal-snapshot.mainnet.iota.cafe".to_string()) } else if network == Chain::Testnet { - Some("https://dbfiles.testnet.iota.cafe/formal".to_string()) + Some("https://formal-snapshot.testnet.iota.cafe".to_string()) } else { None } @@ -778,8 +778,8 @@ impl ToolCommand { let archive_bucket = Some( env::var("FORMAL_SNAPSHOT_ARCHIVE_BUCKET").unwrap_or_else(|_| match network { - Chain::Mainnet => "iota-mainnet-archives".to_string(), - Chain::Testnet => "iota-testnet-archives".to_string(), + Chain::Mainnet => "iota-mainnet-archive".to_string(), + Chain::Testnet => "iota-testnet-archive".to_string(), Chain::Unknown => { panic!("Cannot generate default archive bucket for unknown network"); } @@ -940,9 +940,9 @@ impl ToolCommand { let snapshot_store_config = if no_sign_request { let aws_endpoint = env::var("AWS_SNAPSHOT_ENDPOINT").ok().or_else(|| { if network == Chain::Mainnet { - Some("https://dbfiles.mainnet.iota.cafe/snapshots".to_string()) + Some("https://rocksdb-snapshot.mainnet.iota.cafe".to_string()) } else if network == Chain::Testnet { - Some("https://dbfiles.testnet.iota.cafe/snapshots".to_string()) + Some("https://rocksdb-snapshot.testnet.iota.cafe".to_string()) } else { None } diff --git a/crates/iota-transaction-builder/src/utils.rs b/crates/iota-transaction-builder/src/utils.rs index 7ec19f44e56..f5e83dc710d 100644 --- a/crates/iota-transaction-builder/src/utils.rs +++ b/crates/iota-transaction-builder/src/utils.rs @@ -65,7 +65,7 @@ impl TransactionBuilder { } } Err(anyhow!( - "Cannot find gas coin for signer address {signer} with amount sufficient for the required gas budget {gas_budget}. If you are using the pay or transfer commands, you can use pay-iota or transfer-iota commands instead, which will use the only object as gas payment." + "Cannot find gas coin for signer address {signer} with amount sufficient for the required gas budget {gas_budget}. If you are using the pay or transfer commands, you can use the pay-iota command instead, which will use the only object as gas payment." )) } } diff --git a/crates/iota-types/src/unit_tests/passkey_authenticator_test.rs b/crates/iota-types/src/unit_tests/passkey_authenticator_test.rs index 41645f17c22..ee900ade7a4 100644 --- a/crates/iota-types/src/unit_tests/passkey_authenticator_test.rs +++ b/crates/iota-types/src/unit_tests/passkey_authenticator_test.rs @@ -206,7 +206,7 @@ fn make_credential_creation_option(origin: &Url) -> CredentialCreationOptions { #[tokio::test] async fn test_passkey_serde() { - let origin = Url::parse("https://www.iota.io").unwrap(); + let origin = Url::parse("https://www.iota.org").unwrap(); let request = make_credential_creation_option(&origin); let response = create_credential_and_sign_test_tx(&origin, request).await; @@ -231,7 +231,7 @@ async fn test_passkey_serde() { #[tokio::test] async fn test_passkey_authenticator() { - let origin = Url::parse("https://www.iota.io").unwrap(); + let origin = Url::parse("https://www.iota.org").unwrap(); let request = make_credential_creation_option(&origin); let response = create_credential_and_sign_test_tx(&origin, request).await; @@ -256,7 +256,7 @@ async fn test_passkey_authenticator() { #[tokio::test] async fn test_passkey_fails_invalid_json() { - let origin = Url::parse("https://www.iota.io").unwrap(); + let origin = Url::parse("https://www.iota.org").unwrap(); let request = make_credential_creation_option(&origin); let response = create_credential_and_sign_test_tx(&origin, request).await; let client_data_json_missing_type = r#"{"challenge":"9-fH7nX8Nb1JvUynz77mv1kXOkGkg1msZb2qhvZssGI","origin":"http://localhost:5173","crossOrigin":false}"#; @@ -310,7 +310,7 @@ async fn test_passkey_fails_invalid_json() { #[tokio::test] async fn test_passkey_fails_invalid_challenge() { - let origin = Url::parse("https://www.iota.io").unwrap(); + let origin = Url::parse("https://www.iota.org").unwrap(); let request = make_credential_creation_option(&origin); let response = create_credential_and_sign_test_tx(&origin, request).await; let fake_client_data_json = r#"{"type":"webauthn.get","challenge":"wrong_base64_encoding","origin":"http://localhost:5173","crossOrigin":false}"#; @@ -328,7 +328,7 @@ async fn test_passkey_fails_invalid_challenge() { #[tokio::test] async fn test_passkey_fails_wrong_client_data_type() { - let origin = Url::parse("https://www.iota.io").unwrap(); + let origin = Url::parse("https://www.iota.org").unwrap(); let request = make_credential_creation_option(&origin); let response = create_credential_and_sign_test_tx(&origin, request).await; let fake_client_data_json = r#"{"type":"webauthn.create","challenge":"9-fH7nX8Nb1JvUynz77mv1kXOkGkg1msZb2qhvZssGI","origin":"http://localhost:5173","crossOrigin":false}"#; diff --git a/crates/iota/src/client_commands.rs b/crates/iota/src/client_commands.rs index 04a78ce9dfc..e5144a69d31 100644 --- a/crates/iota/src/client_commands.rs +++ b/crates/iota/src/client_commands.rs @@ -161,7 +161,6 @@ pub enum IotaClientCommands { /// not in production environments. #[clap(hide = true)] gas_price: Option<u64>, - #[clap(flatten)] opts: OptsWithGas, }, @@ -191,7 +190,6 @@ pub enum IotaClientCommands { /// using --serialize-unsigned-transaction. #[clap(long)] tx_bytes: String, - /// A list of Base64 encoded signatures `flag || signature || pubkey`. #[clap(long)] signatures: Vec<String>, @@ -236,18 +234,23 @@ pub enum IotaClientCommands { #[clap(flatten)] opts: OptsWithGas, }, - /// Generate new address and keypair with keypair scheme flag {ed25519 | - /// secp256k1 | secp256r1} with optional derivation path, default to - /// m/44'/4218'/0'/0'/0' for ed25519 or m/54'/4218'/0'/0/0 for secp256k1 - /// or m/74'/4218'/0'/0/0 for secp256r1. Word length can be { word12 | - /// word15 | word18 | word21 | word24} default to word12 if not specified. + /// Generate new address and keypair with optional key scheme {ed25519 | + /// secp256k1 | secp256r1} which defaults to ed25519, optional alias which + /// defaults to a random one, optional word length { word12 | word15 | + /// word18 | word21 | word24} which defaults to word12, and optional + /// derivation path which defaults to m/44'/4218'/0'/0'/0' for ed25519, + /// m/54'/4218'/0'/0/0 for secp256k1 or m/74'/4218'/0'/0/0 for secp256r1. #[clap(name = "new-address")] NewAddress { + #[clap(long, default_value_t = SignatureScheme::ED25519)] key_scheme: SignatureScheme, /// The alias must start with a letter and can contain only letters, /// digits, hyphens (-), or underscores (_). + #[clap(long)] alias: Option<String>, + #[clap(long)] word_length: Option<String>, + #[clap(long)] derivation_path: Option<DerivationPath>, }, /// Add new IOTA environment. @@ -274,7 +277,6 @@ pub enum IotaClientCommands { /// Object ID of the object to fetch #[clap(name = "object_id")] id: ObjectID, - /// Return the bcs serialized version of the object #[clap(long)] bcs: bool, @@ -296,16 +298,13 @@ pub enum IotaClientCommands { /// specified amounts. #[clap(long, num_args(1..))] input_coins: Vec<ObjectID>, - /// The recipient addresses, must be of same length as amounts. /// Aliases of addresses are also accepted as input. #[clap(long, num_args(1..))] recipients: Vec<KeyIdentity>, - /// The amounts to be paid, following the order of recipients. #[clap(long, num_args(1..))] amounts: Vec<u64>, - #[clap(flatten)] opts: OptsWithGas, }, @@ -317,12 +316,10 @@ pub enum IotaClientCommands { /// coin. #[clap(long, num_args(1..))] input_coins: Vec<ObjectID>, - /// The recipient address (or its alias if it's an address in the /// keystore). #[clap(long)] recipient: KeyIdentity, - #[clap(flatten)] opts: Opts, }, @@ -335,16 +332,13 @@ pub enum IotaClientCommands { /// coin. #[clap(long, num_args(1..))] input_coins: Vec<ObjectID>, - /// The recipient addresses, must be of same length as amounts. /// Aliases of addresses are also accepted as input. #[clap(long, num_args(1..))] recipients: Vec<KeyIdentity>, - /// The amounts to be paid, following the order of recipients. #[clap(long, num_args(1..))] amounts: Vec<u64>, - #[clap(flatten)] opts: Opts, }, @@ -357,20 +351,16 @@ pub enum IotaClientCommands { /// Path to directory containing a Move package #[clap(name = "package_path", global = true, default_value = ".")] package_path: PathBuf, - /// Package build options #[clap(flatten)] build_config: MoveBuildConfig, - #[clap(flatten)] opts: OptsWithGas, - /// Publish the package without checking whether compiling dependencies /// from source results in bytecode matching the dependencies /// found on-chain. #[clap(long)] skip_dependency_verification: bool, - /// Also publish transitive dependencies that have not already been /// published. #[clap(long)] @@ -417,59 +407,31 @@ pub enum IotaClientCommands { /// Recipient address (or its alias if it's an address in the keystore) #[clap(long)] to: KeyIdentity, - /// ID of the object to transfer #[clap(long)] object_id: ObjectID, - #[clap(flatten)] opts: OptsWithGas, }, - /// Transfer IOTA, and pay gas with the same IOTA coin object. - /// If amount is specified, only the amount is transferred; otherwise the - /// entire object is transferred. - #[clap(name = "transfer-iota")] - TransferIota { - /// Recipient address (or its alias if it's an address in the keystore) - #[clap(long)] - to: KeyIdentity, - - /// ID of the coin to transfer. This is also the gas object. - #[clap(long)] - iota_coin_object_id: ObjectID, - - /// The amount to transfer, if not specified, the entire coin object - /// will be transferred. - #[clap(long)] - amount: Option<u64>, - - #[clap(flatten)] - opts: Opts, - }, /// Upgrade Move modules #[clap(name = "upgrade")] Upgrade { /// Path to directory containing a Move package #[clap(name = "package_path", global = true, default_value = ".")] package_path: PathBuf, - /// ID of the upgrade capability for the package being upgraded. #[clap(long)] upgrade_capability: ObjectID, - /// Package build options #[clap(flatten)] build_config: MoveBuildConfig, - #[clap(flatten)] opts: OptsWithGas, - /// Publish the package without checking whether compiling dependencies /// from source results in bytecode matching the dependencies /// found on-chain. #[clap(long)] skip_dependency_verification: bool, - /// Also publish transitive dependencies that have not already been /// published. #[clap(long)] @@ -482,19 +444,16 @@ pub enum IotaClientCommands { /// current directory) #[clap(name = "package", long, global = true)] package_path: Option<PathBuf>, - /// Protocol version to use for the bytecode verifier (defaults to the /// latest protocol version) #[clap(name = "protocol-version", long)] protocol_version: Option<u64>, - /// Paths to specific pre-compiled module bytecode to verify (instead of /// an entire package). Multiple modules can be verified by /// passing multiple --module flags. They will be treated as if /// they were one package (subject to the overall package limit). #[clap(name = "module", long, action = clap::ArgAction::Append, global = true)] module_paths: Vec<PathBuf>, - /// Package build options #[clap(flatten)] build_config: MoveBuildConfig, @@ -506,19 +465,15 @@ pub enum IotaClientCommands { /// Path to directory containing a Move package #[clap(name = "package_path", global = true, default_value = ".")] package_path: PathBuf, - /// Package build options #[clap(flatten)] build_config: MoveBuildConfig, - /// Verify on-chain dependencies. #[clap(long)] verify_deps: bool, - /// Don't verify source (only valid if --verify-deps is enabled). #[clap(long)] skip_source: bool, - /// If specified, override the addresses for the package's own modules /// with this address. Only works for unpublished modules (whose /// addresses are currently 0x0). @@ -534,7 +489,6 @@ pub enum IotaClientCommands { /// The digest of the transaction to replay #[arg(long, short)] tx_digest: String, - /// If specified, overrides the filepath of the output profile, for /// example -- /temp/my_profile_name.json will write output to /// `/temp/my_profile_name_{tx_digest}_{unix_timestamp}.json` If @@ -551,20 +505,16 @@ pub enum IotaClientCommands { /// The digest of the transaction to replay #[arg(long, short)] tx_digest: String, - /// Log extra gas-related information #[arg(long)] gas_info: bool, - /// Log information about each programmable transaction command #[arg(long)] ptb_info: bool, - /// Optional version of the executor to use, if not specified defaults /// to the one originally used for the transaction. #[arg(long, short, allow_hyphen_values = true)] executor_version: Option<i64>, - /// Optional protocol version to use, if not specified defaults to the /// one originally used for the transaction. #[arg(long, short, allow_hyphen_values = true)] @@ -577,7 +527,6 @@ pub enum IotaClientCommands { /// digest per line #[arg(long, short)] path: PathBuf, - /// If an error is encountered during a transaction, this specifies /// whether to terminate or continue #[arg(long, short)] @@ -590,12 +539,10 @@ pub enum IotaClientCommands { /// to replay #[arg(long, short)] start: u64, - /// The ending checkpoint sequence number of the range of checkpoints to /// replay #[arg(long, short)] end: u64, - /// If an error is encountered during a transaction, this specifies /// whether to terminate or continue #[arg(long, short)] @@ -1293,29 +1240,6 @@ impl IotaClientCommands { ) .await? } - IotaClientCommands::TransferIota { - to, - iota_coin_object_id: object_id, - amount, - opts, - } => { - let signer = context.get_object_owner(&object_id).await?; - let to = get_identity_address(Some(to), context)?; - let client = context.get_client().await?; - let tx_kind = client - .transaction_builder() - .transfer_iota_tx_kind(to, amount); - dry_run_or_execute_or_serialize( - signer, - tx_kind, - context, - None, - None, - Some(object_id), - opts, - ) - .await? - } IotaClientCommands::Pay { input_coins, recipients, diff --git a/crates/iota/src/fire_drill.rs b/crates/iota/src/fire_drill.rs index 371ccc33407..787ca8d05e7 100644 --- a/crates/iota/src/fire_drill.rs +++ b/crates/iota/src/fire_drill.rs @@ -76,7 +76,7 @@ async fn run_metadata_rotation(metadata_rotation: MetadataRotation) -> anyhow::R let account_key = read_keypair_from_file(&account_key_path)?; let config: NodeConfig = PersistedConfig::read(&iota_node_config_path).map_err(|err| { err.context(format!( - "Cannot open Iota Node Config file at {:?}", + "Cannot open IOTA Node Config file at {:?}", iota_node_config_path )) })?; @@ -103,7 +103,7 @@ async fn run_metadata_rotation(metadata_rotation: MetadataRotation) -> anyhow::R // Replace new config std::fs::rename(new_config_path, iota_node_config_path)?; - info!("Updated Iota Node config."); + info!("Updated IOTA Node config."); Ok(()) } diff --git a/crates/iota/src/validator_commands.rs b/crates/iota/src/validator_commands.rs index 320cbae07ef..fedf9aed68f 100644 --- a/crates/iota/src/validator_commands.rs +++ b/crates/iota/src/validator_commands.rs @@ -1087,18 +1087,18 @@ pub async fn get_validator_summary( status = Some(ValidatorStatus::Active); Some(active_validators.remove(&validator_address).unwrap()) } else { - // Check panding validators + // Check pending validators get_pending_candidate_summary(validator_address, client, pending_active_validators_id) .await? .map(|v| v.into_iota_validator_summary()) .tap_some(|_s| status = Some(ValidatorStatus::Pending)) - // TODO also check candidate and inactive valdiators + // TODO also check candidate and inactive validators }; if validator_info.is_none() { return Ok(None); } - // status is safe unwrap because it has to be Some when the code recahes here + // status is safe unwrap because it has to be Some when the code reaches here // validator_info is safe to unwrap because of the above check Ok(Some((status.unwrap(), validator_info.unwrap()))) } diff --git a/crates/iota/tests/cli_tests.rs b/crates/iota/tests/cli_tests.rs index 05033ccc7fd..6a4ac04eeec 100644 --- a/crates/iota/tests/cli_tests.rs +++ b/crates/iota/tests/cli_tests.rs @@ -2976,10 +2976,10 @@ async fn test_serialize_tx() -> Result<(), anyhow::Error> { .data; let coin = object_refs.get(1).unwrap().object().unwrap().object_id; - IotaClientCommands::TransferIota { - to: KeyIdentity::Address(address1), - iota_coin_object_id: coin, - amount: Some(1), + IotaClientCommands::PayIota { + input_coins: vec![coin], + recipients: vec![KeyIdentity::Address(address1)], + amounts: vec![1], opts: Opts { gas_budget: Some(rgp * TEST_ONLY_GAS_UNIT_FOR_TRANSFER), dry_run: false, @@ -2991,10 +2991,10 @@ async fn test_serialize_tx() -> Result<(), anyhow::Error> { .execute(context) .await?; - IotaClientCommands::TransferIota { - to: KeyIdentity::Address(address1), - iota_coin_object_id: coin, - amount: Some(1), + IotaClientCommands::PayIota { + input_coins: vec![coin], + recipients: vec![KeyIdentity::Address(address1)], + amounts: vec![1], opts: Opts { gas_budget: Some(rgp * TEST_ONLY_GAS_UNIT_FOR_TRANSFER), dry_run: false, @@ -3007,10 +3007,10 @@ async fn test_serialize_tx() -> Result<(), anyhow::Error> { .await?; // use alias for transfer - IotaClientCommands::TransferIota { - to: KeyIdentity::Alias(alias1), - iota_coin_object_id: coin, - amount: Some(1), + IotaClientCommands::PayIota { + input_coins: vec![coin], + recipients: vec![KeyIdentity::Alias(alias1)], + amounts: vec![1], opts: Opts { gas_budget: Some(rgp * TEST_ONLY_GAS_UNIT_FOR_TRANSFER), dry_run: false, @@ -3354,18 +3354,6 @@ async fn test_dry_run() -> Result<(), anyhow::Error> { assert_dry_run(transfer_dry_run, object_id, "Transfer"); - // === TRANSFER IOTA === // - let transfer_iota_dry_run = IotaClientCommands::TransferIota { - to: KeyIdentity::Address(IotaAddress::random_for_testing_only()), - iota_coin_object_id: object_to_send, - amount: Some(1), - opts: Opts::for_testing_dry_run(rgp * TEST_ONLY_GAS_UNIT_FOR_TRANSFER), - } - .execute(context) - .await?; - - assert_dry_run(transfer_iota_dry_run, object_to_send, "TransferIota"); - // === PAY === // let pay_dry_run = IotaClientCommands::Pay { input_coins: vec![object_id], @@ -3753,99 +3741,6 @@ async fn test_transfer() -> Result<(), anyhow::Error> { Ok(()) } -#[sim_test] -async fn test_transfer_iota() -> Result<(), anyhow::Error> { - let (mut test_cluster, client, rgp, objects, recipients, addresses) = - test_cluster_helper().await; - let object_id1 = objects[0]; - let recipient1 = &recipients[0]; - let address2 = addresses[0]; - let context = &mut test_cluster.wallet; - let amount = 1000; - let transfer_iota = IotaClientCommands::TransferIota { - to: KeyIdentity::Address(address2), - iota_coin_object_id: object_id1, - amount: Some(amount), - opts: Opts::for_testing(rgp * TEST_ONLY_GAS_UNIT_FOR_TRANSFER), - } - .execute(context) - .await?; - - // transfer iota will transfer the amount from object_id1 to address2, and use - // the same object as gas, and we check if the recipient address received - // the object, and the expected balance is correct - if let IotaClientCommandResult::TransactionBlock(response) = transfer_iota { - assert!(response.status_ok().unwrap()); - assert_eq!( - response.effects.as_ref().unwrap().gas_object().object_id(), - object_id1 - ); - let objs_refs = client - .read_api() - .get_owned_objects( - address2, - Some(IotaObjectResponseQuery::new_with_options( - IotaObjectDataOptions::full_content(), - )), - None, - None, - ) - .await?; - assert!(!objs_refs.has_next_page); - assert_eq!(objs_refs.data.len(), 1); - let balance = client - .coin_read_api() - .get_balance(address2, None) - .await? - .total_balance; - assert_eq!(balance, amount as u128); - } else { - panic!("TransferIota test failed"); - } - // transfer the whole object by not passing an amount - let transfer_iota = IotaClientCommands::TransferIota { - to: recipient1.clone(), - iota_coin_object_id: object_id1, - amount: None, - opts: Opts::for_testing(rgp * TEST_ONLY_GAS_UNIT_FOR_TRANSFER), - } - .execute(context) - .await?; - if let IotaClientCommandResult::TransactionBlock(response) = transfer_iota { - assert!(response.status_ok().unwrap()); - assert_eq!( - response.effects.as_ref().unwrap().gas_object().object_id(), - object_id1 - ); - let objs_refs = client - .read_api() - .get_owned_objects( - address2, - Some(IotaObjectResponseQuery::new_with_options( - IotaObjectDataOptions::full_content(), - )), - None, - None, - ) - .await?; - assert!(!objs_refs.has_next_page); - assert_eq!( - objs_refs.data.len(), - 2, - "Expected to have two coins when calling transfer iota the 2nd time" - ); - assert!( - objs_refs - .data - .iter() - .any(|x| x.object().unwrap().object_id == object_id1) - ); - } else { - panic!("TransferIota test failed"); - } - Ok(()) -} - #[sim_test] async fn test_gas_estimation() -> Result<(), anyhow::Error> { let (mut test_cluster, client, rgp, objects, _, addresses) = test_cluster_helper().await; @@ -3859,10 +3754,10 @@ async fn test_gas_estimation() -> Result<(), anyhow::Error> { let gas_estimate = estimate_gas_budget(context, sender, tx_kind, rgp, None, None).await; assert!(gas_estimate.is_ok()); - let transfer_iota_cmd = IotaClientCommands::TransferIota { - to: KeyIdentity::Address(address2), - iota_coin_object_id: object_id1, - amount: Some(amount), + let pay_iota_cmd = IotaClientCommands::PayIota { + recipients: vec![KeyIdentity::Address(address2)], + input_coins: vec![object_id1], + amounts: vec![amount], opts: Opts { gas_budget: None, dry_run: false, @@ -3874,7 +3769,7 @@ async fn test_gas_estimation() -> Result<(), anyhow::Error> { .execute(context) .await .unwrap(); - if let IotaClientCommandResult::TransactionBlock(response) = transfer_iota_cmd { + if let IotaClientCommandResult::TransactionBlock(response) = pay_iota_cmd { assert!(response.status_ok().unwrap()); let gas_used = response.effects.as_ref().unwrap().gas_object().object_id(); assert_eq!(gas_used, object_id1); @@ -3888,7 +3783,7 @@ async fn test_gas_estimation() -> Result<(), anyhow::Error> { <= gas_estimate.unwrap() ); } else { - panic!("TransferIota test failed"); + panic!("PayIota failed in gas estimation test"); } Ok(()) } diff --git a/dapps/multisig-toolkit/src/routes/multisig-address.tsx b/dapps/multisig-toolkit/src/routes/multisig-address.tsx index 9d7759cdd19..8f5b4a66d93 100644 --- a/dapps/multisig-toolkit/src/routes/multisig-address.tsx +++ b/dapps/multisig-toolkit/src/routes/multisig-address.tsx @@ -137,7 +137,7 @@ export default function MultiSigAddressGenerator() { <CardHeader> <CardTitle>IOTA MultiSig Address</CardTitle> <CardDescription> - https://docs.iota.org/references/ts-sdk/typescript/cryptography/multisig + https://docs.iota.org/ts-sdk/typescript/cryptography/multisig </CardDescription> </CardHeader> <CardContent> diff --git a/docker/iota-node-deterministic/README.md b/docker/iota-node-deterministic/README.md index d3525f10f2e..079cb42cef1 100644 --- a/docker/iota-node-deterministic/README.md +++ b/docker/iota-node-deterministic/README.md @@ -1,4 +1,4 @@ -# Iota Node Deterministic Build +# IOTA Node Deterministic Build ## General Requirements diff --git a/docker/iota-rosetta-devnet/remote/docker-compose.yaml b/docker/iota-rosetta-devnet/remote/docker-compose.yaml index dd51a0352ea..37916a901e2 100644 --- a/docker/iota-rosetta-devnet/remote/docker-compose.yaml +++ b/docker/iota-rosetta-devnet/remote/docker-compose.yaml @@ -13,7 +13,7 @@ services: - -c - | /usr/local/bin/iota-rosetta generate-rosetta-cli-config --env devnet & - /usr/local/bin/iota-rosetta start-online-remote-server --env devnet --genesis-path genesis.blob --full-node-url https://fullnode.devnet.iota.io:443 + /usr/local/bin/iota-rosetta start-online-remote-server --env devnet --genesis-path genesis.blob --full-node-url https://api.devnet.iota.cafe:443 stdin_open: true tty: true rosetta-offline: diff --git a/docs/content/_snippets/info-high-traffic.mdx b/docs/content/_snippets/info-high-traffic.mdx index 734ea92ab9e..9604fa56a15 100644 --- a/docs/content/_snippets/info-high-traffic.mdx +++ b/docs/content/_snippets/info-high-traffic.mdx @@ -2,6 +2,6 @@ It is suggested to use dedicated nodes/shared services rather than public endpoints for production apps with high traffic volume. -You can either run your own Full nodes, or outsource this to a professional infrastructure provider (preferred for apps that have high traffic). +You can either run your own full nodes, or outsource this to a professional infrastructure provider (preferred for apps that have high traffic). ::: \ No newline at end of file diff --git a/docs/content/_snippets/initialize-iota-client-cli.mdx b/docs/content/_snippets/initialize-iota-client-cli.mdx index 1b621052b49..7a0375b7eef 100644 --- a/docs/content/_snippets/initialize-iota-client-cli.mdx +++ b/docs/content/_snippets/initialize-iota-client-cli.mdx @@ -7,13 +7,13 @@ See [Publish a Package](../developer/getting-started/publish.mdx) for a more det Before publishing your code, you must first initialize the IOTA Client CLI, if you haven't already. To do so, in a terminal or console at the root directory of the project enter `iota client`. If you receive the following response, complete the remaining instructions: ``` -Config file ["<FILE-PATH>/.iota/iota_config/client.yaml"] doesn't exist, do you want to connect to a IOTA Full node server [y/N]? +Config file ["<FILE-PATH>/.iota/iota_config/client.yaml"] doesn't exist, do you want to connect to a IOTA full node server [y/N]? ``` Enter `y` to proceed. You receive the following response: ``` -IOTA Full node server URL (Defaults to IOTA Devnet if not specified) : +IOTA full node server URL (Defaults to IOTA Devnet if not specified) : ``` Leave this blank (press Enter). You receive the following response: diff --git a/docs/content/_snippets/warning-advanced-instructions-node-setup.mdx b/docs/content/_snippets/warning-advanced-instructions-node-setup.mdx index cc42330d620..f3173ef9f33 100644 --- a/docs/content/_snippets/warning-advanced-instructions-node-setup.mdx +++ b/docs/content/_snippets/warning-advanced-instructions-node-setup.mdx @@ -1,6 +1,6 @@ :::warning Advanced -These instructions are for setting up a Full node for network participation. If you just need a local development environment, -you should instead follow the instructions in [Create a Local IOTA Network](/developer/getting-started/local-network) to create a local Full node, validators, and faucet. +These instructions are for setting up a full node for network participation. If you just need a local development environment, +you should instead follow the instructions in [Create a Local IOTA Network](/developer/getting-started/local-network) to create a local full node, validators, and faucet. ::: \ No newline at end of file diff --git a/docs/content/developer/advanced/create-review-rating-dao-with-multisig.mdx b/docs/content/developer/advanced/create-review-rating-dao-with-multisig.mdx index 34453c340e8..5d87995c99b 100644 --- a/docs/content/developer/advanced/create-review-rating-dao-with-multisig.mdx +++ b/docs/content/developer/advanced/create-review-rating-dao-with-multisig.mdx @@ -68,9 +68,9 @@ To implement multisig for moderators, follow these steps: Each moderator requires a unique key and corresponding IOTA address. To generate these keys and addresses, you can use any of the following key types: `ed25519`, `secp256k1`, or `secp256r1`. Use the following commands to create a key and address for each moderator: ```shell -iota client new-address ed25519 -iota client new-address secp256k1 -iota client new-address secp256r1 +iota client new-address --key-scheme ed25519 +iota client new-address --key-scheme secp256k1 +iota client new-address --key-scheme secp256r1 ``` ### 2. Add Keys to IOTA Keystore diff --git a/docs/content/developer/advanced/custom-indexer.mdx b/docs/content/developer/advanced/custom-indexer.mdx index e3605e52a6b..9e13ab11d4a 100644 --- a/docs/content/developer/advanced/custom-indexer.mdx +++ b/docs/content/developer/advanced/custom-indexer.mdx @@ -1,6 +1,6 @@ --- title: Custom Indexer -description: You can build custom indexers using the IOTA micro-data ingestion framework. To create an indexer, you subscribe to a checkpoint stream with full checkpoint content. Establishing a custom indexer helps improve latency, allows pruning the data of your IOTA Full node, and provides efficient assemblage of checkpoint data. +description: You can build custom indexers using the IOTA micro-data ingestion framework. To create an indexer, you subscribe to a checkpoint stream with full checkpoint content. Establishing a custom indexer helps improve latency, allows pruning the data of your IOTA full node, and provides efficient assemblage of checkpoint data. --- import Quiz from '@site/src/components/Quiz'; @@ -10,7 +10,7 @@ import CodeBlock from '@theme/CodeBlock'; You can build custom indexers using the IOTA micro-data ingestion framework. To create an indexer, you subscribe to a checkpoint stream with full checkpoint content. This stream can be one of the publicly available streams from IOTA, one that you set up in your local environment, or a combination of the two. -Establishing a custom indexer helps improve latency, allows pruning the data of your IOTA Full node, and provides efficient assemblage of checkpoint data. +Establishing a custom indexer helps improve latency, allows pruning the data of your IOTA full node, and provides efficient assemblage of checkpoint data. ## Interface and Data Format @@ -63,9 +63,9 @@ This is suitable for setups with a single ingestion pipeline where progress trac ### Local Reader -Colocate the data ingestion daemon with a Full node and enable checkpoint dumping on the latter to set up a local stream source. After enabling, the Full node starts dumping executed checkpoints as files to a local directory, and the data ingestion daemon subscribes to changes in the directory through an inotify-like mechanism. This approach allows minimizing ingestion latency (checkpoint are processed immediately after a checkpoint executor on a Full node) and getting rid of dependency on an externally managed bucket. +Colocate the data ingestion daemon with a full node and enable checkpoint dumping on the latter to set up a local stream source. After enabling, the full node starts dumping executed checkpoints as files to a local directory, and the data ingestion daemon subscribes to changes in the directory through an inotify-like mechanism. This approach allows minimizing ingestion latency (checkpoint are processed immediately after a checkpoint executor on a full node) and getting rid of dependency on an externally managed bucket. -To enable, add the following to your [Full node configuration](../../operator/iota-full-node/overview.mdx) file: +To enable, add the following to your [full node configuration](../../operator/iota-full-node/overview.mdx) file: ```yaml checkpoint-executor-config: @@ -108,7 +108,7 @@ The concurrency parameter specifies how many threads the workflow uses. Having a ### Hybrid Mode -Specify both a local and remote store as a fallback to ensure constant data flow. The framework always prioritizes locally available checkpoint data over remote data. It's useful when you want to start utilizing your own Full node for data ingestion but need to partially backfill historical data or just have a failover. +Specify both a local and remote store as a fallback to ensure constant data flow. The framework always prioritizes locally available checkpoint data over remote data. It's useful when you want to start utilizing your own full node for data ingestion but need to partially backfill historical data or just have a failover. ```rust executor.run( PathBuf::from("./chk".to_string()), // path to a local directory diff --git a/docs/content/developer/advanced/iota-repository.mdx b/docs/content/developer/advanced/iota-repository.mdx index c9ed46a047e..8bd6dbbf786 100644 --- a/docs/content/developer/advanced/iota-repository.mdx +++ b/docs/content/developer/advanced/iota-repository.mdx @@ -26,7 +26,7 @@ overview of the most important folders: IOTA. - [docker](https://github.com/iotaledger/iota/tree/develop/docker): Contains the docker files needed to spin up a node, an - indexer, a Full node, or other services. + indexer, a full node, or other services. - [docs](https://github.com/iotaledger/iota/tree/develop/docs): Contains this documentation and the source for this site. - [examples](https://github.com/iotaledger/iota/tree/develop/examples): Contains examples of apps written for IOTA and @@ -59,7 +59,7 @@ The following primary directories offer a good starting point for exploring the 0x2, 0x3). - [iota-network](https://github.com/iotaledger/iota/tree/develop/crates/iota-network) - Networking interfaces. -- [iota-node](https://github.com/iotaledger/iota/tree/develop/crates/iota-node) - Validator and Full node software. +- [iota-node](https://github.com/iotaledger/iota/tree/develop/crates/iota-node) - Validator and full node software. - [iota-protocol-config](https://github.com/iotaledger/iota/tree/develop/crates/iota-protocol-config) - On-chain system configuration and limits. - [iota-sdk](https://github.com/iotaledger/iota/tree/develop/crates/iota-sdk) - The IOTA Rust SDK. diff --git a/docs/content/developer/cryptography.mdx b/docs/content/developer/cryptography.mdx index 9dd0983de3a..c6de2035168 100644 --- a/docs/content/developer/cryptography.mdx +++ b/docs/content/developer/cryptography.mdx @@ -15,7 +15,7 @@ Go to [Transaction Authentication](./cryptography/transaction-auth.mdx). ## Checkpoint Verification Checkpoints define the history of the IOTA blockchain, similarly to how blocks define the history of traditional blockchains like Bitcoin or Ethereum. -For Full nodes and validators to trust a checkpoint, they must first verify it. Verification ensures that the checkpoint is a true checkpoint that the IOTA validator committee created. +For full nodes and validators to trust a checkpoint, they must first verify it. Verification ensures that the checkpoint is a true checkpoint that the IOTA validator committee created. Go to [Checkpoint Verification](./cryptography/checkpoint-verification.mdx). diff --git a/docs/content/developer/cryptography/checkpoint-verification.mdx b/docs/content/developer/cryptography/checkpoint-verification.mdx index 64f3d52e791..a1689035dcf 100644 --- a/docs/content/developer/cryptography/checkpoint-verification.mdx +++ b/docs/content/developer/cryptography/checkpoint-verification.mdx @@ -1,6 +1,6 @@ --- title: Checkpoint Verification -description: On the IOTA network, checkpoints define the history of the blockchain. Checkpoint verification is how Full nodes and other clients guarantee their state is exactly the same as the IOTA network. +description: On the IOTA network, checkpoints define the history of the blockchain. Checkpoint verification is how full nodes and other clients guarantee their state is exactly the same as the IOTA network. --- import Quiz from '@site/src/components/Quiz'; @@ -14,15 +14,15 @@ Checkpoints contain: - A list of all the transaction digests (and the corresponding transaction effects digests) that are included in the checkpoint. - A set of signatures from a quorum (more than 2/3rds) of the validators that formed the committee at the time the checkpoint was created. -Both validators and Full nodes consume checkpoints to remain synchronized with the network. +Both validators and full nodes consume checkpoints to remain synchronized with the network. ## Checkpoint verification -For Full nodes and validators to trust a checkpoint, they must first verify it. Verification ensures that the checkpoint is a true checkpoint that the IOTA validator committee created. +For full nodes and validators to trust a checkpoint, they must first verify it. Verification ensures that the checkpoint is a true checkpoint that the IOTA validator committee created. Checkpoint verification requires two interdependent pieces: -1. Assuming that the Full node (or other client) has the public keys of the validator committee that created the checkpoint, it can check the signatures on the checkpoint for validity. +1. Assuming that the full node (or other client) has the public keys of the validator committee that created the checkpoint, it can check the signatures on the checkpoint for validity. Checkpoints are signed by the aggregated BLS signatures of a quorum of the committee. If the signatures are valid, the client now knows that the checkpoint was created by the validator committee, and not by some other party. @@ -46,11 +46,11 @@ This allows the client to eventually verify all checkpoints up to the present ti After a client verifies a checkpoint, what can it do with that information? -As mentioned earlier, a checkpoint contains a list of transactions so a Full node, for instance, can begin fetching and executing those transactions. Because the transactions are identified by their digest (a cryptographic hash), the client can be sure that the transactions it executes have not been altered. +As mentioned earlier, a checkpoint contains a list of transactions so a full node, for instance, can begin fetching and executing those transactions. Because the transactions are identified by their digest (a cryptographic hash), the client can be sure that the transactions it executes have not been altered. Additionally, the checkpoint contains the effects digests of each transaction. The effects digest is the cryptographic hash of the `TransactionEffects`, which is itself a structure that lists all of the inputs and outputs of a transaction. It includes the digests of all objects that were written by the transaction. -This allows a Full node to verify that it has obtained the same execution results as those that the validators attested to when signing the checkpoint. +This allows a full node to verify that it has obtained the same execution results as those that the validators attested to when signing the checkpoint. -By executing checkpoints, and verifying transaction outputs, a Full node can build up the entire state of the IOTA network (that is, the collection of objects in the network) and trust that every byte of every object is correct. +By executing checkpoints, and verifying transaction outputs, a full node can build up the entire state of the IOTA network (that is, the collection of objects in the network) and trust that every byte of every object is correct. <Quiz questions={questions} /> \ No newline at end of file diff --git a/docs/content/developer/cryptography/transaction-auth/keys-addresses.mdx b/docs/content/developer/cryptography/transaction-auth/keys-addresses.mdx index f3668399bf9..92d9de70760 100644 --- a/docs/content/developer/cryptography/transaction-auth/keys-addresses.mdx +++ b/docs/content/developer/cryptography/transaction-auth/keys-addresses.mdx @@ -73,7 +73,7 @@ const address = keypair.getPublicKey().toIotaAddress(); ```shell iota keytool import "TEST_MNEMONIC" ed25519 "m/44'/4218'/0'/0'/0'" -iota client new-address ed25519 "m/44'/4218'/0'/0'/0'" +iota client new-address --key-scheme ed25519 --derivation-path "m/44'/4218'/0'/0'/0'" ``` </TabItem> diff --git a/docs/content/developer/cryptography/transaction-auth/multisig.mdx b/docs/content/developer/cryptography/transaction-auth/multisig.mdx index a000d1dd12e..eb27374755a 100644 --- a/docs/content/developer/cryptography/transaction-auth/multisig.mdx +++ b/docs/content/developer/cryptography/transaction-auth/multisig.mdx @@ -41,9 +41,9 @@ Use the following command to generate a IOTA address and key for each supported Use `iota client` to create IOTA addresses of different key schemes. ```shell -iota client new-address ed25519 -iota client new-address secp256k1 -iota client new-address secp256r1 +iota client new-address --key-scheme ed25519 +iota client new-address --key-scheme secp256k1 +iota client new-address --key-scheme secp256r1 ``` ### Step 2: Add keys to IOTA keystore @@ -131,7 +131,7 @@ The response resembles the following: ## Step 5: Serialize any transaction -This section demonstrates how to use an object that belongs to a multisig address and serialize a transfer to be signed. The `tx_bytes` value can be any serialized transaction data where the sender is the multisig address. Use the `--serialize-unsigned-transaction` flag for supported commands in `iota client -h` (`publish`, `upgrade`, `call`, `transfer`, `transfer-iota`, `pay`, `pay-all-iota`, `pay-iota`, `split`, `merge-coin`) to output the Base64 encoded transaction bytes. +This section demonstrates how to use an object that belongs to a multisig address and serialize a transfer to be signed. The `tx_bytes` value can be any serialized transaction data where the sender is the multisig address. Use the `--serialize-unsigned-transaction` flag for supported commands in `iota client -h` (`publish`, `upgrade`, `call`, `transfer`, `pay`, `pay-all-iota`, `pay-iota`, `split`, `merge-coin`) to output the Base64 encoded transaction bytes. ```shell iota client transfer --to <IOTA-ADDRESS> --object-id <OBJECT-ID> --serialize-unsigned-transaction @@ -177,4 +177,4 @@ Use `iota client` to execute a transaction using multisig: iota client execute-signed-tx --tx-bytes <TX_BYTES> --signatures <SERIALIZED-MULTISIG> ``` -<Quiz questions={questions} /> \ No newline at end of file +<Quiz questions={questions} /> diff --git a/docs/content/developer/cryptography/transaction-auth/offline-signing.mdx b/docs/content/developer/cryptography/transaction-auth/offline-signing.mdx index a596e9e2b25..fc3058f20d1 100644 --- a/docs/content/developer/cryptography/transaction-auth/offline-signing.mdx +++ b/docs/content/developer/cryptography/transaction-auth/offline-signing.mdx @@ -18,7 +18,7 @@ You must serialize transaction data following [Binary Canonical Serialization](h The following example demonstrates how to serialize data for a transfer using the [IOTA CLI](../../../references/cli.mdx). This returns serialized transaction data in Base64. Submit the raw transaction to execute as `tx_bytes`. ```shell -iota client transfer-iota --to <IOTA-ADDRESS> --iota-coin-object-id <COIN-OBJECT-ID> --serialize-unsigned-transaction +iota client pay-all-iota --input-coins <COIN-OBJECT-ID> --recipient <IOTA-ADDRESS> --gas-budget 2000000 --serialize-unsigned-transaction ``` The console responds with the resulting `<TX_BYTES>` value. @@ -82,15 +82,15 @@ Mutated Objects: Alternatively, you can use the active key in IOTA Keystore to sign and output a Base64-encoded sender signed data with flag `--serialize-signed-transaction`. ```shell -iota client transfer-iota --to <IOTA-ADDRESS> --iota-coin-object-id <COIN-OBJECT-ID> --serialize-signed-transaction +iota client pay-all-iota --input-coins <COIN-OBJECT-ID> --recipient <IOTA-ADDRESS> --gas-budget 2000000 --serialize-signed-transaction ``` The console responds with the resulting `<SIGNED-TX-BYTES>` value. -After you obtain the signed transaction bytes, you can submit it using the `execute-combined-signed-tx` command. This command takes `--signed-tx-bytes` as the signed transaction bytes to execute (see output of the previous `iota client transfer-iota` command). This executes the signed transaction and returns the certificate and transaction effects if successful. +After you obtain the signed transaction bytes, you can submit it using the `execute-combined-signed-tx` command. This command takes `--signed-tx-bytes` as the signed transaction bytes to execute (see output of the previous `iota client transfer` command). This executes the signed transaction and returns the certificate and transaction effects if successful. ```shell iota client execute-combined-signed-tx --signed-tx-bytes <SIGNED-TX-BYTES> ``` -<Quiz questions={questions} /> \ No newline at end of file +<Quiz questions={questions} /> diff --git a/docs/content/developer/dev-cheat-sheet.mdx b/docs/content/developer/dev-cheat-sheet.mdx index aa067459d45..e8d39ed890d 100644 --- a/docs/content/developer/dev-cheat-sheet.mdx +++ b/docs/content/developer/dev-cheat-sheet.mdx @@ -22,7 +22,7 @@ Quick reference on best practices for IOTA Network developers. |`cargo install --locked --git https://github.com/iotaledger/iota.git --branch <BRANCH-NAME> --features gas-profiler iota`|To get the latest version of CLI| |`iota client active-address`|to get the current address.| |`iota client -–help`|to list out all commands of iota client.| -|`iota client new-address <Scheme> Scheme`|to generate address , **Scheme** - (ed25519,secp256k1,secp256r1)| +|`iota client new-address --key-scheme <Scheme>`|to generate address, **Scheme** - (ed25519,secp256k1,secp256r1)| ## Move @@ -36,7 +36,7 @@ Quick reference on best practices for IOTA Network developers. | **Topic** | **Description** | |-|-| -| **Optimal performance** | For optimal performance and data consistency, apps should use the wallet's [`signTransactionBlock`](../references/ts-sdk/dapp-kit/index.mdx) API to sign transactions and then submit them via [`execute_transactionBlock`](/iota-api-ref#iota_executetransactionblock) on the app's full node. This ensures immediate read-after-write consistency, as the app's full node reflects writes instantly, avoiding delays from checkpointing. | +| **Optimal performance** | For optimal performance and data consistency, apps should use the wallet's [`signTransactionBlock`](../ts-sdk/dapp-kit/index.mdx) API to sign transactions and then submit them via [`execute_transactionBlock`](/iota-api-ref#iota_executetransactionblock) on the app's full node. This ensures immediate read-after-write consistency, as the app's full node reflects writes instantly, avoiding delays from checkpointing. | | **Lower latency** | For lower latency, use [`executeTransactionBlock`](/iota-api-ref#iota_executetransactionblock) with `"showEffects": false` and `"showEvents": false` if your app only needs confirmation of a transaction without immediate access to its effects or events.| | **Local cache** | Apps should implement a local cache for frequently read data rather than over-fetching from the full node. | | **Transaction cache**| Whenever possible,use programmable transaction blocks to compose on-chain functionality instead of deploying new contracts, enabling batching and lowering gas fees. | diff --git a/docs/content/developer/evm-to-move/tooling-apis.mdx b/docs/content/developer/evm-to-move/tooling-apis.mdx index 258599084db..f5200beb5f6 100644 --- a/docs/content/developer/evm-to-move/tooling-apis.mdx +++ b/docs/content/developer/evm-to-move/tooling-apis.mdx @@ -37,7 +37,7 @@ Unlike with EVM, where open-source third parties create the most used tooling, t ### SDKs -IOTA Move comes with a convenient [Rust](../../references/rust-sdk.mdx) and [TypeScript SDK](../../references/ts-sdk/typescript/index.mdx) right out of the box as part of the IOTA Move core. Next to that, a dApp toolkit is also offered by default, which provides several React components to more easily integrate your IOTA Move contract interaction within your dApp. While TypeScript covers most dApp requirements for an SDK, there might not be an SDK available for your language of choice at the moment. However, You can use one of the APIs directly on a lower level. +IOTA Move comes with a convenient [Rust](../../references/rust-sdk.mdx) and [TypeScript SDK](../../ts-sdk/typescript/index.mdx) right out of the box as part of the IOTA Move core. Next to that, a dApp toolkit is also offered by default, which provides several React components to more easily integrate your IOTA Move contract interaction within your dApp. While TypeScript covers most dApp requirements for an SDK, there might not be an SDK available for your language of choice at the moment. However, You can use one of the APIs directly on a lower level. ### Wallets diff --git a/docs/content/developer/exchange-integration/exchange-integration.mdx b/docs/content/developer/exchange-integration/exchange-integration.mdx index e3232b4d09c..29d50b7477b 100644 --- a/docs/content/developer/exchange-integration/exchange-integration.mdx +++ b/docs/content/developer/exchange-integration/exchange-integration.mdx @@ -11,13 +11,13 @@ This topic describes how to integrate IOTA, the token native to the IOTA network ## Requirements to configure a IOTA integration The requirements to configure a IOTA integration include: - - A IOTA Full node. You can operate your own IOTA Full node or use a Full node from a node operator. - - Suggested hardware requirements to run a IOTA Full node: + - A IOTA full node. You can operate your own IOTA full node or use a full node from a node operator. + - Suggested hardware requirements to run a IOTA full node: - CPU: 8 physical cores / 16 vCPUs - RAM: 128 GB - Storage (SSD): 4 TB NVMe drive -For best results, run IOTA Full nodes on Linux. IOTA supports the Ubuntu and Debian distributions. You can also fun a Full node on macOS. +For best results, run IOTA full nodes on Linux. IOTA supports the Ubuntu and Debian distributions. You can also fun a full node on macOS. ## Local testing @@ -25,7 +25,7 @@ You can develop and test your integration using a local development server. It w ## Configure a IOTA Full node -You can set up and configure a [IOTA Full node](../../operator/iota-full-node/overview.mdx) using Docker or directly from source code in the IOTA GitHub repository. +You can set up and configure a [IOTA full node](../../operator/iota-full-node/overview.mdx) using Docker or directly from source code in the IOTA GitHub repository. ## Set up IOTA addresses @@ -96,7 +96,7 @@ You can track balance changes by calling `iotax_getBalance` at predefined interv ### Using cURL -The following bash example demonstrates how to use `iotax_getBalance` for address `0x849d63687330447431a2e76fecca4f3c10f6884ebaa9909674123c6c662612a3`. If you use a network other than Devnet, replace the value for `rpc` with the URL to the appropriate Full node. +The following bash example demonstrates how to use `iotax_getBalance` for address `0x849d63687330447431a2e76fecca4f3c10f6884ebaa9909674123c6c662612a3`. If you use a network other than Devnet, replace the value for `rpc` with the URL to the appropriate full node. ```bash diff --git a/docs/content/developer/getting-started/client-tssdk.mdx b/docs/content/developer/getting-started/client-tssdk.mdx index 9480281f570..eed9b9ced58 100644 --- a/docs/content/developer/getting-started/client-tssdk.mdx +++ b/docs/content/developer/getting-started/client-tssdk.mdx @@ -34,14 +34,14 @@ yarn create @iota/dapp --template react-client-dapp ## What is the IOTA TypeScript SDK? -The [IOTA TypeScript SDK](../../references/ts-sdk/typescript/index.mdx) (`@iota/iota-sdk`) provides the essential +The [IOTA TypeScript SDK](../../ts-sdk/typescript/index.mdx) (`@iota/iota-sdk`) provides the essential functionality needed to interact with the IOTA ecosystem from TypeScript. It's versatile enough to be used in any TypeScript or JavaScript project, including web apps, Node.js applications, or mobile apps developed with tools like React Native that support TypeScript. ## What is dApp Kit? -[dApp Kit](../../references/ts-sdk/dapp-kit/index.mdx). (`@iota/dapp-kit`) is a collection of React hooks, components, +[dApp Kit](../../ts-sdk/dapp-kit/index.mdx). (`@iota/dapp-kit`) is a collection of React hooks, components, and utilities designed to simplify building decentralized applications (dApps) on the IOTA network. diff --git a/docs/content/developer/getting-started/get-address.mdx b/docs/content/developer/getting-started/get-address.mdx index ac9f625f0d8..e1e3d0be8bb 100644 --- a/docs/content/developer/getting-started/get-address.mdx +++ b/docs/content/developer/getting-started/get-address.mdx @@ -104,7 +104,7 @@ Please write down the recovery phrase associated with your address and keep it i #### Generate Address You can use the [IOTA Client CLI](../../references/cli/client.mdx) to generate any number of addresses by using -the `iota client new-address <AddressType>`, where `<AddresType>` is one of the following: +the `iota client new-address --key-scheme <KeyScheme>`, where `<KeyScheme>` is one of the following: * `ed25519` * `secp256k1` diff --git a/docs/content/developer/getting-started/iota-environment.mdx b/docs/content/developer/getting-started/iota-environment.mdx index 1d8a50aeefd..de70a70cd84 100644 --- a/docs/content/developer/getting-started/iota-environment.mdx +++ b/docs/content/developer/getting-started/iota-environment.mdx @@ -29,7 +29,7 @@ IOTA nodes. IOTA provides two official SDKs that you can use to interact with the IOTA network from your dApp: -* [Typescript SDK](../../references/ts-sdk/typescript/index.mdx) +* [Typescript SDK](../../ts-sdk/typescript/index.mdx) * [Rust SDK](../../references/rust-sdk.mdx) ## Move IDEs and plugins diff --git a/docs/content/developer/iota-101/move-overview/package-upgrades/custom-policies.mdx b/docs/content/developer/iota-101/move-overview/package-upgrades/custom-policies.mdx index 3068fc2ce60..c1fa397f23b 100644 --- a/docs/content/developer/iota-101/move-overview/package-upgrades/custom-policies.mdx +++ b/docs/content/developer/iota-101/move-overview/package-upgrades/custom-policies.mdx @@ -546,7 +546,7 @@ you'll publish this package and then upgrade it to change the value emitted in t ### Using the TypeScript SDK To publish and upgrade the package using your custom policy, -you'll need to use the [IOTA TypeScript SDK](../../../../references/ts-sdk/typescript/index.mdx). +you'll need to use the [IOTA TypeScript SDK](../../../../ts-sdk/typescript/index.mdx). #### 1. Set Up a Node.js Project diff --git a/docs/content/developer/iota-101/transactions/ptb/building-programmable-transaction-blocks-ts-sdk.mdx b/docs/content/developer/iota-101/transactions/ptb/building-programmable-transaction-blocks-ts-sdk.mdx index 70b171a6459..06a8ac4ef49 100644 --- a/docs/content/developer/iota-101/transactions/ptb/building-programmable-transaction-blocks-ts-sdk.mdx +++ b/docs/content/developer/iota-101/transactions/ptb/building-programmable-transaction-blocks-ts-sdk.mdx @@ -7,7 +7,7 @@ import questions from '/json/developer/iota-101/transactions/ptb/building-progra # Build Programmable Transaction Blocks with TypeScript SDK This guide illustrates how to build a [programmable transaction block (PTB)](programmable-transaction-blocks.mdx) on IOTA -using the [TypeScript SDK](../../../../references/ts-sdk/typescript/install.mdx). +using the [TypeScript SDK](../../../../ts-sdk/typescript/install.mdx). This example starts by building a PTB to send IOTA tokens. To construct transactions, import the `Transaction` class and create a new instance: diff --git a/docs/content/developer/iota-101/transactions/ptb/coin-management.mdx b/docs/content/developer/iota-101/transactions/ptb/coin-management.mdx index e942cff51f2..5943e2ccd20 100644 --- a/docs/content/developer/iota-101/transactions/ptb/coin-management.mdx +++ b/docs/content/developer/iota-101/transactions/ptb/coin-management.mdx @@ -28,7 +28,7 @@ making coin management a crucial step in transaction preparation. ## Using the IOTA SDKs -The IOTA SDKs for [TypeScript](../../../../references/ts-sdk/typescript/index.mdx) and [Rust](../../../../references/rust-sdk.mdx) handle coin management automatically, +The IOTA SDKs for [TypeScript](../../../../ts-sdk/typescript/index.mdx) and [Rust](../../../../references/rust-sdk.mdx) handle coin management automatically, merging coins as needed and assuming sequential transaction execution. This automation simplifies the process for most use cases where high concurrency isn't a concern. diff --git a/docs/content/developer/iota-101/transactions/ptb/programmable-transaction-blocks-overview.mdx b/docs/content/developer/iota-101/transactions/ptb/programmable-transaction-blocks-overview.mdx index eee50e55c49..4bcc39612f2 100644 --- a/docs/content/developer/iota-101/transactions/ptb/programmable-transaction-blocks-overview.mdx +++ b/docs/content/developer/iota-101/transactions/ptb/programmable-transaction-blocks-overview.mdx @@ -7,7 +7,7 @@ description: Learn about Programmable Transaction Blocks (PTBs) in IOTA and how ## Building PTBs with the TypeScript SDK -To truly harness the capabilities of PTBs, practical experience is key. Utilizing tools like the [IOTA TypeScript SDK](../../../../references/ts-sdk/typescript/index.mdx) allows you to explore the power and flexibility that PTBs offer. +To truly harness the capabilities of PTBs, practical experience is key. Utilizing tools like the [IOTA TypeScript SDK](../../../../ts-sdk/typescript/index.mdx) allows you to explore the power and flexibility that PTBs offer. Dive deeper into this topic in [Building Programmable Transaction Blocks](building-programmable-transaction-blocks-ts-sdk). diff --git a/docs/content/developer/iota-101/transactions/sign-and-send-transactions.mdx b/docs/content/developer/iota-101/transactions/sign-and-send-transactions.mdx index f94e360b26e..b5e194644a7 100644 --- a/docs/content/developer/iota-101/transactions/sign-and-send-transactions.mdx +++ b/docs/content/developer/iota-101/transactions/sign-and-send-transactions.mdx @@ -56,7 +56,7 @@ Below are examples demonstrating how to sign and submit transactions using Rust, <TabItem value="typescript" label="TypeScript"> -There are several methods to create a key pair and derive its public key and Move address using the [Move TypeScript SDK](../../../references/ts-sdk/typescript/index.mdx). +There are several methods to create a key pair and derive its public key and Move address using the [Move TypeScript SDK](../../../ts-sdk/typescript/index.mdx). ```tsx import { fromHEX } from '@iota/bcs'; @@ -242,9 +242,9 @@ You can initialize a key in three ways: ```shell # generate randomly. -iota client new-address ed25519 -iota client new-address secp256k1 -iota client new-address secp256r1 +iota client new-address --key-scheme ed25519 +iota client new-address --key-scheme secp256k1 +iota client new-address --key-scheme secp256r1 # import the 32-byte private key to keystore. iota keytool import "0xd463e11c7915945e86ac2b72d88b8190cfad8ff7b48e7eb892c275a5cf0a3e82" ed25519 @@ -263,11 +263,21 @@ Create a transfer transaction in CLI. Set the $IOTA_ADDRESS to the one correspon ```shell iota client gas -iota client transfer-iota --to $IOTA_ADDRESS --iota-coin-object-id $GAS_COIN_ID --serialize-unsigned-transaction +iota client pay-all-iota --input-coins $GAS_COIN_ID --recipient $IOTA_ADDRESS --gas-budget 2000000 --serialize-unsigned-transaction iota keytool sign --address $IOTA_ADDRESS --data $TX_BYTES iota client execute-signed-tx --tx-bytes $TX_BYTES --signatures $SERIALIZED_SIGNATURE ``` +All combined: + +```shell +GAS_COIN_ID=$(iota client gas --json | jq -r '.[0].gasCoinId') +IOTA_ADDRESS=$(iota keytool list --json | jq -r '.[0].iotaAddress') +UNSIGNED_TX_BYTES=$(iota client pay-all-iota --input-coins $GAS_COIN_ID --recipient $IOTA_ADDRESS --gas-budget 2000000 --serialize-unsigned-transaction) +SERIALIZED_SIGNATURE=$(iota keytool sign --address $IOTA_ADDRESS --data $UNSIGNED_TX_BYTES --json | jq -r '.iotaSignature') +iota client execute-signed-tx --tx-bytes $UNSIGNED_TX_BYTES --signatures $SERIALIZED_SIGNATURE +``` + </TabItem> </Tabs> diff --git a/docs/content/developer/iota-101/transactions/sponsored-transactions/use-sponsored-transactions.mdx b/docs/content/developer/iota-101/transactions/sponsored-transactions/use-sponsored-transactions.mdx index 59a8fd18849..15ea7d9146d 100644 --- a/docs/content/developer/iota-101/transactions/sponsored-transactions/use-sponsored-transactions.mdx +++ b/docs/content/developer/iota-101/transactions/sponsored-transactions/use-sponsored-transactions.mdx @@ -26,7 +26,7 @@ To set up a user-initiated sponsored transaction, follow these steps: 2. **User sends `GasLessTransactionData` to the sponsor**: The user forwards the transaction data to the sponsor. 3. **Sponsor validates and signs**: The sponsor reviews the transaction, constructs `TransactionData` with gas fees, and signs it. 4. **Sponsor returns signed transaction**: The sponsor sends the signed `TransactionData` and their `Signature` back to the user. -5. **User verifies and signs**: The user verifies the transaction, signs the `TransactionData`, and submits the dual-signed transaction to the IOTA network via a Full node or through the sponsor. +5. **User verifies and signs**: The user verifies the transaction, signs the `TransactionData`, and submits the dual-signed transaction to the IOTA network via a full node or through the sponsor. ### Understanding `GasLessTransactionData` @@ -96,7 +96,7 @@ Use the API endpoint to receive dual-signed `SenderSignedData` and return the tr pub fn submit_dual_signed_transaction(dual_signed_data: SenderSignedData) -> Result<(Transaction, CertifiedTransactionEffects), Error>; ``` -For user and sponsor-initiated transactions, users can submit the dual-signed transaction either through the sponsor or directly to a Full node. +For user and sponsor-initiated transactions, users can submit the dual-signed transaction either through the sponsor or directly to a full node. #### Data Structures for Sponsored Transactions diff --git a/docs/content/developer/iota-101/using-events.mdx b/docs/content/developer/iota-101/using-events.mdx index 5e6182ddc78..4505faeb763 100644 --- a/docs/content/developer/iota-101/using-events.mdx +++ b/docs/content/developer/iota-101/using-events.mdx @@ -82,7 +82,7 @@ curl -X POST https://api.testnet.iota.cafe:443 \ ``` The TypeScript SDK provides a wrapper for the `iotax_queryEvents` method: -[`client.queryEvents`](../../references/ts-sdk/api/client/classes/IotaClient#queryevents). +[`client.queryEvents`](../../ts-sdk/api/client/classes/IotaClient#queryevents). </TabItem> <TabItem value="rs" label="Rust"> @@ -144,7 +144,7 @@ You can use GraphQL to query events instead of JSON RPC. The following example q :::tip -The [TypeScript SDK](../../references/ts-sdk/api/graphql/classes/IotaGraphQLClient) provides functionality to +The [TypeScript SDK](../../ts-sdk/api/graphql/classes/IotaGraphQLClient) provides functionality to interact with the IOTA GraphQL service. ::: @@ -184,7 +184,7 @@ async fn main() -> Result<()> { </TabItem> <TabItem value="ts" label="TypeScript"> -To create the event subscription, you can use a basic Node.js app. You need the [IOTA TypeScript SDK](../../references/ts-sdk/typescript/index.mdx), so install the module using `npm install @iota/iota-sdk` at the root of your project. In your TypeScript code, import `JsonRpcProvider` and a connection from the library. +To create the event subscription, you can use a basic Node.js app. You need the [IOTA TypeScript SDK](../../ts-sdk/typescript/index.mdx), so install the module using `npm install @iota/iota-sdk` at the root of your project. In your TypeScript code, import `JsonRpcProvider` and a connection from the library. ```ts diff --git a/docs/content/developer/iota-move-ctf/challenge_0.mdx b/docs/content/developer/iota-move-ctf/challenge_0.mdx new file mode 100644 index 00000000000..fc358cb968a --- /dev/null +++ b/docs/content/developer/iota-move-ctf/challenge_0.mdx @@ -0,0 +1,25 @@ +import MintLeapFrogNFT from '@site/src/components/CTF/mint-leap-frog-nft'; + +# Challenge 0: Mint Leap Frog NFT + +In this challenge, your task is to mint the Leap Frog NFT. The package has already been deployed on the testnet, and the address of the deployed package is provided below. + +The module includes a function to mint a new NFT and transfer it to your account. To complete the challenge, simply click the "Mint" button below to mint the NFT. + +Alternatively, you can use the testnet explorer to call the module's function directly and mint the NFT. + +## Deployed Package Address: + +``` +Package Address: 0x649884331fa662235b2c06c6eb488e5327105dded1331f6b7541ef4fdbd9eeca +``` + +## Leap Frog NFT Module: + +```move file=<rootDir>/docs/examples/move/ctf/challenge_0/sources/leap_frog_nft.move +``` + +Good luck in capturing your first flag! + + +<MintLeapFrogNFT/> \ No newline at end of file diff --git a/docs/content/developer/standards/display.mdx b/docs/content/developer/standards/display.mdx index 82db8ce3784..c06dea9050b 100644 --- a/docs/content/developer/standards/display.mdx +++ b/docs/content/developer/standards/display.mdx @@ -12,7 +12,7 @@ Use a `Publisher` object that you own to set `iota::display` for a type. In IOTA Move, `Display<T>` represents an object that specifies a set of named templates for the type `T`. For example, for a type `0x2::hero::Hero` the display syntax is: `Display<0x2::hero::Hero>`. -IOTA Full nodes process all objects of the type `T` by matching the `Display` definition, and return the processed result when you query an object with the `{ showDisplay: true }` setting in the query. +IOTA full nodes process all objects of the type `T` by matching the `Display` definition, and return the processed result when you query an object with the `{ showDisplay: true }` setting in the query. ## Display properties diff --git a/docs/content/developer/standards/kiosk.mdx b/docs/content/developer/standards/kiosk.mdx index 4711381f38e..4d5630e6218 100644 --- a/docs/content/developer/standards/kiosk.mdx +++ b/docs/content/developer/standards/kiosk.mdx @@ -16,7 +16,7 @@ Practically, Kiosk is a part of the IOTA framework, and it is native to the syst :::info -See the [Kiosk SDK documentation](../../references/ts-sdk/kiosk/index.mdx) for examples of working with Kiosk using TypeScript. +See the [Kiosk SDK documentation](../../ts-sdk/kiosk/index.mdx) for examples of working with Kiosk using TypeScript. ::: diff --git a/docs/content/developer/standards/wallet-standard.mdx b/docs/content/developer/standards/wallet-standard.mdx index 4a529531af1..9342de0bb73 100644 --- a/docs/content/developer/standards/wallet-standard.mdx +++ b/docs/content/developer/standards/wallet-standard.mdx @@ -327,6 +327,6 @@ These values are all arrays containing the new or changed items. Consequently, e ### Implementation Example -IOTA offers a bare bones scaffold for React-based applications called `@iota/dapp-kit`. See the [dApp Kit documentation](../../references/ts-sdk/dapp-kit/index.mdx) for more information. +IOTA offers a bare bones scaffold for React-based applications called `@iota/dapp-kit`. See the [dApp Kit documentation](../../ts-sdk/dapp-kit/index.mdx) for more information. <Quiz questions={questions} /> \ No newline at end of file diff --git a/docs/content/operator/archives.mdx b/docs/content/operator/archives.mdx index 921557b83bb..79c426fb1fe 100644 --- a/docs/content/operator/archives.mdx +++ b/docs/content/operator/archives.mdx @@ -1,14 +1,14 @@ --- title: IOTA Archives -description: The archive is a historical record of all transactions on IOTA. Enable archiving on your Full nodes as a best practice. +description: The archive is a historical record of all transactions on IOTA. Enable archiving on your full nodes as a best practice. --- import Quiz from '@site/src/components/Quiz'; import questions from '/json/node-operators/archives.json'; -An IOTA archive is a history of all transaction data on IOTA, trailing behind the latest checkpoint by 10 minutes. As an IOTA node operator, you can write this history to an object store like S3, GCS, or similar for safe keeping. Saving this archive data is considered a best practice because IOTA prunes transactions on Full nodes to remove historical transactions and their effects. Peer nodes, for example, might not catch up with all transactions and effects through synchronization if they lag behind the current epoch by more than the latest few epochs. Instead of relying on synchronization, peer nodes can fallback to downloading this information from an archive. +An IOTA archive is a history of all transaction data on IOTA, trailing behind the latest checkpoint by 10 minutes. As an IOTA node operator, you can write this history to an object store like S3, GCS, or similar for safe keeping. Saving this archive data is considered a best practice because IOTA prunes transactions on full nodes to remove historical transactions and their effects. Peer nodes, for example, might not catch up with all transactions and effects through synchronization if they lag behind the current epoch by more than the latest few epochs. Instead of relying on synchronization, peer nodes can fallback to downloading this information from an archive. -IOTA Archival nodes (Full nodes that write to an archive) don't store historical state on local storage and don't help query historical data. They serve the purpose of enabling peer nodes to catch up to the latest checkpoint and are useful for auditing and verifying the complete history of all transactions on the network. +IOTA Archival nodes (full nodes that write to an archive) don't store historical state on local storage and don't help query historical data. They serve the purpose of enabling peer nodes to catch up to the latest checkpoint and are useful for auditing and verifying the complete history of all transactions on the network. ## Create an Archival node diff --git a/docs/content/operator/data-management.mdx b/docs/content/operator/data-management.mdx index 9cab1da78c9..19a123687e5 100644 --- a/docs/content/operator/data-management.mdx +++ b/docs/content/operator/data-management.mdx @@ -1,29 +1,29 @@ --- title: Data Management -description: A high-level description of data management on the IOTA network that you can use to optimize your IOTA Full node configuration. +description: A high-level description of data management on the IOTA network that you can use to optimize your IOTA full node configuration. --- import Quiz from '@site/src/components/Quiz'; import questions from '/json/node-operators/data-management.json'; -Managing the data on your IOTA Full node is critical to ensuring a healthy IOTA network. This topic provides a high-level description of data management on IOTA Full nodes that you can use to optimize your Full node configuration. For more information about IOTA Full nodes, such as pruning policies and archival settings, see [Run an IOTA Full Node](iota-full-node/overview.mdx). +Managing the data on your IOTA full node is critical to ensuring a healthy IOTA network. This topic provides a high-level description of data management on IOTA full nodes that you can use to optimize your full node configuration. For more information about IOTA full nodes, such as pruning policies and archival settings, see [Run an IOTA Full Node](iota-full-node/overview.mdx). ## Basic IOTA Full node functionality -The minimal version of an IOTA Full node executes all of the transactions IOTA validators commit. IOTA Full nodes also orchestrate the submitting of new transactions to the system: +The minimal version of an IOTA full node executes all of the transactions IOTA validators commit. IOTA full nodes also orchestrate the submitting of new transactions to the system: -![Basic IOTA Full node functionality](/img/operator/data-management/fn-basic-functionality.png "A diagram that shows the operations of a basic IOTA Full node.") +![Basic IOTA full node functionality](/img/operator/data-management/fn-basic-functionality.png "A diagram that shows the operations of a basic IOTA full node.") -The preceding image shows how data flows through a Full node: +The preceding image shows how data flows through a full node: -1. **`State sync` protocol:** An IOTA Full node performs the following to achieve state synchronization: +1. **`State sync` protocol:** An IOTA full node performs the following to achieve state synchronization: - Retrieves the information about the committed checkpoints via the p2p gossip-like protocol - Executes the transactions locally to verify that effects match the effects certified by the quorum of the validators - Updates the local state with the latest object values accordingly. -2. **RPCs:** An IOTA Full node exposes IOTA RPC endpoints for querying the latest state of the system, including both the latest state metadata (such as, `iota_getProtocolConfig`), and the latest state object data (`iota_getObject)`. -3. **Transaction submission:** Each IOTA Full node orchestrates transaction submission to the quorum of the IOTA Validators, and, optionally if configured, locally executes the finalized transactions (called fast path execution), which circumvents the wait for checkpoint synchronization. +2. **RPCs:** An IOTA full node exposes IOTA RPC endpoints for querying the latest state of the system, including both the latest state metadata (such as, `iota_getProtocolConfig`), and the latest state object data (`iota_getObject)`. +3. **Transaction submission:** Each IOTA full node orchestrates transaction submission to the quorum of the IOTA Validators, and, optionally if configured, locally executes the finalized transactions (called fast path execution), which circumvents the wait for checkpoint synchronization. -## IOTA Full node Data and RPC types +## IOTA full node Data and RPC types An IOTA Full Node stores multiple categories of data in its permanent store. @@ -33,15 +33,15 @@ The per-epoch IOTA store is beyond the scope of this topic. IOTA uses the per-ep ::: -IOTA Full nodes store the following types of data: +IOTA full nodes store the following types of data: -1. **Transactions with associated effects and events:** IOTA uses a unique transaction digest to retrieve information about a transaction, including its effects and emitted events. IOTA Full nodes don't require the historic transaction information for basic Full node operations. To conserve disk space, you can enable pruning to remove this historical data. +1. **Transactions with associated effects and events:** IOTA uses a unique transaction digest to retrieve information about a transaction, including its effects and emitted events. IOTA full nodes don't require the historic transaction information for basic full node operations. To conserve disk space, you can enable pruning to remove this historical data. 2. **Checkpoints:** IOTA groups committed transactions in checkpoints, and then uses those checkpoints to achieve state synchronization. Checkpoints keep transaction digests that contain additional integrity metadata. -IOTA Full nodes don't require data from checkpoints to execute and submit transactions, so you can configure pruning for this data as well. -3. **Objects:** Transactions that mutate objects create new object versions. Each object has a unique pair of `(objectId, version)` used to identify the object. IOTA Full nodes don't require historic object versions to execute and submit transactions, so you can configure your Full node to also prune this data. -4. **Indexing information:** A Full node default configuration is to post-process the committed transactions: it indexes the committed information to enable efficient aggregation and filtering queries. For example, the indexing can be useful for retrieving all the historic transactions of a given sender, or finding all the objects owned by an address. +IOTA full nodes don't require data from checkpoints to execute and submit transactions, so you can configure pruning for this data as well. +3. **Objects:** Transactions that mutate objects create new object versions. Each object has a unique pair of `(objectId, version)` used to identify the object. IOTA full nodes don't require historic object versions to execute and submit transactions, so you can configure your full node to also prune this data. +4. **Indexing information:** A full node default configuration is to post-process the committed transactions: it indexes the committed information to enable efficient aggregation and filtering queries. For example, the indexing can be useful for retrieving all the historic transactions of a given sender, or finding all the objects owned by an address. -IOTA Full nodes support more than 40 RPC types that includes the following categories: +IOTA full nodes support more than 40 RPC types that includes the following categories: * **General metadata**, such as `iota_getProtocolConfig` and `iota_getChainIdentifier`. These requests don't depend on additional indexing and don't require historic data to process. * **Direct lookups**, such as `iota_getObject`, `iota_getEvents`. These requests don't depend on additional indexing, but require historic data in some cases, such as `iota_tryGetPastObject` and `iota_getTransactionBlock`. @@ -49,7 +49,7 @@ IOTA Full nodes support more than 40 RPC types that includes the following categ :::info -IOTA plans to migrate the RPC endpoints that require additional indexing away from IOTA Full nodes in the near future. This plan decouples the storage that is backing transaction execution from the storage that is better suited for data indexing. +IOTA plans to migrate the RPC endpoints that require additional indexing away from IOTA full nodes in the near future. This plan decouples the storage that is backing transaction execution from the storage that is better suited for data indexing. ::: @@ -63,15 +63,15 @@ The current archival storage format doesn't include historic object versions. ::: -As a Full node operator, you can [enable archival fallback for your Full node](./archives.mdx#set-up-archival-fallback) by specifying the URL to upload archival data. To ensure a healthy network, we encourage the IOTA community to set up additional archives to ensure archival data availability across the network. In a typical configuration, an archive trails behind the latest checkpoint by approximately 10 minutes. +As a full node operator, you can [enable archival fallback for your full node](./archives.mdx#set-up-archival-fallback) by specifying the URL to upload archival data. To ensure a healthy network, we encourage the IOTA community to set up additional archives to ensure archival data availability across the network. In a typical configuration, an archive trails behind the latest checkpoint by approximately 10 minutes. A Full Node that starts from scratch can replay (and thus re-verify) transactions that occurred since IOTA genesis from the given archive via [configuring Archival Fallback](./archives.mdx#set-up-archival-fallback) in the `fullnode.yaml` configuration file to point to the S3 bucket that stores the archive. -An IOTA Full node that fails to retrieve checkpoints from its peers via state sync protocol falls back to downloading the missing checkpoints from its pre-configured archive. This fallback enables a Full node to catch up with the rest of the system regardless of the pruning policies of its peers. +An IOTA full node that fails to retrieve checkpoints from its peers via state sync protocol falls back to downloading the missing checkpoints from its pre-configured archive. This fallback enables a full node to catch up with the rest of the system regardless of the pruning policies of its peers. -## IOTA Full node pruning policies +## IOTA full node pruning policies -As described previously, sustainable disk usage requires IOTA Full nodes to prune the information about historic object versions as well as historic transactions with the corresponding effects and events, including old checkpoint data. +As described previously, sustainable disk usage requires IOTA full nodes to prune the information about historic object versions as well as historic transactions with the corresponding effects and events, including old checkpoint data. Both transaction and object pruners run in the background. The logical deletion of entries from RocksDB ultimately triggers the physical compaction of data on disk, which is governed by RocksDB background jobs: the pruning effect on disk usage is not immediate and might take multiple days. @@ -89,22 +89,22 @@ To learn more about transaction pruning policies, see [Transaction pruning](iot ### Set an archiving watermark -In case your Full node is configured to upload committed information to an archive, you should ensure that pruning doesn't occur until after the corresponding data is uploaded. To do so, set the `use-for-pruning-watermark: true` in the Fullnode.yaml file as described in [Archival fallback](./archives.mdx#set-up-archival-fallback). +In case your full node is configured to upload committed information to an archive, you should ensure that pruning doesn't occur until after the corresponding data is uploaded. To do so, set the `use-for-pruning-watermark: true` in the Fullnode.yaml file as described in [Archival fallback](./archives.mdx#set-up-archival-fallback). -## IOTA Full node key-value store backup +## IOTA full node key-value store backup -To enable historic data queries for the IOTA Full nodes that prune old transactional data, Full node RPC implementation is configured to fallback for querying missing transactional data from a remote store. +To enable historic data queries for the IOTA full nodes that prune old transactional data, full node RPC implementation is configured to fallback for querying missing transactional data from a remote store. -If the information about the transaction digest, effects, events, or checkpoints is not available locally, a Full node automatically retrieves the historical data from a cloud-based key-value store (currently managed by the IOTA Foundation). Note that the current key-value store implementation keeps historic transactional data only: we plan to provide support for a similar setup for retrieving the historic object versions in a future release. +If the information about the transaction digest, effects, events, or checkpoints is not available locally, a full node automatically retrieves the historical data from a cloud-based key-value store (currently managed by the IOTA Foundation). Note that the current key-value store implementation keeps historic transactional data only: we plan to provide support for a similar setup for retrieving the historic object versions in a future release. ## Pruning policy examples -Use the examples in this section to configure your IOTA Full node. You can copy the examples, and then, optionally, modify the values as appropriate for your environment. +Use the examples in this section to configure your IOTA full node. You can copy the examples, and then, optionally, modify the values as appropriate for your environment. -### Minimal Full node +### Minimal Full Node -This configuration keeps disk usage to a minimum. A Full node with this configuration cannot answer queries that require indexing or historic data. +This configuration keeps disk usage to a minimum. A full node with this configuration cannot answer queries that require indexing or historic data. ```yaml # Do not generate or maintain indexing of IOTA data on the node @@ -129,7 +129,7 @@ authority-store-pruning-config: ### Full Node with indexing but no history -This setup manages secondary indexing in addition to the latest state, but aggressively prunes historic data. A Full node with this configuration: +This setup manages secondary indexing in addition to the latest state, but aggressively prunes historic data. A full node with this configuration: - Answers RPC queries that require indexing, like `iotax_getBalance()`. - Answers RPC queries that require historic transactions via a fallback to retrieve the data from a remote key-value store: `iota_getTransactionBlock()`. @@ -156,9 +156,9 @@ authority-store-pruning-config: ### Full Node with full object history but pruned transaction history -This configuration manages the full object history while still pruning historic transactions. A Full node with this configuration can answer all historic and indexing queries (using the transaction query fallback for transactional data), including the ones that require historic objects such as the `showBalanceChanges` filter of `iota_getTransactionBlock()`. +This configuration manages the full object history while still pruning historic transactions. A full node with this configuration can answer all historic and indexing queries (using the transaction query fallback for transactional data), including the ones that require historic objects such as the `showBalanceChanges` filter of `iota_getTransactionBlock()`. -The main caveat is that the current setup enables **transaction pruner** to go ahead of **object pruner**. The object pruner might not be able to properly clean up the objects modified by the transactions that have been already pruned. You should closely monitor the disk space growth on a Full node with this configuration. +The main caveat is that the current setup enables **transaction pruner** to go ahead of **object pruner**. The object pruner might not be able to properly clean up the objects modified by the transactions that have been already pruned. You should closely monitor the disk space growth on a full node with this configuration. In addition to the regular (pruned) snapshots, the IOTA Foundation also maintains special RocksDB snapshots with full history of object versions available for the operators using this configuration. diff --git a/docs/content/operator/genesis.mdx b/docs/content/operator/genesis.mdx index c2f87446c06..3abf6a21725 100644 --- a/docs/content/operator/genesis.mdx +++ b/docs/content/operator/genesis.mdx @@ -2,7 +2,7 @@ title: Genesis --- -Genesis is the initial state of the IOTA blockchain. To launch a network, the initial committee of validators collaborate by providing their validator information (public keys, network addresses, and so on) to a shared workspace. After all of the initial validators have contributed their information, IOTA generates the initial, unsigned genesis checkpoint (checkpoint with sequence number 0) and each validator provides their signature. IOTA aggregates these signatures to form a _certificate_ on the genesis checkpoint. IOTA bundles this checkpoint, as well as the initial objects, together into a single genesis.blob file that is used to initialize the state when running the `iota-node` binary for both validators and Full nodes. +Genesis is the initial state of the IOTA blockchain. To launch a network, the initial committee of validators collaborate by providing their validator information (public keys, network addresses, and so on) to a shared workspace. After all of the initial validators have contributed their information, IOTA generates the initial, unsigned genesis checkpoint (checkpoint with sequence number 0) and each validator provides their signature. IOTA aggregates these signatures to form a _certificate_ on the genesis checkpoint. IOTA bundles this checkpoint, as well as the initial objects, together into a single genesis.blob file that is used to initialize the state when running the `iota-node` binary for both validators and full nodes. ## Genesis blob locations diff --git a/docs/content/operator/indexer-functions.mdx b/docs/content/operator/indexer-functions.mdx index c676ed63c3b..684c7b06d5d 100644 --- a/docs/content/operator/indexer-functions.mdx +++ b/docs/content/operator/indexer-functions.mdx @@ -10,7 +10,7 @@ The IOTA Indexer is a node data service that serves data from the IOTA protocol, ## Functions The IOTA Indexer provides three main functionalities: -- Ingest data from a Full node to a relational database. Data on Full nodes is stored as BCS bytes in an embedded RocksDB database, thus the query capabilities are very limited. The indexer pulls checkpoint blob data, schematizing them into various tables like objects, transactions, and so on, with proper indices. +- Ingest data from a full node to a relational database. Data on full nodes is stored as BCS bytes in an embedded RocksDB database, thus the query capabilities are very limited. The indexer pulls checkpoint blob data, schematizing them into various tables like objects, transactions, and so on, with proper indices. - Serve online transaction processing (OLTP) RPC requests. With data in relational databases, IOTA indexer spins a stateless reader binary as JSON RPC server with an [interface](/references/iota-api). - Other than OLTP data ingestion and requests, the Indexer also supports some analytical data ingestion like transactions per second (TPS) and daily active user (DAU) metrics. diff --git a/docs/content/operator/iota-full-node/monitoring-and-pruning.mdx b/docs/content/operator/iota-full-node/monitoring-and-pruning.mdx index 0dd0a5d15f8..4414e18b3f9 100644 --- a/docs/content/operator/iota-full-node/monitoring-and-pruning.mdx +++ b/docs/content/operator/iota-full-node/monitoring-and-pruning.mdx @@ -8,7 +8,7 @@ import questions from '/json/node-operators/iota-full-node/pruning.json'; ## Monitoring -Monitor your Full node using the instructions in the [Node Monitoring and Metrics section](../telemetry/iota-metrics.mdx). +Monitor your full node using the instructions in the [Node Monitoring and Metrics section](../telemetry/iota-metrics.mdx). The default metrics port is `9184`. To change the port, edit your `fullnode.yaml` file. @@ -39,9 +39,9 @@ authority-store-pruning-config: # previous to the current epoch. In general, when set to N (where N >= 1), IOTA prunes # only object versions from checkpoints up to `current - N` epoch. # It is therefore possible to have multiple versions of an object present - # in the database. This setting is recommended for IOTA Full nodes as they might need to serve + # in the database. This setting is recommended for IOTA full nodes as they might need to serve # RPC requests that require looking up objects by ID and Version (rather than just the latest - # version). However, if your Full node does not serve RPC requests you should then also enable + # version). However, if your full node does not serve RPC requests you should then also enable # aggressive pruning. num-epochs-to-retain: 0 # Advanced setting: Maximum number of checkpoints to prune in a batch. The default @@ -58,7 +58,7 @@ IOTA periodically creates checkpoints. Each checkpoint contains the transactions IOTA performs transaction pruning in the background after checkpoints complete. -You can enable transaction pruning for your Full node or Validator node by adding `num-epochs-to-retain-for-checkpoints` +You can enable transaction pruning for your full node or Validator node by adding `num-epochs-to-retain-for-checkpoints` to the `authority-store-pruning-config` config for the node: ```yaml @@ -71,7 +71,7 @@ authority-store-pruning-config: # Number of epochs to wait before performing transaction pruning. # When this is N (where N >= 2), IOTA prunes transactions and effects from # checkpoints up to the `current - N` epoch. IOTA never prunes transactions and effects from the current and - # immediately prior epoch. N = 2 is a recommended setting for IOTA Validator nodes and IOTA Full nodes that don't + # immediately prior epoch. N = 2 is a recommended setting for IOTA Validator nodes and IOTA full nodes that don't # serve RPC requests. num-epochs-to-retain-for-checkpoints: 2 # Ensures that individual database files periodically go through the compaction process. diff --git a/docs/content/operator/iota-full-node/overview.mdx b/docs/content/operator/iota-full-node/overview.mdx index cdd63215d70..da11b6eb69d 100644 --- a/docs/content/operator/iota-full-node/overview.mdx +++ b/docs/content/operator/iota-full-node/overview.mdx @@ -11,19 +11,19 @@ import WarningAdvanced from './../../_snippets/warning-advanced-instructions-nod <WarningAdvanced /> -IOTA Full nodes validate blockchain activities, including transactions, checkpoints, and epoch changes. Each Full node stores and services the queries for the blockchain state and history. +IOTA full nodes validate blockchain activities, including transactions, checkpoints, and epoch changes. Each full node stores and services the queries for the blockchain state and history. -This role enables validators to focus on servicing and processing transactions. When a validator commits a new set of transactions (or a block of transactions), the validator pushes that block to all connected Full nodes that then service the queries from clients. +This role enables validators to focus on servicing and processing transactions. When a validator commits a new set of transactions (or a block of transactions), the validator pushes that block to all connected full nodes that then service the queries from clients. ## Features -IOTA Full nodes: +IOTA full nodes: - Track and verify the state of the blockchain, independently and locally. - Serve read requests from clients. ## State Synchronization -IOTA Full nodes sync with validators to receive new transactions on the network. +IOTA full nodes sync with validators to receive new transactions on the network. A transaction requires a few round trips to 2f+1 validators to form a transaction _certificate_ (TxCert). @@ -35,13 +35,13 @@ This synchronization process includes: 1. Making sure that 2f+1 validators recognize the transaction and that it reaches finality. 1. Executing the transaction locally and updating the local DB. -This synchronization process requires listening to at a minimum 2f+1 validators to ensure that a Full node has properly processed all new transactions. IOTA will improve the synchronization process with the introduction of checkpoints and the ability to synchronize with other Full nodes. +This synchronization process requires listening to at a minimum 2f+1 validators to ensure that a full node has properly processed all new transactions. IOTA will improve the synchronization process with the introduction of checkpoints and the ability to synchronize with other full nodes. ## Architecture -An IOTA Full node is essentially a read-only view of the network state. Unlike validator nodes, Full nodes cannot sign transactions, although they can validate the integrity of the chain by re-executing transactions that a quorum of validators previously committed. +An IOTA full node is essentially a read-only view of the network state. Unlike validator nodes, full nodes cannot sign transactions, although they can validate the integrity of the chain by re-executing transactions that a quorum of validators previously committed. -Today, an IOTA Full node maintains the full history of the chain. +Today, an IOTA full node maintains the full history of the chain. Validator nodes store only the latest transactions on the frontier of the object graph (for example, transactions with >0 unspent output objects). diff --git a/docs/content/operator/iota-full-node/source.mdx b/docs/content/operator/iota-full-node/source.mdx index 6bb6e1f14ea..d468e81fb2e 100644 --- a/docs/content/operator/iota-full-node/source.mdx +++ b/docs/content/operator/iota-full-node/source.mdx @@ -1,5 +1,5 @@ --- -description: Learn how to set up an IOTA Full node from source. +description: Learn how to set up an IOTA full node from source. title: Build From Source --- import Quiz from '@site/src/components/Quiz'; @@ -14,7 +14,7 @@ import {Networks} from '@site/src/components/constant' ## Software requirements -IOTA recommends running IOTA Full nodes on Linux. IOTA supports the Ubuntu and Debian distributions. You can also run an IOTA Full node on macOS. +IOTA recommends running IOTA full nodes on Linux. IOTA supports the Ubuntu and Debian distributions. You can also run an IOTA full node on macOS. Make sure to [update Rust](https://www.rust-lang.org/tools/install). @@ -64,7 +64,7 @@ Open a terminal or console in the `iota` directory you downloaded in the previou cargo install ``` -2. Make a copy of the [Full node YAML template](https://github.com/iotaledger/iota/blob/develop/crates/iota-config/data/fullnode-template.yaml): +2. Make a copy of the [full node YAML template](https://github.com/iotaledger/iota/blob/develop/crates/iota-config/data/fullnode-template.yaml): ```bash cp crates/iota-config/data/fullnode-template.yaml fullnode.yaml @@ -115,7 +115,7 @@ cp crates/iota-config/data/fullnode-template.yaml fullnode.yaml </Tabs> 5. (Optional, skip this step to accept the default paths to resources). Edit the `fullnode.yaml` file to use custom paths. - 1. Update the `db-path` field with the path to the Full node database. + 1. Update the `db-path` field with the path to the full node database. ```yaml db-path: "/db-files/iota-fullnode"` ``` @@ -139,7 +139,7 @@ cargo run --release --bin iota-node ## 4. Start Services -At this point, your IOTA Full node is ready to connect to the IOTA network. +At this point, your IOTA full node is ready to connect to the IOTA network. 1. Open a terminal or console to the `iota` directory and run the following command to start your node: @@ -149,9 +149,9 @@ At this point, your IOTA Full node is ready to connect to the IOTA network. 2. (Optional) Publish/subscribe to notifications using JSON-RPC via websocket. -If your setup is successful, your IOTA Full node is now connected to the appropriate network. +If your setup is successful, your IOTA full node is now connected to the appropriate network. -Your Full node serves the read endpoints of the IOTA JSON-RPC API at: <code>{Networks.iota_localnet.jsonRpcUrl}</code>. +Your full node serves the read endpoints of the IOTA JSON-RPC API at: <code>{Networks.iota_localnet.jsonRpcUrl}</code>. ## Troubleshooting @@ -178,13 +178,13 @@ metrics-address: "0.0.0.0:9180" ## Update Your Full node -Whenever IOTA releases a new version, you must update your Full node with the release to ensure compatibility with the +Whenever IOTA releases a new version, you must update your full node with the release to ensure compatibility with the network it connects to. For example, if you use IOTA Testnet you should install the version of IOTA running on IOTA Testnet. -Use the following steps to update your Full node: +Use the following steps to update your full node: -1. Shut down your running Full node. +1. Shut down your running full node. 2. Move into the directory for your local `iota` repository and remove the database, 'genesis.blob' and 'migration.blob' files: @@ -205,19 +205,19 @@ Use the following steps to update your Full node: - [Devnet migration blob](https://dbfiles.devnet.iota.cafe/migration.blob): `curl -fLJO https://dbfiles.devnet.iota.cafe/migration.blob` 5. (Optional) Update your `fullnode.yaml` configuration file, if needed. -6. Recompile your IOTA Full node: +6. Recompile your IOTA full node: ```bash cargo run --release --bin iota-node ``` -7. Restart your IOTA Full node: +7. Restart your IOTA full node: ```shell ./target/release/iota-node --config-path fullnode.yaml ``` -Your Full node restarts on: <code>{Networks.iota_localnet.jsonRpcUrl}</code>. +Your full node restarts on: <code>{Networks.iota_localnet.jsonRpcUrl}</code>. :::info diff --git a/docs/content/operator/operator.mdx b/docs/content/operator/operator.mdx index 31bf74390f1..6342e5b7948 100644 --- a/docs/content/operator/operator.mdx +++ b/docs/content/operator/operator.mdx @@ -1,13 +1,13 @@ --- title: Operator Guides -description: Guides for operators on the IOTA network. Whether you are running a Full node for your dApp or operating as a validator on the IOTA network, these guides help you set up your environment and operate your network. +description: Guides for operators on the IOTA network. Whether you are running a full node for your dApp or operating as a validator on the IOTA network, these guides help you set up your environment and operate your network. --- -Operator guides demonstrate how to run Full nodes on IOTA, whether as a validator or operator of a Full node to support your dApp, as well as how to integrate IOTA into an exchange. +Operator guides demonstrate how to run full nodes on IOTA, whether as a validator or operator of a full node to support your dApp, as well as how to integrate IOTA into an exchange. -## IOTA Full node operators +## IOTA full node operators -Guides that inform Full node operators include: +Guides that inform full node operators include: - [IOTA Full Node Configuration](iota-full-node/overview.mdx) @@ -19,9 +19,9 @@ Guides that inform validators how to operate on IOTA include: - [Validator Configuration](validator-config.mdx) - [Validator Tasks](validator-operation/validator-tasks.mdx) -## IOTA Full node operators and validators +## IOTA full node operators and validators -Guides that benefit both Full node operators and validators include: +Guides that benefit both full node operators and validators include: - [Data Management](data-management.mdx) - [Genesis](genesis.mdx) diff --git a/docs/content/operator/snapshots.mdx b/docs/content/operator/snapshots.mdx index 9ac406f77b8..663fe90e3a6 100644 --- a/docs/content/operator/snapshots.mdx +++ b/docs/content/operator/snapshots.mdx @@ -1,14 +1,14 @@ --- title: Database Snapshots -description: Database snapshots of the IOTA network enable Full node operators a way to bootstrap a Full node without having to execute all the transactions that occurred after genesis. +description: Database snapshots of the IOTA network enable full node operators a way to bootstrap a full node without having to execute all the transactions that occurred after genesis. --- import Quiz from '@site/src/components/Quiz'; import questions from '/json/node-operators/snapshots.json'; -Database snapshots provide a point-in-time view of a database's store. In IOTA, the database snapshot captures a running database's view of the IOTA network from a particular node at the end of an epoch. While validators can enable snapshots, they are typically most valuable for Full node operators. +Database snapshots provide a point-in-time view of a database's store. In IOTA, the database snapshot captures a running database's view of the IOTA network from a particular node at the end of an epoch. While validators can enable snapshots, they are typically most valuable for full node operators. -Snapshots of the IOTA network enable Full node operators a way to bootstrap a Full node without having to execute all the transactions that occurred after genesis. You can upload snapshots to remote object stores like S3, Google Cloud Storage, Azure Blob Storage, and similar services. These services typically run the export process in the background so there is no degradation in performance for your Full node. With snapshots stored in the cloud, you're more easily able to recover quickly from catastrophic failures in your system or hardware. +Snapshots of the IOTA network enable full node operators a way to bootstrap a full node without having to execute all the transactions that occurred after genesis. You can upload snapshots to remote object stores like S3, Google Cloud Storage, Azure Blob Storage, and similar services. These services typically run the export process in the background so there is no degradation in performance for your full node. With snapshots stored in the cloud, you're more easily able to recover quickly from catastrophic failures in your system or hardware. To maintain a healthy IOTA network, IOTA encourages the IOTA community to bring up additional snapshots to ensure stronger data availability across the network. @@ -25,8 +25,8 @@ Formal snapshots are not suitable for use if you are running an RPC node that do ::: -You can configure a Full node snapshot to generate a state snapshot at the end of each epoch. -A single Full node can generate RocksDB snapshots, Formal snapshots, or both. +You can configure a full node snapshot to generate a state snapshot at the end of each epoch. +A single full node can generate RocksDB snapshots, Formal snapshots, or both. ## Formal snapshots @@ -36,9 +36,9 @@ Formal snapshots provide a mechanism for a node to restore to a canonical state 1. **Agnosticism:** Formal snapshots are by nature agnostic to the underlying database choice or implementation of the protocol. As the live object set is protocol defined, so is the formal snapshot. 1. **Verifiability:** Formal snapshots have first-class support in the core IOTA protocol. As such, they must be trustless/verifiable by the node operator upon download. To support this, the protocol signs a commitment to the live object state at end of epoch, which formal snapshots are checked against at restore time. If this verification fails, the node state is moved back to the state before the snapshot restore attempt. -Because these snapshots do not contain indexes, they are most immediately useful for validators and state sync Full nodes (SSFNs). You can upload snapshots to remote object stores like S3, Google Cloud Storage, Azure Blob Storage, and similar services. These services typically run the export process in the background so there is no degradation in performance for your Full node. With snapshots stored in the cloud, you can recover from catastrophic failures in your system or hardware more efficiently. +Because these snapshots do not contain indexes, they are most immediately useful for validators and state sync full nodes (SSFNs). You can upload snapshots to remote object stores like S3, Google Cloud Storage, Azure Blob Storage, and similar services. These services typically run the export process in the background so there is no degradation in performance for your full node. With snapshots stored in the cloud, you can recover from catastrophic failures in your system or hardware more efficiently. -## Restoring a Full node using snapshots +## Restoring a full node using snapshots ### Restoring using RocksDB snapshots @@ -71,7 +71,7 @@ To restore from a RocksDB snapshot, follow these steps: The following environment variables are used if `--no-sign-request` is not set: * *AWS*: `AWS_SNAPSHOT_ACCESS_KEY_ID`, `AWS_SNAPSHOT_SECRET_ACCESS_KEY`, `AWS_SNAPSHOT_REGION` -1. When using `iota-tool download-db-snapshot` the database is copied to the location you pass to `--path`, in a directory named `epoch_[NUM]`. Move this directory to the `live/` Full node database directory, for example `/opt/iota/db/authorities_db/full_node_db/live`. +1. When using `iota-tool download-db-snapshot` the database is copied to the location you pass to `--path`, in a directory named `epoch_[NUM]`. Move this directory to the `live/` full node database directory, for example `/opt/iota/db/authorities_db/full_node_db/live`. 1. Make sure you update the ownership of the downloaded directory to the `iota` user (or whichever linux user you run `iota-node` as): `sudo chown -R iota:iota /opt/iota/db/authorities_db/full_node_db/live`. @@ -79,7 +79,7 @@ To restore from a RocksDB snapshot, follow these steps: :::info -When you restore a Full node from a snapshot, write it to the path `/opt/iota/db/authorities_db/full_node_db/live`. To restore a Validator node, use the path `/opt/iota/db/authorities_db/live`. +When you restore a full node from a snapshot, write it to the path `/opt/iota/db/authorities_db/full_node_db/live`. To restore a Validator node, use the path `/opt/iota/db/authorities_db/live`. ::: @@ -126,9 +126,9 @@ Devnet: `s3://iota-rebased-devnet-snapshots/`, `s3://iota-rebased-devnet-formal ## Enabling snapshots -Full nodes do not take snapshots by default. To enable this feature you must apply specific configs to your Full node. +full nodes do not take snapshots by default. To enable this feature you must apply specific configs to your full node. -Follow these steps to change the configs for a Full node: +Follow these steps to change the configs for a full node: 1. Stop your node, if it's running. 2. Open your fullnode.yaml config file and apply config updates as the following sections show. diff --git a/docs/content/operator/validator-config.mdx b/docs/content/operator/validator-config.mdx index 29b0c05e794..34032f2423a 100644 --- a/docs/content/operator/validator-config.mdx +++ b/docs/content/operator/validator-config.mdx @@ -8,7 +8,7 @@ import Quiz from '@site/src/components/Quiz'; import questions from '/json/node-operators/validator-config.json'; import ValidatorRequirements from "../_snippets/validator-requirements-tab.mdx" -Validators on the IOTA network run special nodes and have additional tasks and responsibilities beyond those of Full node operators. +Validators on the IOTA network run special nodes and have additional tasks and responsibilities beyond those of full node operators. ## Requirements to run a validator on IOTA diff --git a/docs/content/references/cli/cheatsheet.mdx b/docs/content/references/cli/cheatsheet.mdx index df947804522..c8722bb12ea 100644 --- a/docs/content/references/cli/cheatsheet.mdx +++ b/docs/content/references/cli/cheatsheet.mdx @@ -29,11 +29,11 @@ The cheat sheet highlights common IOTA CLI commands. <td class="w-1/3">List the addresses, their aliases, and the active address</td> </tr> <tr> - <td class="w-2/3">`iota client new-address ed25519`</td> + <td class="w-2/3">`iota client new-address --key-scheme ed25519`</td> <td class="w-1/3">Create a new address with ED25519 scheme</td> </tr> <tr> - <td class="w-2/3">`iota client new-address ed25519 MY_ALIAS`</td> + <td class="w-2/3">`iota client new-address --key-scheme ed25519 --alias MY_ALIAS`</td> <td class="w-1/3">Create a new address with ED25519 scheme and alias</td> </tr> <tr> @@ -195,7 +195,7 @@ The cheat sheet highlights common IOTA CLI commands. <td class="w-1/3">Transfer 0.1 IOTA to an address and use the same coin for gas</td> </tr> <tr> - <td class="w-2/3">`iota client transfer-iota \`<br/>  `--iota-coin-object-id COIN_ID \`<br/>  `--to ADDRESS`</td> + <td class="w-2/3">`iota client pay-all-iota \`<br/>  `--input-coins COIN_ID \`<br/>  `--recipient ADDRESS \`<br/>  `--gas-budget 2000000`</td> <td class="w-1/3">Transfer IOTA object to an address and use the same coin for gas</td> </tr> </tbody> diff --git a/docs/content/references/cli/client.mdx b/docs/content/references/cli/client.mdx index 366e626eb78..0ede2dd071b 100644 --- a/docs/content/references/cli/client.mdx +++ b/docs/content/references/cli/client.mdx @@ -30,8 +30,8 @@ Commands: faucet Request gas coin from faucet. By default, it will use the active address and the active network gas Obtain all gas objects owned by the address. An address' alias can be used instead of the address merge-coin Merge two coin objects into one coin - new-address Generate new address and keypair with keypair scheme flag {ed25519 | secp256k1 | secp256r1} with optional derivation path, default to m/44'/4218'/0'/0'/0' for ed25519 or m/54'/4218'/0'/0/0 - for secp256k1 or m/74'/4218'/0'/0/0 for secp256r1. Word length can be { word12 | word15 | word18 | word21 | word24} default to word12 if not specified + new-address Generate new address and keypair with optional key scheme {ed25519 | secp256k1 | secp256r1} which defaults to ed25519, optional alias which defaults to a random one, optional word length { word12 | word15 | word18 | word21 | + word24} which defaults to word12, and optional derivation path which defaults to m/44'/4218'/0'/0'/0' for ed25519, m/54'/4218'/0'/0/0 for secp256k1 or m/74'/4218'/0'/0/0 for secp256r1 new-env Add new IOTA environment object Get object info objects Obtain all objects owned by the address. It also accepts an address by its alias @@ -45,7 +45,6 @@ Commands: switch Switch active address and env (e.g. testnet, devnet, localnet, ...) tx-block Get a transaction block with the effects, events and object changes of its execution transfer Transfer object - transfer-iota Transfer IOTA, and pay gas with the same IOTA coin object. If amount is specified, only the amount is transferred; otherwise the entire object is transferred upgrade Upgrade Move modules verify-bytecode-meter Run the bytecode verifier on the package verify-source Verify local Move packages against on-chain packages, and optionally their dependencies @@ -202,14 +201,13 @@ $ iota client dynamic-field 0x5 ### Send IOTA or objects In this example, let's see how to transfer IOTA or transfer an object from one address to another. First of all, there two main commands for sending IOTA or transferring objects: `pay` and `transfer`. -Both `pay` and `transfer` have a few sister commands: `pay-iota`, `pay-all-iota`, `transfer-iota`. +The `pay` command has two related commands: `pay-iota`, `pay-all-iota`. The differences between these commands are: - commands that end in `-iota` deal with Iota's native coin, and they use the input coints to pay for gas and for transferring IOTA or the object. - `pay-` commands typically deal with coins and handle (coin merging)[../../developer/iota-101/transactions/ptb/optimizing-gas-with-coin-merging.mdx] for you, whereas `transfer` commands can handle the transfer of any object that has public transfer, meaning any object that has the `store` ability. - `pay` commands allow you to send coins to multiple recipients, whereas `transfer` commands only accept one recipient. - `pay-all-iota` is a special case of `pay-iota` that offers a way to transfer the entire balance after smashing. -- `transfer-iota` is a legacy command and has been entirely superseded by `pay-iota` or `pay-all-iota` depending on whether an amount is specified or not. Assume you have two addresses: @@ -237,7 +235,7 @@ iota client gas hungry-spodumene ╰────────────────────────────────────────────────────────────────────┴────────────────────┴──────────────────╯ ``` -You want to send 0.5 IOTA to `eloquent-amber`. Given that you have a few gas coins, you can use `pay`. If only one gas coin exists, then you need to use `transfer-iota` or `pay-iota`, or you would need to split the coin first to have another coin to use for paying gas. In this case, let's use the `pay-iota` command as you do not need to provide a separate gas coin to be used for the gas fees. In the command below, you set the recipient to be `eloquent-amber`, which coin to use to transfer IOTA from, and the amount of IOTA to transfer. +You want to send 0.5 IOTA to `eloquent-amber`. Given that you have a few gas coins, you can use `pay`. If only one gas coin exists, then you need to use `pay-iota`, or you would need to split the coin first to have another coin to use for paying gas. In this case, let's use the `pay-iota` command as you do not need to provide a separate gas coin to be used for the gas fees. In the command below, you set the recipient to be `eloquent-amber`, which coin to use to transfer IOTA from, and the amount of IOTA to transfer. ``` iota client pay-iota --recipients eloquent-amber --input-coins 0xc9b447fff18f13fa035e028534b8344d5fc8a8760248fad10155e78f44dc3a52 --amounts 500000000 @@ -391,11 +389,9 @@ iota client gas eloquent-amber ╰────────────────────────────────────────────────────────────────────┴────────────────────┴──────────────────╯ ``` -If you want to transfer the whole object, you can use `iota client pay-all-iota` or `iota client transfer-iota` (without passing the amount): +If you want to transfer the whole object, you can use `iota client pay-all-iota` (without passing the amount): ``` -iota client pay-iota --recipient eloquent-amber --input-coins 0xc9b447fff18f13fa035e028534b8344d5fc8a8760248fad10155e78f44dc3a52 -or -iota client transfer-iota --to eloquent-amber --iota-coin-object-id 0xc9b447fff18f13fa035e028534b8344d5fc8a8760248fad10155e78f44dc3a52 +iota client pay-all-iota --recipient eloquent-amber --input-coins 0xc9b447fff18f13fa035e028534b8344d5fc8a8760248fad10155e78f44dc3a52 --gas-budget 2000000 ``` Then check the gas for `eloquent-amber` again: @@ -469,7 +465,7 @@ will verify that all transactions local execution results match the effects on-c Use the `iota client profile-transaction --tx-digest <TRANSACTION-DIGEST>` command to re-execute a transaction locally and produce a gas profile. Similar to the `replay` command, this command fetches the transaction dependencies from the -Full node specified in the client environment that are needed to execute the transaction. During the local execution of the transaction, +full node specified in the client environment that are needed to execute the transaction. During the local execution of the transaction, this command records all the Move function invocations and the gas cost breakdown for each invocation. To enable the profiler, you must either install or build the IOTA Client binary locally with the `--features gas-profiler` flag. diff --git a/docs/content/references/event-query-and-subscription.mdx b/docs/content/references/event-query-and-subscription.mdx index 3390e6617d3..b4ffdd40869 100644 --- a/docs/content/references/event-query-and-subscription.mdx +++ b/docs/content/references/event-query-and-subscription.mdx @@ -2,7 +2,7 @@ title: Event Query and Subscription --- -IOTA Full nodes support publish/subscribe using JSON-RPC notifications via the WebSocket API. You can use this service with IOTA client to filter and subscribe to a real-time event stream generated from Move or from the IOTA network. +IOTA full nodes support publish/subscribe using JSON-RPC notifications via the WebSocket API. You can use this service with IOTA client to filter and subscribe to a real-time event stream generated from Move or from the IOTA network. The client provides an [event filter](#event-filters) to limit the scope of events. IOTA returns a notification with the event data and subscription ID for each event that matches the filter. diff --git a/docs/content/references/exchange-integration-guide.mdx b/docs/content/references/exchange-integration-guide.mdx index 678767a2ec2..4b39392f9a2 100644 --- a/docs/content/references/exchange-integration-guide.mdx +++ b/docs/content/references/exchange-integration-guide.mdx @@ -10,19 +10,19 @@ This topic describes how to integrate IOTA, the token native to the IOTA network The requirements to configure a IOTA integration include: -- A IOTA Full node. You can operate your own IOTA Full node or use a Full node from a node operator. -- Suggested minimum hardware to run a IOTA Full node: +- A IOTA full node. You can operate your own IOTA full node or use a full node from a node operator. +- Suggested minimum hardware to run a IOTA full node: - CPUs: 8 physical cores / 16 vCPUs - RAM: 128 GB - Storage (SSD): 4 TB NVMe drive -For best results, run IOTA Full nodes on Linux. IOTA supports the Ubuntu and Debian distributions. You can also fun a Full node on macOS. +For best results, run IOTA full nodes on Linux. IOTA supports the Ubuntu and Debian distributions. You can also fun a full node on macOS. -## Configure a IOTA Full node +## Configure a IOTA full node -You can set up and configure a IOTA Full node using Docker or directly from source code in the IOTA GitHub repository. +You can set up and configure a IOTA full node using Docker or directly from source code in the IOTA GitHub repository. -### Install a IOTA Full node using Docker +### Install a IOTA full node using Docker Run the command in this section using the same branch of the repository for each. Replace `branch-name` with the branch you use. For example, use `devnet` to use the IOTA Devnet network, or use `testnet` to use the IOTA Testnet network. You must download all files to, and run all commands from, the same folder location. @@ -49,14 +49,14 @@ Run the command in this section using the same branch of the repository for each ```bash wget https://dbfiles.testnet.iota.cafe/genesis.blob ``` -1. Start the Full node. The -d switch starts it in the background (detached mode). +1. Start the full node. The -d switch starts it in the background (detached mode). ```bash docker-compose up -d ``` -## Install a IOTA Full node from source +## Install a IOTA full node from source -Use the steps in this section to install and configure a IOTA Full node directly from the IOTA GitHub repository. These steps use [Cargo](https://doc.rust-lang.org/cargo/), the Rust package manager. +Use the steps in this section to install and configure a IOTA full node directly from the IOTA GitHub repository. These steps use [Cargo](https://doc.rust-lang.org/cargo/), the Rust package manager. 1. Install prerequisites for IOTA. 1. Clone the IOTA repository: @@ -80,7 +80,7 @@ Use the steps in this section to install and configure a IOTA Full node directly 1. Optionally, if you installed IOTA to a path other than the default, modify the fullnode.yaml file to use the path you used. Update the path to the folder where you installed iota-fullnode for the `db-path` and `genesis-file-location` as appropriate: `db-path: "/db-files/iota-fullnode-folder"` `genesis-file-location: "/iota-fullnode-folder/genesis.blob"` -1. Start you IOTA Full node: +1. Start you IOTA full node: ```bash cargo run --release --bin iota-node -- --config-path fullnode.yaml ``` @@ -111,7 +111,7 @@ IOTA supports both addresses with and without a 0x prefix. IOTA recommends that You can track balance changes by calling `iota_getBalance` at predefined intervals. This call returns the total balance for an address. The total includes any coin or token type, but this document focuses on IOTA. You can track changes in the total balance for an address between subsequent `iota_getBalance` requests. -The following bash example demonstrates how to use `iota_getBalance` for address 0x849d63687330447431a2e76fecca4f3c10f6884ebaa9909674123c6c662612a3. If you use a network other than Devnet, replace the value for `rpc` with the URL to the appropriate Full node. +The following bash example demonstrates how to use `iota_getBalance` for address 0x849d63687330447431a2e76fecca4f3c10f6884ebaa9909674123c6c662612a3. If you use a network other than Devnet, replace the value for `rpc` with the URL to the appropriate full node. ```bash rpc="https://api.devnet.iota.cafe:443" diff --git a/docs/content/references/iota-graphql.mdx b/docs/content/references/iota-graphql.mdx index 1e1ca11bf4c..cefbb5b5fc2 100644 --- a/docs/content/references/iota-graphql.mdx +++ b/docs/content/references/iota-graphql.mdx @@ -3,7 +3,7 @@ title: GraphQL for IOTA RPC description: GraphQL is a public service for the IOTA RPC that enables you to efficiently interact with the IOTA network. --- -GraphQL for the IOTA RPC is a public service that enables interacting with the IOTA [network](https://iota.io/networkinfo). +GraphQL for the IOTA RPC is a public service that enables interacting with the IOTA [network](https://iota.org). To get started with GraphQL for the IOTA RPC, check out the [Getting Started](../developer/getting-started/graphql-rpc.mdx) guide. If you'd like to learn more about the concepts used in the GraphQL service, check out the [GraphQL](../developer/graphql-rpc.mdx) for IOTA RPC concepts page. diff --git a/docs/content/references/references.mdx b/docs/content/references/references.mdx index 9af3db0656b..e35a506b465 100644 --- a/docs/content/references/references.mdx +++ b/docs/content/references/references.mdx @@ -48,7 +48,7 @@ Access IOTA Move functions on chain using the IOTA Move CLI. Official software development kits (SDKs) available for IOTA include the TypeScript SDK and Rust SDK. <Cards> -<Card title="IOTA TypeScript SDK" href="/references/ts-sdk/typescript"> +<Card title="IOTA TypeScript SDK" href="/ts-sdk/typescript"> The IOTA TypeScript SDK has its own microsite. Click this box to go there. </Card> <Card title="IOTA Rust SDK" href="/references/rust-sdk"/> diff --git a/docs/content/sidebars/developer.js b/docs/content/sidebars/developer.js index d1500f346fc..59e601c93ff 100644 --- a/docs/content/sidebars/developer.js +++ b/docs/content/sidebars/developer.js @@ -55,7 +55,7 @@ const developer = [ { type: 'link', label: 'Typescript SDK', - href: '/references/ts-sdk/typescript', + href: '/ts-sdk/typescript', }, ], }, @@ -296,6 +296,7 @@ const developer = [ id: 'developer/iota-move-ctf/introduction', }, items: [ + 'developer/iota-move-ctf/challenge_0', 'developer/iota-move-ctf/challenge_1', 'developer/iota-move-ctf/challenge_2', 'developer/iota-move-ctf/challenge_3', diff --git a/docs/content/sidebars/ts-sdk.js b/docs/content/sidebars/ts-sdk.js index 6951b07e0f4..66c95ad3456 100644 --- a/docs/content/sidebars/ts-sdk.js +++ b/docs/content/sidebars/ts-sdk.js @@ -2,49 +2,49 @@ // Modifications Copyright (c) 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -import typedocSidebar from '../references/ts-sdk/api/typedoc-sidebar.cjs'; +import typedocSidebar from '../ts-sdk/api/typedoc-sidebar.cjs'; const tsSDK = [ { type: 'category', label: 'Typescript SDK', items: [ - 'references/ts-sdk/typescript/index', - 'references/ts-sdk/typescript/install', - 'references/ts-sdk/typescript/hello-iota', - 'references/ts-sdk/typescript/faucet', - 'references/ts-sdk/typescript/iota-client', - 'references/ts-sdk/typescript/graphql', + 'ts-sdk/typescript/index', + 'ts-sdk/typescript/install', + 'ts-sdk/typescript/hello-iota', + 'ts-sdk/typescript/faucet', + 'ts-sdk/typescript/iota-client', + 'ts-sdk/typescript/graphql', { type: 'category', label: 'Transaction Building', items: [ - 'references/ts-sdk/typescript/transaction-building/basics', - 'references/ts-sdk/typescript/transaction-building/gas', - 'references/ts-sdk/typescript/transaction-building/sponsored-transactions', - 'references/ts-sdk/typescript/transaction-building/offline', + 'ts-sdk/typescript/transaction-building/basics', + 'ts-sdk/typescript/transaction-building/gas', + 'ts-sdk/typescript/transaction-building/sponsored-transactions', + 'ts-sdk/typescript/transaction-building/offline', ], }, { type: 'category', label: 'Cryptography', items: [ - 'references/ts-sdk/typescript/cryptography/keypairs', - 'references/ts-sdk/typescript/cryptography/multisig', + 'ts-sdk/typescript/cryptography/keypairs', + 'ts-sdk/typescript/cryptography/multisig', ], }, - 'references/ts-sdk/typescript/utils', - 'references/ts-sdk/typescript/bcs', - 'references/ts-sdk/typescript/executors', - 'references/ts-sdk/typescript/plugins', + 'ts-sdk/typescript/utils', + 'ts-sdk/typescript/bcs', + 'ts-sdk/typescript/executors', + 'ts-sdk/typescript/plugins', { type: 'category', label: 'Owned Object Pool', items: [ - 'references/ts-sdk/typescript/owned-object-pool/index', - 'references/ts-sdk/typescript/owned-object-pool/overview', - 'references/ts-sdk/typescript/owned-object-pool/local-development', - 'references/ts-sdk/typescript/owned-object-pool/custom-split-strategy', - 'references/ts-sdk/typescript/owned-object-pool/examples', + 'ts-sdk/typescript/owned-object-pool/index', + 'ts-sdk/typescript/owned-object-pool/overview', + 'ts-sdk/typescript/owned-object-pool/local-development', + 'ts-sdk/typescript/owned-object-pool/custom-split-strategy', + 'ts-sdk/typescript/owned-object-pool/examples', ], }, ], @@ -53,81 +53,81 @@ const tsSDK = [ type: 'category', label: 'dApp Kit', items: [ - 'references/ts-sdk/dapp-kit/index', - 'references/ts-sdk/dapp-kit/create-dapp', - 'references/ts-sdk/dapp-kit/iota-client-provider', - 'references/ts-sdk/dapp-kit/rpc-hooks', - 'references/ts-sdk/dapp-kit/wallet-provider', + 'ts-sdk/dapp-kit/index', + 'ts-sdk/dapp-kit/create-dapp', + 'ts-sdk/dapp-kit/iota-client-provider', + 'ts-sdk/dapp-kit/rpc-hooks', + 'ts-sdk/dapp-kit/wallet-provider', { type: 'category', label: 'Wallet Components', items: [ - 'references/ts-sdk/dapp-kit/wallet-components/ConnectButton', - 'references/ts-sdk/dapp-kit/wallet-components/ConnectModal', + 'ts-sdk/dapp-kit/wallet-components/ConnectButton', + 'ts-sdk/dapp-kit/wallet-components/ConnectModal', ], }, { type: 'category', label: 'Wallet Hooks', items: [ - 'references/ts-sdk/dapp-kit/wallet-hooks/useWallets', - 'references/ts-sdk/dapp-kit/wallet-hooks/useAccounts', - 'references/ts-sdk/dapp-kit/wallet-hooks/useCurrentWallet', - 'references/ts-sdk/dapp-kit/wallet-hooks/useCurrentAccount', - 'references/ts-sdk/dapp-kit/wallet-hooks/useAutoConnectWallet', - 'references/ts-sdk/dapp-kit/wallet-hooks/useConnectWallet', - 'references/ts-sdk/dapp-kit/wallet-hooks/useDisconnectWallet', - 'references/ts-sdk/dapp-kit/wallet-hooks/useSwitchAccount', - 'references/ts-sdk/dapp-kit/wallet-hooks/useReportTransactionEffects', - 'references/ts-sdk/dapp-kit/wallet-hooks/useSignPersonalMessage', - 'references/ts-sdk/dapp-kit/wallet-hooks/useSignTransaction', - 'references/ts-sdk/dapp-kit/wallet-hooks/useSignAndExecuteTransaction', + 'ts-sdk/dapp-kit/wallet-hooks/useWallets', + 'ts-sdk/dapp-kit/wallet-hooks/useAccounts', + 'ts-sdk/dapp-kit/wallet-hooks/useCurrentWallet', + 'ts-sdk/dapp-kit/wallet-hooks/useCurrentAccount', + 'ts-sdk/dapp-kit/wallet-hooks/useAutoConnectWallet', + 'ts-sdk/dapp-kit/wallet-hooks/useConnectWallet', + 'ts-sdk/dapp-kit/wallet-hooks/useDisconnectWallet', + 'ts-sdk/dapp-kit/wallet-hooks/useSwitchAccount', + 'ts-sdk/dapp-kit/wallet-hooks/useReportTransactionEffects', + 'ts-sdk/dapp-kit/wallet-hooks/useSignPersonalMessage', + 'ts-sdk/dapp-kit/wallet-hooks/useSignTransaction', + 'ts-sdk/dapp-kit/wallet-hooks/useSignAndExecuteTransaction', ], }, - 'references/ts-sdk/dapp-kit/themes', + 'ts-sdk/dapp-kit/themes', ], }, { type: 'category', label: 'Kiosk SDK', items: [ - 'references/ts-sdk/kiosk/index', + 'ts-sdk/kiosk/index', { type: 'category', label: 'Kiosk Client', items: [ - 'references/ts-sdk/kiosk/kiosk-client/introduction', - 'references/ts-sdk/kiosk/kiosk-client/querying', + 'ts-sdk/kiosk/kiosk-client/introduction', + 'ts-sdk/kiosk/kiosk-client/querying', { type: 'category', label: 'Kiosk Transactions', items: [ - 'references/ts-sdk/kiosk/kiosk-client/kiosk-transaction/kiosk-transaction', - 'references/ts-sdk/kiosk/kiosk-client/kiosk-transaction/managing', - 'references/ts-sdk/kiosk/kiosk-client/kiosk-transaction/purchasing', - 'references/ts-sdk/kiosk/kiosk-client/kiosk-transaction/examples', + 'ts-sdk/kiosk/kiosk-client/kiosk-transaction/kiosk-transaction', + 'ts-sdk/kiosk/kiosk-client/kiosk-transaction/managing', + 'ts-sdk/kiosk/kiosk-client/kiosk-transaction/purchasing', + 'ts-sdk/kiosk/kiosk-client/kiosk-transaction/examples', ], }, { type: 'category', label: 'Transfer Policy Transactions', items: [ - 'references/ts-sdk/kiosk/kiosk-client/transfer-policy-transaction/introduction', - 'references/ts-sdk/kiosk/kiosk-client/transfer-policy-transaction/using-the-manager', + 'ts-sdk/kiosk/kiosk-client/transfer-policy-transaction/introduction', + 'ts-sdk/kiosk/kiosk-client/transfer-policy-transaction/using-the-manager', ], }, ], }, - 'references/ts-sdk/kiosk/advanced-examples', + 'ts-sdk/kiosk/advanced-examples', ], }, - 'references/ts-sdk/bcs', + 'ts-sdk/bcs', { type: 'category', label: 'API', link: { type: 'doc', - id: 'references/ts-sdk/api/index', + id: 'ts-sdk/api/index', }, items: typedocSidebar, }, diff --git a/docs/content/ts-sdk/api/bcs/classes/BcsType.md b/docs/content/ts-sdk/api/bcs/classes/BcsType.md new file mode 100644 index 00000000000..37bc2ca6fc2 --- /dev/null +++ b/docs/content/ts-sdk/api/bcs/classes/BcsType.md @@ -0,0 +1,186 @@ +# Class: BcsType\<T, Input\> + +## Type Parameters + +- **T** +- **Input** = `T` + +## Constructors + +### new BcsType() + +> **new BcsType**\<`T`, `Input`\>(`options`): [`BcsType`](BcsType.md)\<`T`, `Input`\> + +#### Parameters + +- **options**: `object` & [`BcsTypeOptions`](../interfaces/BcsTypeOptions.md)\<`T`, `Input`\> + +#### Returns + +[`BcsType`](BcsType.md)\<`T`, `Input`\> + +## Properties + +### $inferType + +> **$inferType**: `T` + +--- + +### $inferInput + +> **$inferInput**: `Input` + +--- + +### name + +> **name**: `string` + +--- + +### read() + +> **read**: (`reader`) => `T` + +#### Parameters + +- **reader**: `BcsReader` + +#### Returns + +`T` + +--- + +### serializedSize() + +> **serializedSize**: (`value`, `options`?) => `null` \| `number` + +#### Parameters + +- **value**: `Input` +- **options?**: `BcsWriterOptions` + +#### Returns + +`null` \| `number` + +--- + +### validate() + +> **validate**: (`value`) => `void` + +#### Parameters + +- **value**: `Input` + +#### Returns + +`void` + +## Methods + +### write() + +> **write**(`value`, `writer`): `void` + +#### Parameters + +- **value**: `Input` +- **writer**: `BcsWriter` + +#### Returns + +`void` + +--- + +### serialize() + +> **serialize**(`value`, `options`?): `SerializedBcs`\<`T`, `Input`\> + +#### Parameters + +- **value**: `Input` +- **options?**: `BcsWriterOptions` + +#### Returns + +`SerializedBcs`\<`T`, `Input`\> + +--- + +### parse() + +> **parse**(`bytes`): `T` + +#### Parameters + +- **bytes**: `Uint8Array` + +#### Returns + +`T` + +--- + +### fromHex() + +> **fromHex**(`hex`): `T` + +#### Parameters + +- **hex**: `string` + +#### Returns + +`T` + +--- + +### fromBase58() + +> **fromBase58**(`b64`): `T` + +#### Parameters + +- **b64**: `string` + +#### Returns + +`T` + +--- + +### fromBase64() + +> **fromBase64**(`b64`): `T` + +#### Parameters + +- **b64**: `string` + +#### Returns + +`T` + +--- + +### transform() + +> **transform**\<`T2`, `Input2`\>(`__namedParameters`): [`BcsType`](BcsType.md)\<`T2`, `Input2`\> + +#### Type Parameters + +- **T2** +- **Input2** + +#### Parameters + +- **\_\_namedParameters**: `object` & [`BcsTypeOptions`](../interfaces/BcsTypeOptions.md)\<`T2`, `Input2`\> + +#### Returns + +[`BcsType`](BcsType.md)\<`T2`, `Input2`\> diff --git a/docs/content/ts-sdk/api/bcs/classes/TypeTagSerializer.md b/docs/content/ts-sdk/api/bcs/classes/TypeTagSerializer.md new file mode 100644 index 00000000000..b29c5013521 --- /dev/null +++ b/docs/content/ts-sdk/api/bcs/classes/TypeTagSerializer.md @@ -0,0 +1,57 @@ +# Class: TypeTagSerializer + +## Constructors + +### new TypeTagSerializer() + +> **new TypeTagSerializer**(): [`TypeTagSerializer`](TypeTagSerializer.md) + +#### Returns + +[`TypeTagSerializer`](TypeTagSerializer.md) + +## Methods + +### parseFromStr() + +> `static` **parseFromStr**(`str`, `normalizeAddress`): [`TypeTag`](../type-aliases/TypeTag.md) + +#### Parameters + +• **str**: `string` + +• **normalizeAddress**: `boolean` = `false` + +#### Returns + +[`TypeTag`](../type-aliases/TypeTag.md) + +--- + +### parseStructTypeArgs() + +> `static` **parseStructTypeArgs**(`str`, `normalizeAddress`): [`TypeTag`](../type-aliases/TypeTag.md)[] + +#### Parameters + +• **str**: `string` + +• **normalizeAddress**: `boolean` = `false` + +#### Returns + +[`TypeTag`](../type-aliases/TypeTag.md)[] + +--- + +### tagToString() + +> `static` **tagToString**(`tag`): `string` + +#### Parameters + +• **tag**: [`TypeTag`](../type-aliases/TypeTag.md) + +#### Returns + +`string` diff --git a/docs/content/ts-sdk/api/bcs/index.md b/docs/content/ts-sdk/api/bcs/index.md new file mode 100644 index 00000000000..524ad590c73 --- /dev/null +++ b/docs/content/ts-sdk/api/bcs/index.md @@ -0,0 +1,20 @@ +# bcs + +## Index + +### Classes + +- [BcsType](classes/BcsType.md) +- [TypeTagSerializer](classes/TypeTagSerializer.md) + +### Interfaces + +- [BcsTypeOptions](interfaces/BcsTypeOptions.md) + +### Type Aliases + +- [TypeTag](type-aliases/TypeTag.md) + +### Variables + +- [bcs](variables/bcs.md) diff --git a/docs/content/ts-sdk/api/bcs/interfaces/BcsTypeOptions.md b/docs/content/ts-sdk/api/bcs/interfaces/BcsTypeOptions.md new file mode 100644 index 00000000000..7b1a0011ae1 --- /dev/null +++ b/docs/content/ts-sdk/api/bcs/interfaces/BcsTypeOptions.md @@ -0,0 +1,27 @@ +# Interface: BcsTypeOptions\<T, Input\> + +## Type Parameters + +• **T** + +• **Input** = `T` + +## Properties + +### name? + +> `optional` **name**: `string` + +--- + +### validate()? + +> `optional` **validate**: (`value`) => `void` + +#### Parameters + +• **value**: `Input` + +#### Returns + +`void` diff --git a/docs/content/ts-sdk/api/bcs/type-aliases/TypeTag.md b/docs/content/ts-sdk/api/bcs/type-aliases/TypeTag.md new file mode 100644 index 00000000000..a91445adba0 --- /dev/null +++ b/docs/content/ts-sdk/api/bcs/type-aliases/TypeTag.md @@ -0,0 +1,5 @@ +# Type Alias: TypeTag + +> **TypeTag**: `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` + +IOTA TypeTag object. A decoupled `0x...::module::Type<???>` parameter. diff --git a/docs/content/ts-sdk/api/bcs/variables/bcs.md b/docs/content/ts-sdk/api/bcs/variables/bcs.md new file mode 100644 index 00000000000..1e9047ef16d --- /dev/null +++ b/docs/content/ts-sdk/api/bcs/variables/bcs.md @@ -0,0 +1,1455 @@ +# Variable: bcs + +> `const` **bcs**: `object` + +## Type declaration + +### u8() + +Creates a BcsType that can be used to read and write an 8-bit unsigned integer. + +#### Parameters + +• **options?**: [`BcsTypeOptions`](../interfaces/BcsTypeOptions.md)\<`number`, `number`\> + +#### Returns + +[`BcsType`](../classes/BcsType.md)\<`number`, `number`\> + +#### Example + +```ts +bcs.u8().serialize(255).toBytes() // Uint8Array [ 255 ] +``` + +### u16() + +Creates a BcsType that can be used to read and write a 16-bit unsigned integer. + +#### Parameters + +• **options?**: [`BcsTypeOptions`](../interfaces/BcsTypeOptions.md)\<`number`, `number`\> + +#### Returns + +[`BcsType`](../classes/BcsType.md)\<`number`, `number`\> + +#### Example + +```ts +bcs.u16().serialize(65535).toBytes() // Uint8Array [ 255, 255 ] +``` + +### u32() + +Creates a BcsType that can be used to read and write a 32-bit unsigned integer. + +#### Parameters + +• **options?**: [`BcsTypeOptions`](../interfaces/BcsTypeOptions.md)\<`number`, `number`\> + +#### Returns + +[`BcsType`](../classes/BcsType.md)\<`number`, `number`\> + +#### Example + +```ts +bcs.u32().serialize(4294967295).toBytes() // Uint8Array [ 255, 255, 255, 255 ] +``` + +### u64() + +Creates a BcsType that can be used to read and write a 64-bit unsigned integer. + +#### Parameters + +• **options?**: [`BcsTypeOptions`](../interfaces/BcsTypeOptions.md)\<`string`, `string` \| `number` \| `bigint`\> + +#### Returns + +[`BcsType`](../classes/BcsType.md)\<`string`, `string` \| `number` \| `bigint`\> + +#### Example + +```ts +bcs.u64().serialize(1).toBytes() // Uint8Array [ 1, 0, 0, 0, 0, 0, 0, 0 ] +``` + +### u128() + +Creates a BcsType that can be used to read and write a 128-bit unsigned integer. + +#### Parameters + +• **options?**: [`BcsTypeOptions`](../interfaces/BcsTypeOptions.md)\<`string`, `string` \| `number` \| `bigint`\> + +#### Returns + +[`BcsType`](../classes/BcsType.md)\<`string`, `string` \| `number` \| `bigint`\> + +#### Example + +```ts +bcs.u128().serialize(1).toBytes() // Uint8Array [ 1, ..., 0 ] +``` + +### u256() + +Creates a BcsType that can be used to read and write a 256-bit unsigned integer. + +#### Parameters + +• **options?**: [`BcsTypeOptions`](../interfaces/BcsTypeOptions.md)\<`string`, `string` \| `number` \| `bigint`\> + +#### Returns + +[`BcsType`](../classes/BcsType.md)\<`string`, `string` \| `number` \| `bigint`\> + +#### Example + +```ts +bcs.u256().serialize(1).toBytes() // Uint8Array [ 1, ..., 0 ] +``` + +### bool() + +Creates a BcsType that can be used to read and write boolean values. + +#### Parameters + +• **options?**: [`BcsTypeOptions`](../interfaces/BcsTypeOptions.md)\<`boolean`, `boolean`\> + +#### Returns + +[`BcsType`](../classes/BcsType.md)\<`boolean`, `boolean`\> + +#### Example + +```ts +bcs.bool().serialize(true).toBytes() // Uint8Array [ 1 ] +``` + +### uleb128() + +Creates a BcsType that can be used to read and write unsigned LEB encoded integers + +#### Parameters + +• **options?**: [`BcsTypeOptions`](../interfaces/BcsTypeOptions.md)\<`number`, `number`\> + +#### Returns + +[`BcsType`](../classes/BcsType.md)\<`number`, `number`\> + +#### Example + +```ts +``` + +### bytes() + +Creates a BcsType representing a fixed length byte array + +#### Type Parameters + +• **T** _extends_ `number` + +#### Parameters + +• **size**: `T` + +The number of bytes this types represents + +• **options?**: [`BcsTypeOptions`](../interfaces/BcsTypeOptions.md)\<`Uint8Array`, `Iterable`\<`number`, `any`, `any`\>\> + +#### Returns + +[`BcsType`](../classes/BcsType.md)\<`Uint8Array`, `Uint8Array`\> + +#### Example + +```ts +bcs.bytes(3).serialize(new Uint8Array([1, 2, 3])).toBytes() // Uint8Array [1, 2, 3] +``` + +### string() + +Creates a BcsType that can ser/de string values. Strings will be UTF-8 encoded + +#### Parameters + +• **options?**: [`BcsTypeOptions`](../interfaces/BcsTypeOptions.md)\<`string`, `string`\> + +#### Returns + +[`BcsType`](../classes/BcsType.md)\<`string`, `string`\> + +#### Example + +```ts +bcs.string().serialize('a').toBytes() // Uint8Array [ 1, 97 ] +``` + +### fixedArray() + +Creates a BcsType that represents a fixed length array of a given type + +#### Type Parameters + +• **T** + +• **Input** + +#### Parameters + +• **size**: `number` + +The number of elements in the array + +• **type**: [`BcsType`](../classes/BcsType.md)\<`T`, `Input`\> + +The BcsType of each element in the array + +• **options?**: [`BcsTypeOptions`](../interfaces/BcsTypeOptions.md)\<`T`[], `Iterable`\<`Input`, `any`, `any`\> & `object`\> + +#### Returns + +[`BcsType`](../classes/BcsType.md)\<`T`[], `Iterable`\<`Input`, `any`, `any`\> & `object`\> + +#### Example + +```ts +bcs.fixedArray(3, bcs.u8()).serialize([1, 2, 3]).toBytes() // Uint8Array [ 1, 2, 3 ] +``` + +### option() + +Creates a BcsType representing an optional value + +#### Type Parameters + +• **T** + +• **Input** + +#### Parameters + +• **type**: [`BcsType`](../classes/BcsType.md)\<`T`, `Input`\> + +The BcsType of the optional value + +#### Returns + +[`BcsType`](../classes/BcsType.md)\<`null` \| `T`, `undefined` \| `null` \| `Input`\> + +#### Example + +```ts +bcs.option(bcs.u8()).serialize(null).toBytes() // Uint8Array [ 0 ] +bcs.option(bcs.u8()).serialize(1).toBytes() // Uint8Array [ 1, 1 ] +``` + +### vector() + +Creates a BcsType representing a variable length vector of a given type + +#### Type Parameters + +• **T** + +• **Input** + +#### Parameters + +• **type**: [`BcsType`](../classes/BcsType.md)\<`T`, `Input`\> + +The BcsType of each element in the vector + +• **options?**: [`BcsTypeOptions`](../interfaces/BcsTypeOptions.md)\<`T`[], `Iterable`\<`Input`, `any`, `any`\> & `object`\> + +#### Returns + +[`BcsType`](../classes/BcsType.md)\<`T`[], `Iterable`\<`Input`, `any`, `any`\> & `object`\> + +#### Example + +```ts +bcs.vector(bcs.u8()).toBytes([1, 2, 3]) // Uint8Array [ 3, 1, 2, 3 ] +``` + +### tuple() + +Creates a BcsType representing a tuple of a given set of types + +#### Type Parameters + +• **Types** _extends_ readonly [`BcsType`](../classes/BcsType.md)\<`any`, `any`\>[] + +#### Parameters + +• **types**: `Types` + +The BcsTypes for each element in the tuple + +• **options?**: [`BcsTypeOptions`](../interfaces/BcsTypeOptions.md)\<\{ -readonly \[K in string \| number \| symbol\]: Types\[K\<K\>\] extends BcsType\<T, any\> ? T : never \}, \{ \[K in string \| number \| symbol\]: Types\[K\<K\>\] extends BcsType\<any, T\> ? T : never \}\> + +#### Returns + +[`BcsType`](../classes/BcsType.md)\<\{ -readonly \[K in string \| number \| symbol\]: Types\[K\<K\>\] extends BcsType\<T, any\> ? T : never \}, \{ \[K\_1 in string \| number \| symbol\]: Types\[K\_1\<K\_1\>\] extends BcsType\<any, T\_1\> ? T\_1 : never \}\> + +#### Example + +```ts +const tuple = bcs.tuple([bcs.u8(), bcs.string(), bcs.bool()]) +tuple.serialize([1, 'a', true]).toBytes() // Uint8Array [ 1, 1, 97, 1 ] +``` + +### struct() + +Creates a BcsType representing a struct of a given set of fields + +#### Type Parameters + +• **T** _extends_ `Record`\<`string`, [`BcsType`](../classes/BcsType.md)\<`any`, `any`\>\> + +#### Parameters + +• **name**: `string` + +The name of the struct + +• **fields**: `T` + +The fields of the struct. The order of the fields affects how data is serialized and deserialized + +• **options?**: `Omit`\<[`BcsTypeOptions`](../interfaces/BcsTypeOptions.md)\<\{ \[K in string \| number \| symbol\]: T\[K\] extends BcsType\<U, any\> ? U : never \}, \{ \[K in string \| number \| symbol\]: T\[K\] extends BcsType\<any, U\> ? U : never \}\>, `"name"`\> + +#### Returns + +[`BcsType`](../classes/BcsType.md)\<\{ \[K in string \| number \| symbol\]: T\[K\] extends BcsType\<U, any\> ? U : never \}, \{ \[K\_1 in string \| number \| symbol\]: T\[K\_1\] extends BcsType\<any, U\_1\> ? U\_1 : never \}\> + +#### Example + +```ts +const struct = bcs.struct('MyStruct', { + a: bcs.u8(), + b: bcs.string(), +}) +struct.serialize({ a: 1, b: 'a' }).toBytes() // Uint8Array [ 1, 1, 97 ] +``` + +### enum() + +Creates a BcsType representing an enum of a given set of options + +#### Type Parameters + +• **T** _extends_ `Record`\<`string`, `null` \| [`BcsType`](../classes/BcsType.md)\<`any`, `any`\>\> + +#### Parameters + +• **name**: `string` + +The name of the enum + +• **values**: `T` + +The values of the enum. The order of the values affects how data is serialized and deserialized. +null can be used to represent a variant with no data. + +• **options?**: `Omit`\<[`BcsTypeOptions`](../interfaces/BcsTypeOptions.md)\<`EnumOutputShape`\<\{ \[K in string \| number \| symbol\]: T\[K\] extends BcsType\<U, any\> ? U : true \}\>, `EnumInputShape`\<\{ \[K in string \| number \| symbol\]: T\[K\] extends BcsType\<any, U\> ? U : null \| boolean \| object \}\>\>, `"name"`\> + +#### Returns + +[`BcsType`](../classes/BcsType.md)\<`EnumOutputShape`\<\{ \[K in string \| number \| symbol\]: T\[K\] extends BcsType\<U, any\> ? U : true \}\>, `EnumInputShape`\<\{ \[K\_1 in string \| number \| symbol\]: T\[K\_1\] extends BcsType\<any, U\_1\> ? U\_1 : null \| boolean \| object \}\>\> + +#### Example + +```ts +const enum = bcs.enum('MyEnum', { + A: bcs.u8(), + B: bcs.string(), + C: null, +}) +enum.serialize({ A: 1 }).toBytes() // Uint8Array [ 0, 1 ] +enum.serialize({ B: 'a' }).toBytes() // Uint8Array [ 1, 1, 97 ] +enum.serialize({ C: true }).toBytes() // Uint8Array [ 2 ] +``` + +### map() + +Creates a BcsType representing a map of a given key and value type + +#### Type Parameters + +• **K** + +• **V** + +• **InputK** = `K` + +• **InputV** = `V` + +#### Parameters + +• **keyType**: [`BcsType`](../classes/BcsType.md)\<`K`, `InputK`\> + +The BcsType of the key + +• **valueType**: [`BcsType`](../classes/BcsType.md)\<`V`, `InputV`\> + +The BcsType of the value + +#### Returns + +[`BcsType`](../classes/BcsType.md)\<`Map`\<`K`, `V`\>, `Map`\<`InputK`, `InputV`\>\> + +#### Example + +```ts +const map = bcs.map(bcs.u8(), bcs.string()) +map.serialize(new Map([[2, 'a']])).toBytes() // Uint8Array [ 1, 2, 1, 97 ] +``` + +### lazy() + +Creates a BcsType that wraps another BcsType which is lazily evaluated. This is useful for creating recursive types. + +#### Type Parameters + +• **T** _extends_ [`BcsType`](../classes/BcsType.md)\<`any`, `any`\> + +#### Parameters + +• **cb** + +A callback that returns the BcsType + +#### Returns + +`T` + +### U8 + +> **U8**: [`BcsType`](../classes/BcsType.md)\<`number`, `number`\> + +### U16 + +> **U16**: [`BcsType`](../classes/BcsType.md)\<`number`, `number`\> + +### U32 + +> **U32**: [`BcsType`](../classes/BcsType.md)\<`number`, `number`\> + +### U64 + +> **U64**: [`BcsType`](../classes/BcsType.md)\<`string`, `string` \| `number` \| `bigint`\> + +### U128 + +> **U128**: [`BcsType`](../classes/BcsType.md)\<`string`, `string` \| `number` \| `bigint`\> + +### U256 + +> **U256**: [`BcsType`](../classes/BcsType.md)\<`string`, `string` \| `number` \| `bigint`\> + +### ULEB128 + +> **ULEB128**: [`BcsType`](../classes/BcsType.md)\<`number`, `number`\> + +### Bool + +> **Bool**: [`BcsType`](../classes/BcsType.md)\<`boolean`, `boolean`\> + +### String + +> **String**: [`BcsType`](../classes/BcsType.md)\<`string`, `string`\> + +### Address + +> **Address**: [`BcsType`](../classes/BcsType.md)\<`string`, `string` \| `Uint8Array`\> + +### AppId + +> **AppId**: [`BcsType`](../classes/BcsType.md)\<`object`, `object`\> + +#### Type declaration + +##### $kind + +> **$kind**: `"Iota"` + +##### Iota + +> **Iota**: `true` = `null` + +### Argument + +> **Argument**: [`BcsType`](../classes/BcsType.md)\<`EnumOutputShapeWithKeys`\<`object`, `"GasCoin"` \| `"Input"` \| `"Result"` \| `"NestedResult"`\>, `EnumInputShape`\<`object`\>\> + +### CallArg + +> **CallArg**: [`BcsType`](../classes/BcsType.md)\<`EnumOutputShapeWithKeys`\<`object`, `"Pure"` \| `"Object"`\>, `EnumInputShape`\<`object`\>\> + +### CompressedSignature + +> **CompressedSignature**: [`BcsType`](../classes/BcsType.md)\<`EnumOutputShapeWithKeys`\<`object`, `"ED25519"` \| `"Secp256k1"` \| `"Secp256r1"`\>, `EnumInputShape`\<`object`\>\> + +### GasData + +> **GasData**: [`BcsType`](../classes/BcsType.md)\<`object`, `object`\> + +#### Type declaration + +##### payment + +> **payment**: `object`[] + +##### owner + +> **owner**: `string` = `Address` + +##### price + +> **price**: `string` + +##### budget + +> **budget**: `string` + +### Intent + +> **Intent**: [`BcsType`](../classes/BcsType.md)\<`object`, `object`\> + +#### Type declaration + +##### scope + +> **scope**: `EnumOutputShapeWithKeys`\<`object`, `"TransactionData"` \| `"TransactionEffects"` \| `"CheckpointSummary"` \| `"PersonalMessage"`\> = `IntentScope` + +###### Type declaration + +###### TransactionData + +> **TransactionData**: `true` = `null` + +###### TransactionEffects + +> **TransactionEffects**: `true` = `null` + +###### CheckpointSummary + +> **CheckpointSummary**: `true` = `null` + +###### PersonalMessage + +> **PersonalMessage**: `true` = `null` + +##### version + +> **version**: `object` = `IntentVersion` + +##### version.$kind + +> **$kind**: `"V0"` + +##### version.V0 + +> **V0**: `true` = `null` + +##### appId + +> **appId**: `object` = `AppId` + +##### appId.$kind + +> **$kind**: `"Iota"` + +##### appId.Iota + +> **Iota**: `true` = `null` + +### IntentMessage() + +> **IntentMessage**: \<`T`\>(`T`) => [`BcsType`](../classes/BcsType.md)\<`object`, `object`\> + +#### Type Parameters + +• **T** _extends_ [`BcsType`](../classes/BcsType.md)\<`any`, `any`\> + +#### Parameters + +• **T**: `T` + +#### Returns + +[`BcsType`](../classes/BcsType.md)\<`object`, `object`\> + +##### intent + +> **intent**: `object` = `Intent` + +##### intent.scope + +> **scope**: `EnumOutputShapeWithKeys`\<`object`, `"TransactionData"` \| `"TransactionEffects"` \| `"CheckpointSummary"` \| `"PersonalMessage"`\> = `IntentScope` + +###### Type declaration + +###### TransactionData + +> **TransactionData**: `true` = `null` + +###### TransactionEffects + +> **TransactionEffects**: `true` = `null` + +###### CheckpointSummary + +> **CheckpointSummary**: `true` = `null` + +###### PersonalMessage + +> **PersonalMessage**: `true` = `null` + +##### intent.version + +> **version**: `object` = `IntentVersion` + +##### intent.version.$kind + +> **$kind**: `"V0"` + +##### intent.version.V0 + +> **V0**: `true` = `null` + +##### intent.appId + +> **appId**: `object` = `AppId` + +##### intent.appId.$kind + +> **$kind**: `"Iota"` + +##### intent.appId.Iota + +> **Iota**: `true` = `null` + +##### value + +> **value**: `T` _extends_ [`BcsType`](../classes/BcsType.md)\<`U`, `any`\> ? `U` : `never` = `T` + +### IntentScope + +> **IntentScope**: [`BcsType`](../classes/BcsType.md)\<`EnumOutputShapeWithKeys`\<`object`, `"TransactionData"` \| `"TransactionEffects"` \| `"CheckpointSummary"` \| `"PersonalMessage"`\>, `EnumInputShape`\<`object`\>\> + +### IntentVersion + +> **IntentVersion**: [`BcsType`](../classes/BcsType.md)\<`object`, `object`\> + +#### Type declaration + +##### $kind + +> **$kind**: `"V0"` + +##### V0 + +> **V0**: `true` = `null` + +### MultiSig + +> **MultiSig**: [`BcsType`](../classes/BcsType.md)\<`object`, `object`\> + +#### Type declaration + +##### sigs + +> **sigs**: `EnumOutputShapeWithKeys`\<`object`, `"ED25519"` \| `"Secp256k1"` \| `"Secp256r1"`\>[] + +##### bitmap + +> **bitmap**: `number` + +##### multisig\_pk + +> **multisig\_pk**: `object` = `MultiSigPublicKey` + +##### multisig\_pk.pk\_map + +> **pk\_map**: `object`[] + +##### multisig\_pk.threshold + +> **threshold**: `number` + +### MultiSigPkMap + +> **MultiSigPkMap**: [`BcsType`](../classes/BcsType.md)\<`object`, `object`\> + +#### Type declaration + +##### pubKey + +> **pubKey**: `EnumOutputShapeWithKeys`\<`object`, `"ED25519"` \| `"Secp256k1"` \| `"Secp256r1"`\> = `PublicKey` + +###### Type declaration + +###### ED25519 + +> **ED25519**: `number`[] + +###### Secp256k1 + +> **Secp256k1**: `number`[] + +###### Secp256r1 + +> **Secp256r1**: `number`[] + +##### weight + +> **weight**: `number` + +### MultiSigPublicKey + +> **MultiSigPublicKey**: [`BcsType`](../classes/BcsType.md)\<`object`, `object`\> + +#### Type declaration + +##### pk\_map + +> **pk\_map**: `object`[] + +##### threshold + +> **threshold**: `number` + +### ObjectArg + +> **ObjectArg**: [`BcsType`](../classes/BcsType.md)\<`EnumOutputShapeWithKeys`\<`object`, `"ImmOrOwnedObject"` \| `"SharedObject"` \| `"Receiving"`\>, `EnumInputShape`\<`object`\>\> + +### ObjectDigest + +> **ObjectDigest**: [`BcsType`](../classes/BcsType.md)\<`string`, `string`\> + +### ProgrammableMoveCall + +> **ProgrammableMoveCall**: [`BcsType`](../classes/BcsType.md)\<`object`, `object`\> + +#### Type declaration + +##### package + +> **package**: `string` = `Address` + +##### module + +> **module**: `string` + +##### function + +> **function**: `string` + +##### typeArguments + +> **typeArguments**: `string`[] + +##### arguments + +> **arguments**: `EnumOutputShapeWithKeys`\<`object`, `"GasCoin"` \| `"Input"` \| `"Result"` \| `"NestedResult"`\>[] + +### ProgrammableTransaction + +> **ProgrammableTransaction**: [`BcsType`](../classes/BcsType.md)\<`object`, `object`\> + +#### Type declaration + +##### inputs + +> **inputs**: `EnumOutputShapeWithKeys`\<`object`, `"Pure"` \| `"Object"`\>[] + +##### commands + +> **commands**: `EnumOutputShapeWithKeys`\<`object`, `"MoveCall"` \| `"TransferObjects"` \| `"SplitCoins"` \| `"MergeCoins"` \| `"Publish"` \| `"MakeMoveVec"` \| `"Upgrade"`\>[] + +### PublicKey + +> **PublicKey**: [`BcsType`](../classes/BcsType.md)\<`EnumOutputShapeWithKeys`\<`object`, `"ED25519"` \| `"Secp256k1"` \| `"Secp256r1"`\>, `EnumInputShape`\<`object`\>\> + +### SenderSignedData + +> **SenderSignedData**: [`BcsType`](../classes/BcsType.md)\<`object`[], `Iterable`\<`object`, `any`, `any`\> & `object`\> + +### SenderSignedTransaction + +> **SenderSignedTransaction**: [`BcsType`](../classes/BcsType.md)\<`object`, `object`\> + +#### Type declaration + +##### intentMessage + +> **intentMessage**: `object` + +##### intentMessage.intent + +> **intent**: `object` = `Intent` + +##### intentMessage.intent.scope + +> **scope**: `EnumOutputShapeWithKeys`\<`object`, `"TransactionData"` \| `"TransactionEffects"` \| `"CheckpointSummary"` \| `"PersonalMessage"`\> = `IntentScope` + +###### Type declaration + +###### TransactionData + +> **TransactionData**: `true` = `null` + +###### TransactionEffects + +> **TransactionEffects**: `true` = `null` + +###### CheckpointSummary + +> **CheckpointSummary**: `true` = `null` + +###### PersonalMessage + +> **PersonalMessage**: `true` = `null` + +##### intentMessage.intent.version + +> **version**: `object` = `IntentVersion` + +##### intentMessage.intent.version.$kind + +> **$kind**: `"V0"` + +##### intentMessage.intent.version.V0 + +> **V0**: `true` = `null` + +##### intentMessage.intent.appId + +> **appId**: `object` = `AppId` + +##### intentMessage.intent.appId.$kind + +> **$kind**: `"Iota"` + +##### intentMessage.intent.appId.Iota + +> **Iota**: `true` = `null` + +##### intentMessage.value + +> **value**: `object` = `T` + +##### intentMessage.value.$kind + +> **$kind**: `"V1"` + +##### intentMessage.value.V1 + +> **V1**: `object` = `TransactionDataV1` + +##### intentMessage.value.V1.kind + +> **kind**: `EnumOutputShapeWithKeys`\<`object`, `"ProgrammableTransaction"` \| `"ChangeEpoch"` \| `"Genesis"` \| `"ConsensusCommitPrologue"`\> = `TransactionKind` + +###### Type declaration + +###### ProgrammableTransaction + +> **ProgrammableTransaction**: `object` + +###### ProgrammableTransaction.inputs + +> **inputs**: `EnumOutputShapeWithKeys`\<..., ...\>[] + +###### ProgrammableTransaction.commands + +> **commands**: `EnumOutputShapeWithKeys`\<..., ...\>[] + +###### ChangeEpoch + +> **ChangeEpoch**: `true` = `null` + +###### Genesis + +> **Genesis**: `true` = `null` + +###### ConsensusCommitPrologue + +> **ConsensusCommitPrologue**: `true` = `null` + +##### intentMessage.value.V1.sender + +> **sender**: `string` = `Address` + +##### intentMessage.value.V1.gasData + +> **gasData**: `object` = `GasData` + +##### intentMessage.value.V1.gasData.payment + +> **payment**: `object`[] + +##### intentMessage.value.V1.gasData.owner + +> **owner**: `string` = `Address` + +##### intentMessage.value.V1.gasData.price + +> **price**: `string` + +##### intentMessage.value.V1.gasData.budget + +> **budget**: `string` + +##### intentMessage.value.V1.expiration + +> **expiration**: `EnumOutputShapeWithKeys`\<`object`, `"None"` \| `"Epoch"`\> = `TransactionExpiration` + +###### Type declaration + +###### None + +> **None**: `true` = `null` + +###### Epoch + +> **Epoch**: `number` + +##### txSignatures + +> **txSignatures**: `string`[] + +### SharedObjectRef + +> **SharedObjectRef**: [`BcsType`](../classes/BcsType.md)\<`object`, `object`\> + +#### Type declaration + +##### objectId + +> **objectId**: `string` = `Address` + +##### initialSharedVersion + +> **initialSharedVersion**: `string` + +##### mutable + +> **mutable**: `boolean` + +### StructTag + +> **StructTag**: [`BcsType`](../classes/BcsType.md)\<`object`, `object`\> + +#### Type declaration + +##### address + +> **address**: `string` = `Address` + +##### module + +> **module**: `string` + +##### name + +> **name**: `string` + +##### typeParams + +> **typeParams**: [`TypeTag`](../type-aliases/TypeTag.md)[] + +### IotaObjectRef + +> **IotaObjectRef**: [`BcsType`](../classes/BcsType.md)\<`object`, `object`\> + +#### Type declaration + +##### objectId + +> **objectId**: `string` = `Address` + +##### version + +> **version**: `string` + +##### digest + +> **digest**: `string` = `ObjectDigest` + +### Command + +> **Command**: [`BcsType`](../classes/BcsType.md)\<`EnumOutputShapeWithKeys`\<`object`, `"MoveCall"` \| `"TransferObjects"` \| `"SplitCoins"` \| `"MergeCoins"` \| `"Publish"` \| `"MakeMoveVec"` \| `"Upgrade"`\>, `EnumInputShape`\<`object`\>\> + +### TransactionData + +> **TransactionData**: [`BcsType`](../classes/BcsType.md)\<`object`, `object`\> + +#### Type declaration + +##### $kind + +> **$kind**: `"V1"` + +##### V1 + +> **V1**: `object` = `TransactionDataV1` + +##### V1.kind + +> **kind**: `EnumOutputShapeWithKeys`\<`object`, `"ProgrammableTransaction"` \| `"ChangeEpoch"` \| `"Genesis"` \| `"ConsensusCommitPrologue"`\> = `TransactionKind` + +###### Type declaration + +###### ProgrammableTransaction + +> **ProgrammableTransaction**: `object` + +###### ProgrammableTransaction.inputs + +> **inputs**: `EnumOutputShapeWithKeys`\<`object`, `"Pure"` \| `"Object"`\>[] + +###### ProgrammableTransaction.commands + +> **commands**: `EnumOutputShapeWithKeys`\<`object`, `"MoveCall"` \| `"TransferObjects"` \| `"SplitCoins"` \| `"MergeCoins"` \| `"Publish"` \| `"MakeMoveVec"` \| `"Upgrade"`\>[] + +###### ChangeEpoch + +> **ChangeEpoch**: `true` = `null` + +###### Genesis + +> **Genesis**: `true` = `null` + +###### ConsensusCommitPrologue + +> **ConsensusCommitPrologue**: `true` = `null` + +##### V1.sender + +> **sender**: `string` = `Address` + +##### V1.gasData + +> **gasData**: `object` = `GasData` + +##### V1.gasData.payment + +> **payment**: `object`[] + +##### V1.gasData.owner + +> **owner**: `string` = `Address` + +##### V1.gasData.price + +> **price**: `string` + +##### V1.gasData.budget + +> **budget**: `string` + +##### V1.expiration + +> **expiration**: `EnumOutputShapeWithKeys`\<`object`, `"None"` \| `"Epoch"`\> = `TransactionExpiration` + +###### Type declaration + +###### None + +> **None**: `true` = `null` + +###### Epoch + +> **Epoch**: `number` + +### TransactionDataV1 + +> **TransactionDataV1**: [`BcsType`](../classes/BcsType.md)\<`object`, `object`\> + +#### Type declaration + +##### kind + +> **kind**: `EnumOutputShapeWithKeys`\<`object`, `"ProgrammableTransaction"` \| `"ChangeEpoch"` \| `"Genesis"` \| `"ConsensusCommitPrologue"`\> = `TransactionKind` + +###### Type declaration + +###### ProgrammableTransaction + +> **ProgrammableTransaction**: `object` + +###### ProgrammableTransaction.inputs + +> **inputs**: `EnumOutputShapeWithKeys`\<`object`, `"Pure"` \| `"Object"`\>[] + +###### ProgrammableTransaction.commands + +> **commands**: `EnumOutputShapeWithKeys`\<`object`, `"MoveCall"` \| `"TransferObjects"` \| `"SplitCoins"` \| `"MergeCoins"` \| `"Publish"` \| `"MakeMoveVec"` \| `"Upgrade"`\>[] + +###### ChangeEpoch + +> **ChangeEpoch**: `true` = `null` + +###### Genesis + +> **Genesis**: `true` = `null` + +###### ConsensusCommitPrologue + +> **ConsensusCommitPrologue**: `true` = `null` + +##### sender + +> **sender**: `string` = `Address` + +##### gasData + +> **gasData**: `object` = `GasData` + +##### gasData.payment + +> **payment**: `object`[] + +##### gasData.owner + +> **owner**: `string` = `Address` + +##### gasData.price + +> **price**: `string` + +##### gasData.budget + +> **budget**: `string` + +##### expiration + +> **expiration**: `EnumOutputShapeWithKeys`\<`object`, `"None"` \| `"Epoch"`\> = `TransactionExpiration` + +###### Type declaration + +###### None + +> **None**: `true` = `null` + +###### Epoch + +> **Epoch**: `number` + +### TransactionExpiration + +> **TransactionExpiration**: [`BcsType`](../classes/BcsType.md)\<`EnumOutputShapeWithKeys`\<`object`, `"None"` \| `"Epoch"`\>, `EnumInputShape`\<`object`\>\> + +### TransactionKind + +> **TransactionKind**: [`BcsType`](../classes/BcsType.md)\<`EnumOutputShapeWithKeys`\<`object`, `"ProgrammableTransaction"` \| `"ChangeEpoch"` \| `"Genesis"` \| `"ConsensusCommitPrologue"`\>, `EnumInputShape`\<`object`\>\> + +### TypeTag + +> **TypeTag**: [`BcsType`](../classes/BcsType.md)\<`string`, `string` \| [`TypeTag`](../type-aliases/TypeTag.md)\> + +### TransactionEffects + +> **TransactionEffects**: [`BcsType`](../classes/BcsType.md)\<`object`, `object`\> + +#### Type declaration + +##### $kind + +> **$kind**: `"V1"` + +##### V1 + +> **V1**: `object` = `TransactionEffectsV1` + +##### V1.status + +> **status**: `EnumOutputShapeWithKeys`\<`object`, `"Success"` \| `"Failed"`\> = `ExecutionStatus` + +###### Type declaration + +###### Success + +> **Success**: `true` = `null` + +###### Failed + +> **Failed**: `object` + +###### Failed.error + +> **error**: `EnumOutputShapeWithKeys`\<`object`, `"PackageUpgradeError"` \| `"SharedObjectOperationNotAllowed"` \| `"CommandArgumentError"` \| `"TypeArgumentError"` \| `"InsufficientGas"` \| `"InvalidGasObject"` \| `"InvariantViolation"` \| `"FeatureNotYetSupported"` \| `"MoveObjectTooBig"` \| `"MovePackageTooBig"` \| `"CircularObjectOwnership"` \| `"InsufficientCoinBalance"` \| `"CoinBalanceOverflow"` \| `"PublishErrorNonZeroAddress"` \| `"IotaMoveVerificationError"` \| `"MovePrimitiveRuntimeError"` \| `"MoveAbort"` \| `"VMVerificationOrDeserializationError"` \| `"VMInvariantViolation"` \| `"FunctionNotFound"` \| `"ArityMismatch"` \| `"TypeArityMismatch"` \| `"NonEntryFunctionInvoked"` \| `"UnusedValueWithoutDrop"` \| `"InvalidPublicFunctionReturnType"` \| `"InvalidTransferObject"` \| `"EffectsTooLarge"` \| `"PublishUpgradeMissingDependency"` \| `"PublishUpgradeDependencyDowngrade"` \| `"WrittenObjectsTooLarge"` \| `"CertificateDenied"` \| `"IotaMoveVerificationTimedout"` \| `"InputObjectDeleted"`\> = `ExecutionFailureStatus` + +###### Type declaration + +###### InsufficientGas + +> **InsufficientGas**: `true` = `null` + +###### InvalidGasObject + +> **InvalidGasObject**: `true` = `null` + +###### InvariantViolation + +> **InvariantViolation**: `true` = `null` + +###### FeatureNotYetSupported + +> **FeatureNotYetSupported**: `true` = `null` + +###### MoveObjectTooBig + +> **MoveObjectTooBig**: `object` + +###### MoveObjectTooBig.objectSize + +> **objectSize**: `string` + +###### MoveObjectTooBig.maxObjectSize + +> **maxObjectSize**: `string` + +###### MovePackageTooBig + +> **MovePackageTooBig**: `object` + +###### MovePackageTooBig.objectSize + +> **objectSize**: `string` + +###### MovePackageTooBig.maxObjectSize + +> **maxObjectSize**: `string` + +###### CircularObjectOwnership + +> **CircularObjectOwnership**: `object` + +###### CircularObjectOwnership.object + +> **object**: `string` = `Address` + +###### InsufficientCoinBalance + +> **InsufficientCoinBalance**: `true` = `null` + +###### CoinBalanceOverflow + +> **CoinBalanceOverflow**: `true` = `null` + +###### PublishErrorNonZeroAddress + +> **PublishErrorNonZeroAddress**: `true` = `null` + +###### IotaMoveVerificationError + +> **IotaMoveVerificationError**: `true` = `null` + +###### MovePrimitiveRuntimeError + +> **MovePrimitiveRuntimeError**: `null` \| `object` + +###### MoveAbort + +> **MoveAbort**: [`object`, `string`] + +###### VMVerificationOrDeserializationError + +> **VMVerificationOrDeserializationError**: `true` = `null` + +###### VMInvariantViolation + +> **VMInvariantViolation**: `true` = `null` + +###### FunctionNotFound + +> **FunctionNotFound**: `true` = `null` + +###### ArityMismatch + +> **ArityMismatch**: `true` = `null` + +###### TypeArityMismatch + +> **TypeArityMismatch**: `true` = `null` + +###### NonEntryFunctionInvoked + +> **NonEntryFunctionInvoked**: `true` = `null` + +###### CommandArgumentError + +> **CommandArgumentError**: `object` + +###### CommandArgumentError.argIdx + +> **argIdx**: `number` + +###### CommandArgumentError.kind + +> **kind**: `EnumOutputShapeWithKeys`\<..., ...\> = `CommandArgumentError` + +###### TypeArgumentError + +> **TypeArgumentError**: `object` + +###### TypeArgumentError.argumentIdx + +> **argumentIdx**: `number` + +###### TypeArgumentError.kind + +> **kind**: `EnumOutputShapeWithKeys`\<..., ...\> = `TypeArgumentError` + +###### UnusedValueWithoutDrop + +> **UnusedValueWithoutDrop**: `object` + +###### UnusedValueWithoutDrop.resultIdx + +> **resultIdx**: `number` + +###### UnusedValueWithoutDrop.secondaryIdx + +> **secondaryIdx**: `number` + +###### InvalidPublicFunctionReturnType + +> **InvalidPublicFunctionReturnType**: `object` + +###### InvalidPublicFunctionReturnType.idx + +> **idx**: `number` + +###### InvalidTransferObject + +> **InvalidTransferObject**: `true` = `null` + +###### EffectsTooLarge + +> **EffectsTooLarge**: `object` + +###### EffectsTooLarge.currentSize + +> **currentSize**: `string` + +###### EffectsTooLarge.maxSize + +> **maxSize**: `string` + +###### PublishUpgradeMissingDependency + +> **PublishUpgradeMissingDependency**: `true` = `null` + +###### PublishUpgradeDependencyDowngrade + +> **PublishUpgradeDependencyDowngrade**: `true` = `null` + +###### PackageUpgradeError + +> **PackageUpgradeError**: `object` + +###### PackageUpgradeError.upgradeError + +> **upgradeError**: `EnumOutputShapeWithKeys`\<..., ...\> = `PackageUpgradeError` + +###### WrittenObjectsTooLarge + +> **WrittenObjectsTooLarge**: `object` + +###### WrittenObjectsTooLarge.currentSize + +> **currentSize**: `string` + +###### WrittenObjectsTooLarge.maxSize + +> **maxSize**: `string` + +###### CertificateDenied + +> **CertificateDenied**: `true` = `null` + +###### IotaMoveVerificationTimedout + +> **IotaMoveVerificationTimedout**: `true` = `null` + +###### SharedObjectOperationNotAllowed + +> **SharedObjectOperationNotAllowed**: `true` = `null` + +###### InputObjectDeleted + +> **InputObjectDeleted**: `true` = `null` + +###### Failed.command + +> **command**: `null` \| `string` + +##### V1.executedEpoch + +> **executedEpoch**: `string` + +##### V1.gasUsed + +> **gasUsed**: `object` = `GasCostSummary` + +##### V1.gasUsed.computationCost + +> **computationCost**: `string` + +##### V1.gasUsed.computationCostBurned + +> **computationCostBurned**: `string` + +##### V1.gasUsed.storageCost + +> **storageCost**: `string` + +##### V1.gasUsed.storageRebate + +> **storageRebate**: `string` + +##### V1.gasUsed.nonRefundableStorageFee + +> **nonRefundableStorageFee**: `string` + +##### V1.transactionDigest + +> **transactionDigest**: `string` = `ObjectDigest` + +##### V1.gasObjectIndex + +> **gasObjectIndex**: `null` \| `number` + +##### V1.eventsDigest + +> **eventsDigest**: `null` \| `string` + +##### V1.dependencies + +> **dependencies**: `string`[] + +##### V1.lamportVersion + +> **lamportVersion**: `string` + +##### V1.changedObjects + +> **changedObjects**: [`string`, `object`][] + +##### V1.unchangedSharedObjects + +> **unchangedSharedObjects**: [`string`, `EnumOutputShapeWithKeys`\<`object`, `"ReadOnlyRoot"` \| `"MutateDeleted"` \| `"ReadDeleted"` \| `"Cancelled"` \| `"PerEpochConfig"`\>][] + +##### V1.auxDataDigest + +> **auxDataDigest**: `null` \| `string` diff --git a/docs/content/ts-sdk/api/client/classes/IotaClient.md b/docs/content/ts-sdk/api/client/classes/IotaClient.md new file mode 100644 index 00000000000..caae17a3f8c --- /dev/null +++ b/docs/content/ts-sdk/api/client/classes/IotaClient.md @@ -0,0 +1,817 @@ +# Class: IotaClient + +## Constructors + +### new IotaClient() + +> **new IotaClient**(`options`): [`IotaClient`](IotaClient.md) + +Establish a connection to a IOTA RPC endpoint + +#### Parameters + +• **options**: `NetworkOrTransport` + +configuration options for the API Client + +#### Returns + +[`IotaClient`](IotaClient.md) + +## Properties + +### transport + +> `protected` **transport**: [`IotaTransport`](../interfaces/IotaTransport.md) + +## Methods + +### getRpcApiVersion() + +> **getRpcApiVersion**(): `Promise`\<`undefined` \| `string`\> + +#### Returns + +`Promise`\<`undefined` \| `string`\> + +--- + +### getCoins() + +> **getCoins**(`input`): `Promise`\<[`PaginatedCoins`](../interfaces/PaginatedCoins.md)\> + +Get all Coin<`coin_type`> objects owned by an address. + +#### Parameters + +• **input**: [`GetCoinsParams`](../interfaces/GetCoinsParams.md) + +#### Returns + +`Promise`\<[`PaginatedCoins`](../interfaces/PaginatedCoins.md)\> + +--- + +### getAllCoins() + +> **getAllCoins**(`input`): `Promise`\<[`PaginatedCoins`](../interfaces/PaginatedCoins.md)\> + +Get all Coin objects owned by an address. + +#### Parameters + +• **input**: [`GetAllCoinsParams`](../interfaces/GetAllCoinsParams.md) + +#### Returns + +`Promise`\<[`PaginatedCoins`](../interfaces/PaginatedCoins.md)\> + +--- + +### getBalance() + +> **getBalance**(`input`): `Promise`\<[`CoinBalance`](../type-aliases/CoinBalance.md)\> + +Get the total coin balance for one coin type, owned by the address owner. + +#### Parameters + +• **input**: [`GetBalanceParams`](../interfaces/GetBalanceParams.md) + +#### Returns + +`Promise`\<[`CoinBalance`](../type-aliases/CoinBalance.md)\> + +--- + +### getAllBalances() + +> **getAllBalances**(`input`): `Promise`\<[`CoinBalance`](../type-aliases/CoinBalance.md)[]\> + +Get the total coin balance for all coin types, owned by the address owner. + +#### Parameters + +• **input**: [`GetAllBalancesParams`](../interfaces/GetAllBalancesParams.md) + +#### Returns + +`Promise`\<[`CoinBalance`](../type-aliases/CoinBalance.md)[]\> + +--- + +### getCoinMetadata() + +> **getCoinMetadata**(`input`): `Promise`\<`null` \| [`CoinMetadata`](../interfaces/CoinMetadata.md)\> + +Fetch CoinMetadata for a given coin type + +#### Parameters + +• **input**: [`GetCoinMetadataParams`](../interfaces/GetCoinMetadataParams.md) + +#### Returns + +`Promise`\<`null` \| [`CoinMetadata`](../interfaces/CoinMetadata.md)\> + +--- + +### getTotalSupply() + +> **getTotalSupply**(`input`): `Promise`\<[`CoinSupply`](../interfaces/CoinSupply.md)\> + +Fetch total supply for a coin + +#### Parameters + +• **input**: [`GetTotalSupplyParams`](../interfaces/GetTotalSupplyParams.md) + +#### Returns + +`Promise`\<[`CoinSupply`](../interfaces/CoinSupply.md)\> + +--- + +### call() + +> **call**\<`T`\>(`method`, `params`): `Promise`\<`T`\> + +Invoke any RPC method + +#### Type Parameters + +• **T** = `unknown` + +#### Parameters + +• **method**: `string` + +the method to be invoked + +• **params**: `unknown`[] + +#### Returns + +`Promise`\<`T`\> + +--- + +### getMoveFunctionArgTypes() + +> **getMoveFunctionArgTypes**(`input`): `Promise`\<[`IotaMoveFunctionArgType`](../type-aliases/IotaMoveFunctionArgType.md)[]\> + +Get Move function argument types like read, write and full access + +#### Parameters + +• **input**: [`GetMoveFunctionArgTypesParams`](../interfaces/GetMoveFunctionArgTypesParams.md) + +#### Returns + +`Promise`\<[`IotaMoveFunctionArgType`](../type-aliases/IotaMoveFunctionArgType.md)[]\> + +--- + +### getNormalizedMoveModulesByPackage() + +> **getNormalizedMoveModulesByPackage**(`input`): `Promise`\<[`IotaMoveNormalizedModules`](../type-aliases/IotaMoveNormalizedModules.md)\> + +Get a map from module name to +structured representations of Move modules + +#### Parameters + +• **input**: [`GetNormalizedMoveModulesByPackageParams`](../interfaces/GetNormalizedMoveModulesByPackageParams.md) + +#### Returns + +`Promise`\<[`IotaMoveNormalizedModules`](../type-aliases/IotaMoveNormalizedModules.md)\> + +--- + +### getNormalizedMoveModule() + +> **getNormalizedMoveModule**(`input`): `Promise`\<[`IotaMoveNormalizedModule`](../interfaces/IotaMoveNormalizedModule.md)\> + +Get a structured representation of Move module + +#### Parameters + +• **input**: [`GetNormalizedMoveModuleParams`](../interfaces/GetNormalizedMoveModuleParams.md) + +#### Returns + +`Promise`\<[`IotaMoveNormalizedModule`](../interfaces/IotaMoveNormalizedModule.md)\> + +--- + +### getNormalizedMoveFunction() + +> **getNormalizedMoveFunction**(`input`): `Promise`\<[`IotaMoveNormalizedFunction`](../interfaces/IotaMoveNormalizedFunction.md)\> + +Get a structured representation of Move function + +#### Parameters + +• **input**: [`GetNormalizedMoveFunctionParams`](../interfaces/GetNormalizedMoveFunctionParams.md) + +#### Returns + +`Promise`\<[`IotaMoveNormalizedFunction`](../interfaces/IotaMoveNormalizedFunction.md)\> + +--- + +### getNormalizedMoveStruct() + +> **getNormalizedMoveStruct**(`input`): `Promise`\<[`IotaMoveNormalizedStruct`](../interfaces/IotaMoveNormalizedStruct.md)\> + +Get a structured representation of Move struct + +#### Parameters + +• **input**: [`GetNormalizedMoveStructParams`](../interfaces/GetNormalizedMoveStructParams.md) + +#### Returns + +`Promise`\<[`IotaMoveNormalizedStruct`](../interfaces/IotaMoveNormalizedStruct.md)\> + +--- + +### getOwnedObjects() + +> **getOwnedObjects**(`input`): `Promise`\<[`PaginatedObjectsResponse`](../interfaces/PaginatedObjectsResponse.md)\> + +Get all objects owned by an address + +#### Parameters + +• **input**: [`GetOwnedObjectsParams`](../type-aliases/GetOwnedObjectsParams.md) + +#### Returns + +`Promise`\<[`PaginatedObjectsResponse`](../interfaces/PaginatedObjectsResponse.md)\> + +--- + +### getObject() + +> **getObject**(`input`): `Promise`\<[`IotaObjectResponse`](../interfaces/IotaObjectResponse.md)\> + +Get details about an object + +#### Parameters + +• **input**: [`GetObjectParams`](../interfaces/GetObjectParams.md) + +#### Returns + +`Promise`\<[`IotaObjectResponse`](../interfaces/IotaObjectResponse.md)\> + +--- + +### tryGetPastObject() + +> **tryGetPastObject**(`input`): `Promise`\<[`ObjectRead`](../type-aliases/ObjectRead.md)\> + +#### Parameters + +• **input**: [`TryGetPastObjectParams`](../interfaces/TryGetPastObjectParams.md) + +#### Returns + +`Promise`\<[`ObjectRead`](../type-aliases/ObjectRead.md)\> + +--- + +### multiGetObjects() + +> **multiGetObjects**(`input`): `Promise`\<[`IotaObjectResponse`](../interfaces/IotaObjectResponse.md)[]\> + +Batch get details about a list of objects. If any of the object ids are duplicates the call will fail + +#### Parameters + +• **input**: [`MultiGetObjectsParams`](../interfaces/MultiGetObjectsParams.md) + +#### Returns + +`Promise`\<[`IotaObjectResponse`](../interfaces/IotaObjectResponse.md)[]\> + +--- + +### queryTransactionBlocks() + +> **queryTransactionBlocks**(`input`): `Promise`\<[`PaginatedTransactionResponse`](../interfaces/PaginatedTransactionResponse.md)\> + +Get transaction blocks for a given query criteria + +#### Parameters + +• **input**: [`QueryTransactionBlocksParams`](../type-aliases/QueryTransactionBlocksParams.md) + +#### Returns + +`Promise`\<[`PaginatedTransactionResponse`](../interfaces/PaginatedTransactionResponse.md)\> + +--- + +### getTransactionBlock() + +> **getTransactionBlock**(`input`): `Promise`\<[`IotaTransactionBlockResponse`](../interfaces/IotaTransactionBlockResponse.md)\> + +#### Parameters + +• **input**: [`GetTransactionBlockParams`](../interfaces/GetTransactionBlockParams.md) + +#### Returns + +`Promise`\<[`IotaTransactionBlockResponse`](../interfaces/IotaTransactionBlockResponse.md)\> + +--- + +### multiGetTransactionBlocks() + +> **multiGetTransactionBlocks**(`input`): `Promise`\<[`IotaTransactionBlockResponse`](../interfaces/IotaTransactionBlockResponse.md)[]\> + +#### Parameters + +• **input**: [`MultiGetTransactionBlocksParams`](../interfaces/MultiGetTransactionBlocksParams.md) + +#### Returns + +`Promise`\<[`IotaTransactionBlockResponse`](../interfaces/IotaTransactionBlockResponse.md)[]\> + +--- + +### executeTransactionBlock() + +> **executeTransactionBlock**(`__namedParameters`): `Promise`\<[`IotaTransactionBlockResponse`](../interfaces/IotaTransactionBlockResponse.md)\> + +#### Parameters + +• **\_\_namedParameters**: [`ExecuteTransactionBlockParams`](../interfaces/ExecuteTransactionBlockParams.md) + +#### Returns + +`Promise`\<[`IotaTransactionBlockResponse`](../interfaces/IotaTransactionBlockResponse.md)\> + +--- + +### signAndExecuteTransaction() + +> **signAndExecuteTransaction**(`__namedParameters`): `Promise`\<[`IotaTransactionBlockResponse`](../interfaces/IotaTransactionBlockResponse.md)\> + +#### Parameters + +• **\_\_namedParameters**: `object` & `Omit`\<[`ExecuteTransactionBlockParams`](../interfaces/ExecuteTransactionBlockParams.md), `"signature"` \| `"transactionBlock"`\> + +#### Returns + +`Promise`\<[`IotaTransactionBlockResponse`](../interfaces/IotaTransactionBlockResponse.md)\> + +--- + +### getTotalTransactionBlocks() + +> **getTotalTransactionBlocks**(): `Promise`\<`bigint`\> + +Get total number of transactions + +#### Returns + +`Promise`\<`bigint`\> + +--- + +### getReferenceGasPrice() + +> **getReferenceGasPrice**(): `Promise`\<`bigint`\> + +Getting the reference gas price for the network + +#### Returns + +`Promise`\<`bigint`\> + +--- + +### getStakes() + +> **getStakes**(`input`): `Promise`\<[`DelegatedStake`](../interfaces/DelegatedStake.md)[]\> + +Return the delegated stakes for an address + +#### Parameters + +• **input**: [`GetStakesParams`](../interfaces/GetStakesParams.md) + +#### Returns + +`Promise`\<[`DelegatedStake`](../interfaces/DelegatedStake.md)[]\> + +--- + +### getTimelockedStakes() + +> **getTimelockedStakes**(`input`): `Promise`\<[`DelegatedTimelockedStake`](../interfaces/DelegatedTimelockedStake.md)[]\> + +Return the timelocked delegated stakes for an address + +#### Parameters + +• **input**: [`GetTimelockedStakesParams`](../interfaces/GetTimelockedStakesParams.md) + +#### Returns + +`Promise`\<[`DelegatedTimelockedStake`](../interfaces/DelegatedTimelockedStake.md)[]\> + +--- + +### getStakesByIds() + +> **getStakesByIds**(`input`): `Promise`\<[`DelegatedStake`](../interfaces/DelegatedStake.md)[]\> + +Return the delegated stakes queried by id. + +#### Parameters + +• **input**: [`GetStakesByIdsParams`](../interfaces/GetStakesByIdsParams.md) + +#### Returns + +`Promise`\<[`DelegatedStake`](../interfaces/DelegatedStake.md)[]\> + +--- + +### getTimelockedStakesByIds() + +> **getTimelockedStakesByIds**(`input`): `Promise`\<[`DelegatedTimelockedStake`](../interfaces/DelegatedTimelockedStake.md)[]\> + +Return the timelocked delegated stakes queried by id. + +#### Parameters + +• **input**: [`GetTimelockedStakesByIdsParams`](../interfaces/GetTimelockedStakesByIdsParams.md) + +#### Returns + +`Promise`\<[`DelegatedTimelockedStake`](../interfaces/DelegatedTimelockedStake.md)[]\> + +--- + +### getLatestIotaSystemState() + +> **getLatestIotaSystemState**(): `Promise`\<[`IotaSystemStateSummary`](../interfaces/IotaSystemStateSummary.md)\> + +Return the latest system state content. + +#### Returns + +`Promise`\<[`IotaSystemStateSummary`](../interfaces/IotaSystemStateSummary.md)\> + +--- + +### queryEvents() + +> **queryEvents**(`input`): `Promise`\<[`PaginatedEvents`](../interfaces/PaginatedEvents.md)\> + +Get events for a given query criteria + +#### Parameters + +• **input**: [`QueryEventsParams`](../interfaces/QueryEventsParams.md) + +#### Returns + +`Promise`\<[`PaginatedEvents`](../interfaces/PaginatedEvents.md)\> + +--- + +### ~~subscribeEvent()~~ + +> **subscribeEvent**(`input`): `Promise`\<[`Unsubscribe`](../type-aliases/Unsubscribe.md)\> + +Subscribe to get notifications whenever an event matching the filter occurs + +#### Parameters + +• **input**: [`SubscribeEventParams`](../interfaces/SubscribeEventParams.md) & `object` + +#### Returns + +`Promise`\<[`Unsubscribe`](../type-aliases/Unsubscribe.md)\> + +#### Deprecated + +--- + +### ~~subscribeTransaction()~~ + +> **subscribeTransaction**(`input`): `Promise`\<[`Unsubscribe`](../type-aliases/Unsubscribe.md)\> + +#### Parameters + +• **input**: [`SubscribeTransactionParams`](../interfaces/SubscribeTransactionParams.md) & `object` + +#### Returns + +`Promise`\<[`Unsubscribe`](../type-aliases/Unsubscribe.md)\> + +#### Deprecated + +--- + +### devInspectTransactionBlock() + +> **devInspectTransactionBlock**(`input`): `Promise`\<[`DevInspectResults`](../interfaces/DevInspectResults.md)\> + +Runs the transaction block in dev-inspect mode. Which allows for nearly any +transaction (or Move call) with any arguments. Detailed results are +provided, including both the transaction effects and any return values. + +#### Parameters + +• **input**: [`DevInspectTransactionBlockParams`](../interfaces/DevInspectTransactionBlockParams.md) + +#### Returns + +`Promise`\<[`DevInspectResults`](../interfaces/DevInspectResults.md)\> + +--- + +### dryRunTransactionBlock() + +> **dryRunTransactionBlock**(`input`): `Promise`\<[`DryRunTransactionBlockResponse`](../interfaces/DryRunTransactionBlockResponse.md)\> + +Dry run a transaction block and return the result. + +#### Parameters + +• **input**: [`DryRunTransactionBlockParams`](../interfaces/DryRunTransactionBlockParams.md) + +#### Returns + +`Promise`\<[`DryRunTransactionBlockResponse`](../interfaces/DryRunTransactionBlockResponse.md)\> + +--- + +### getDynamicFields() + +> **getDynamicFields**(`input`): `Promise`\<[`DynamicFieldPage`](../type-aliases/DynamicFieldPage.md)\> + +Return the list of dynamic field objects owned by an object + +#### Parameters + +• **input**: [`GetDynamicFieldsParams`](../interfaces/GetDynamicFieldsParams.md) + +#### Returns + +`Promise`\<[`DynamicFieldPage`](../type-aliases/DynamicFieldPage.md)\> + +--- + +### getDynamicFieldObject() + +> **getDynamicFieldObject**(`input`): `Promise`\<[`IotaObjectResponse`](../interfaces/IotaObjectResponse.md)\> + +Return the dynamic field object information for a specified object + +#### Parameters + +• **input**: [`GetDynamicFieldObjectParams`](../interfaces/GetDynamicFieldObjectParams.md) + +#### Returns + +`Promise`\<[`IotaObjectResponse`](../interfaces/IotaObjectResponse.md)\> + +--- + +### getLatestCheckpointSequenceNumber() + +> **getLatestCheckpointSequenceNumber**(): `Promise`\<`string`\> + +Get the sequence number of the latest checkpoint that has been executed + +#### Returns + +`Promise`\<`string`\> + +--- + +### getCheckpoint() + +> **getCheckpoint**(`input`): `Promise`\<[`Checkpoint`](../interfaces/Checkpoint.md)\> + +Returns information about a given checkpoint + +#### Parameters + +• **input**: [`GetCheckpointParams`](../interfaces/GetCheckpointParams.md) + +#### Returns + +`Promise`\<[`Checkpoint`](../interfaces/Checkpoint.md)\> + +--- + +### getCheckpoints() + +> **getCheckpoints**(`input`): `Promise`\<[`CheckpointPage`](../type-aliases/CheckpointPage.md)\> + +Returns historical checkpoints paginated + +#### Parameters + +• **input**: [`PaginationArguments`](../interfaces/PaginationArguments.md)\<`null` \| `string`\> & [`GetCheckpointsParams`](../interfaces/GetCheckpointsParams.md) + +#### Returns + +`Promise`\<[`CheckpointPage`](../type-aliases/CheckpointPage.md)\> + +--- + +### getCommitteeInfo() + +> **getCommitteeInfo**(`input`?): `Promise`\<[`CommitteeInfo`](../interfaces/CommitteeInfo.md)\> + +Return the committee information for the asked epoch + +#### Parameters + +• **input?**: [`GetCommitteeInfoParams`](../interfaces/GetCommitteeInfoParams.md) + +#### Returns + +`Promise`\<[`CommitteeInfo`](../interfaces/CommitteeInfo.md)\> + +--- + +### getNetworkMetrics() + +> **getNetworkMetrics**(): `Promise`\<[`NetworkMetrics`](../interfaces/NetworkMetrics.md)\> + +#### Returns + +`Promise`\<[`NetworkMetrics`](../interfaces/NetworkMetrics.md)\> + +--- + +### getAddressMetrics() + +> **getAddressMetrics**(): `Promise`\<[`AddressMetrics`](../interfaces/AddressMetrics.md)\> + +#### Returns + +`Promise`\<[`AddressMetrics`](../interfaces/AddressMetrics.md)\> + +--- + +### getEpochMetrics() + +> **getEpochMetrics**(`input`?): `Promise`\<[`EpochMetricsPage`](../type-aliases/EpochMetricsPage.md)\> + +#### Parameters + +• **input?**: `object` & [`PaginationArguments`](../interfaces/PaginationArguments.md)\<`null` \| `string`\> + +#### Returns + +`Promise`\<[`EpochMetricsPage`](../type-aliases/EpochMetricsPage.md)\> + +--- + +### getAllEpochAddressMetrics() + +> **getAllEpochAddressMetrics**(`input`?): `Promise`\<[`AllEpochsAddressMetrics`](../type-aliases/AllEpochsAddressMetrics.md)\> + +#### Parameters + +• **input?** + +• **input.descendingOrder?**: `boolean` + +#### Returns + +`Promise`\<[`AllEpochsAddressMetrics`](../type-aliases/AllEpochsAddressMetrics.md)\> + +--- + +### getCheckpointAddressMetrics() + +> **getCheckpointAddressMetrics**(`input`?): `Promise`\<[`AddressMetrics`](../interfaces/AddressMetrics.md)\> + +#### Parameters + +• **input?** + +• **input.checkpoint?**: `string` + +#### Returns + +`Promise`\<[`AddressMetrics`](../interfaces/AddressMetrics.md)\> + +--- + +### getEpochs() + +> **getEpochs**(`input`?): `Promise`\<[`EpochPage`](../type-aliases/EpochPage.md)\> + +Return the committee information for the asked epoch + +#### Parameters + +• **input?**: `object` & [`PaginationArguments`](../interfaces/PaginationArguments.md)\<`null` \| `string`\> + +#### Returns + +`Promise`\<[`EpochPage`](../type-aliases/EpochPage.md)\> + +--- + +### getMoveCallMetrics() + +> **getMoveCallMetrics**(): `Promise`\<[`MoveCallMetrics`](../interfaces/MoveCallMetrics.md)\> + +Returns list of top move calls by usage + +#### Returns + +`Promise`\<[`MoveCallMetrics`](../interfaces/MoveCallMetrics.md)\> + +--- + +### getCurrentEpoch() + +> **getCurrentEpoch**(): `Promise`\<[`EpochInfo`](../interfaces/EpochInfo.md)\> + +Return the committee information for the asked epoch + +#### Returns + +`Promise`\<[`EpochInfo`](../interfaces/EpochInfo.md)\> + +--- + +### getTotalTransactions() + +> **getTotalTransactions**(): `Promise`\<`string`\> + +#### Returns + +`Promise`\<`string`\> + +--- + +### getValidatorsApy() + +> **getValidatorsApy**(): `Promise`\<[`ValidatorsApy`](../interfaces/ValidatorsApy.md)\> + +Return the Validators APYs + +#### Returns + +`Promise`\<[`ValidatorsApy`](../interfaces/ValidatorsApy.md)\> + +--- + +### getChainIdentifier() + +> **getChainIdentifier**(): `Promise`\<`string`\> + +#### Returns + +`Promise`\<`string`\> + +--- + +### getProtocolConfig() + +> **getProtocolConfig**(`input`?): `Promise`\<[`ProtocolConfig`](../interfaces/ProtocolConfig.md)\> + +#### Parameters + +• **input?**: [`GetProtocolConfigParams`](../interfaces/GetProtocolConfigParams.md) + +#### Returns + +`Promise`\<[`ProtocolConfig`](../interfaces/ProtocolConfig.md)\> + +--- + +### waitForTransaction() + +> **waitForTransaction**(`__namedParameters`): `Promise`\<[`IotaTransactionBlockResponse`](../interfaces/IotaTransactionBlockResponse.md)\> + +Wait for a transaction block result to be available over the API. +This can be used in conjunction with `executeTransactionBlock` to wait for the transaction to +be available via the API. +This currently polls the `getTransactionBlock` API to check for the transaction. + +#### Parameters + +• **\_\_namedParameters**: `object` & [`GetTransactionBlockParams`](../interfaces/GetTransactionBlockParams.md) + +#### Returns + +`Promise`\<[`IotaTransactionBlockResponse`](../interfaces/IotaTransactionBlockResponse.md)\> diff --git a/docs/content/ts-sdk/api/client/classes/IotaHTTPStatusError.md b/docs/content/ts-sdk/api/client/classes/IotaHTTPStatusError.md new file mode 100644 index 00000000000..a8bff3d074e --- /dev/null +++ b/docs/content/ts-sdk/api/client/classes/IotaHTTPStatusError.md @@ -0,0 +1,137 @@ +# Class: IotaHTTPStatusError + +## Extends + +- [`IotaHTTPTransportError`](IotaHTTPTransportError.md) + +## Constructors + +### new IotaHTTPStatusError() + +> **new IotaHTTPStatusError**(`message`, `status`, `statusText`): [`IotaHTTPStatusError`](IotaHTTPStatusError.md) + +#### Parameters + +• **message**: `string` + +• **status**: `number` + +• **statusText**: `string` + +#### Returns + +[`IotaHTTPStatusError`](IotaHTTPStatusError.md) + +#### Overrides + +[`IotaHTTPTransportError`](IotaHTTPTransportError.md).[`constructor`](IotaHTTPTransportError.md#constructors) + +## Properties + +### prepareStackTrace()? + +> `static` `optional` **prepareStackTrace**: (`err`, `stackTraces`) => `any` + +Optional override for formatting stack traces + +#### Parameters + +• **err**: `Error` + +• **stackTraces**: `CallSite`[] + +#### Returns + +`any` + +#### See + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[`IotaHTTPTransportError`](IotaHTTPTransportError.md).[`prepareStackTrace`](IotaHTTPTransportError.md#preparestacktrace) + +--- + +### stackTraceLimit + +> `static` **stackTraceLimit**: `number` + +#### Inherited from + +[`IotaHTTPTransportError`](IotaHTTPTransportError.md).[`stackTraceLimit`](IotaHTTPTransportError.md#stacktracelimit) + +--- + +### cause? + +> `optional` **cause**: `unknown` + +#### Inherited from + +[`IotaHTTPTransportError`](IotaHTTPTransportError.md).[`cause`](IotaHTTPTransportError.md#cause) + +--- + +### name + +> **name**: `string` + +#### Inherited from + +[`IotaHTTPTransportError`](IotaHTTPTransportError.md).[`name`](IotaHTTPTransportError.md#name) + +--- + +### message + +> **message**: `string` + +#### Inherited from + +[`IotaHTTPTransportError`](IotaHTTPTransportError.md).[`message`](IotaHTTPTransportError.md#message) + +--- + +### stack? + +> `optional` **stack**: `string` + +#### Inherited from + +[`IotaHTTPTransportError`](IotaHTTPTransportError.md).[`stack`](IotaHTTPTransportError.md#stack) + +--- + +### status + +> **status**: `number` + +--- + +### statusText + +> **statusText**: `string` + +## Methods + +### captureStackTrace() + +> `static` **captureStackTrace**(`targetObject`, `constructorOpt`?): `void` + +Create .stack property on a target object + +#### Parameters + +• **targetObject**: `object` + +• **constructorOpt?**: `Function` + +#### Returns + +`void` + +#### Inherited from + +[`IotaHTTPTransportError`](IotaHTTPTransportError.md).[`captureStackTrace`](IotaHTTPTransportError.md#capturestacktrace) diff --git a/docs/content/ts-sdk/api/client/classes/IotaHTTPTransport.md b/docs/content/ts-sdk/api/client/classes/IotaHTTPTransport.md new file mode 100644 index 00000000000..cf9231e1c32 --- /dev/null +++ b/docs/content/ts-sdk/api/client/classes/IotaHTTPTransport.md @@ -0,0 +1,79 @@ +# Class: IotaHTTPTransport + +## Implements + +- [`IotaTransport`](../interfaces/IotaTransport.md) + +## Constructors + +### new IotaHTTPTransport() + +> **new IotaHTTPTransport**(`options`): [`IotaHTTPTransport`](IotaHTTPTransport.md) + +#### Parameters + +• **options**: [`IotaHTTPTransportOptions`](../interfaces/IotaHTTPTransportOptions.md) + +#### Returns + +[`IotaHTTPTransport`](IotaHTTPTransport.md) + +## Methods + +### fetch() + +> **fetch**(`input`, `init`?): `Promise`\<`Response`\> + +#### Parameters + +• **input**: `RequestInfo` + +• **init?**: `RequestInit` + +#### Returns + +`Promise`\<`Response`\> + +--- + +### request() + +> **request**\<`T`\>(`input`): `Promise`\<`T`\> + +#### Type Parameters + +• **T** + +#### Parameters + +• **input**: [`IotaTransportRequestOptions`](../interfaces/IotaTransportRequestOptions.md) + +#### Returns + +`Promise`\<`T`\> + +#### Implementation of + +[`IotaTransport`](../interfaces/IotaTransport.md).[`request`](../interfaces/IotaTransport.md#request) + +--- + +### subscribe() + +> **subscribe**\<`T`\>(`input`): `Promise`\<() => `Promise`\<`boolean`\>\> + +#### Type Parameters + +• **T** + +#### Parameters + +• **input**: [`IotaTransportSubscribeOptions`](../interfaces/IotaTransportSubscribeOptions.md)\<`T`\> + +#### Returns + +`Promise`\<() => `Promise`\<`boolean`\>\> + +#### Implementation of + +[`IotaTransport`](../interfaces/IotaTransport.md).[`subscribe`](../interfaces/IotaTransport.md#subscribe) diff --git a/docs/content/ts-sdk/api/client/classes/IotaHTTPTransportError.md b/docs/content/ts-sdk/api/client/classes/IotaHTTPTransportError.md new file mode 100644 index 00000000000..8b7b5540534 --- /dev/null +++ b/docs/content/ts-sdk/api/client/classes/IotaHTTPTransportError.md @@ -0,0 +1,144 @@ +# Class: IotaHTTPTransportError + +## Extends + +- `Error` + +## Extended by + +- [`IotaHTTPStatusError`](IotaHTTPStatusError.md) +- [`JsonRpcError`](JsonRpcError.md) + +## Constructors + +### new IotaHTTPTransportError() + +> **new IotaHTTPTransportError**(`message`?): [`IotaHTTPTransportError`](IotaHTTPTransportError.md) + +#### Parameters + +• **message?**: `string` + +#### Returns + +[`IotaHTTPTransportError`](IotaHTTPTransportError.md) + +#### Inherited from + +`Error.constructor` + +### new IotaHTTPTransportError() + +> **new IotaHTTPTransportError**(`message`?, `options`?): [`IotaHTTPTransportError`](IotaHTTPTransportError.md) + +#### Parameters + +• **message?**: `string` + +• **options?**: `ErrorOptions` + +#### Returns + +[`IotaHTTPTransportError`](IotaHTTPTransportError.md) + +#### Inherited from + +`Error.constructor` + +## Properties + +### prepareStackTrace()? + +> `static` `optional` **prepareStackTrace**: (`err`, `stackTraces`) => `any` + +Optional override for formatting stack traces + +#### Parameters + +• **err**: `Error` + +• **stackTraces**: `CallSite`[] + +#### Returns + +`any` + +#### See + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +`Error.prepareStackTrace` + +--- + +### stackTraceLimit + +> `static` **stackTraceLimit**: `number` + +#### Inherited from + +`Error.stackTraceLimit` + +--- + +### cause? + +> `optional` **cause**: `unknown` + +#### Inherited from + +`Error.cause` + +--- + +### name + +> **name**: `string` + +#### Inherited from + +`Error.name` + +--- + +### message + +> **message**: `string` + +#### Inherited from + +`Error.message` + +--- + +### stack? + +> `optional` **stack**: `string` + +#### Inherited from + +`Error.stack` + +## Methods + +### captureStackTrace() + +> `static` **captureStackTrace**(`targetObject`, `constructorOpt`?): `void` + +Create .stack property on a target object + +#### Parameters + +• **targetObject**: `object` + +• **constructorOpt?**: `Function` + +#### Returns + +`void` + +#### Inherited from + +`Error.captureStackTrace` diff --git a/docs/content/ts-sdk/api/client/classes/JsonRpcError.md b/docs/content/ts-sdk/api/client/classes/JsonRpcError.md new file mode 100644 index 00000000000..c8f021e7b97 --- /dev/null +++ b/docs/content/ts-sdk/api/client/classes/JsonRpcError.md @@ -0,0 +1,135 @@ +# Class: JsonRpcError + +## Extends + +- [`IotaHTTPTransportError`](IotaHTTPTransportError.md) + +## Constructors + +### new JsonRpcError() + +> **new JsonRpcError**(`message`, `code`): [`JsonRpcError`](JsonRpcError.md) + +#### Parameters + +• **message**: `string` + +• **code**: `number` + +#### Returns + +[`JsonRpcError`](JsonRpcError.md) + +#### Overrides + +[`IotaHTTPTransportError`](IotaHTTPTransportError.md).[`constructor`](IotaHTTPTransportError.md#constructors) + +## Properties + +### prepareStackTrace()? + +> `static` `optional` **prepareStackTrace**: (`err`, `stackTraces`) => `any` + +Optional override for formatting stack traces + +#### Parameters + +• **err**: `Error` + +• **stackTraces**: `CallSite`[] + +#### Returns + +`any` + +#### See + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[`IotaHTTPTransportError`](IotaHTTPTransportError.md).[`prepareStackTrace`](IotaHTTPTransportError.md#preparestacktrace) + +--- + +### stackTraceLimit + +> `static` **stackTraceLimit**: `number` + +#### Inherited from + +[`IotaHTTPTransportError`](IotaHTTPTransportError.md).[`stackTraceLimit`](IotaHTTPTransportError.md#stacktracelimit) + +--- + +### cause? + +> `optional` **cause**: `unknown` + +#### Inherited from + +[`IotaHTTPTransportError`](IotaHTTPTransportError.md).[`cause`](IotaHTTPTransportError.md#cause) + +--- + +### name + +> **name**: `string` + +#### Inherited from + +[`IotaHTTPTransportError`](IotaHTTPTransportError.md).[`name`](IotaHTTPTransportError.md#name) + +--- + +### message + +> **message**: `string` + +#### Inherited from + +[`IotaHTTPTransportError`](IotaHTTPTransportError.md).[`message`](IotaHTTPTransportError.md#message) + +--- + +### stack? + +> `optional` **stack**: `string` + +#### Inherited from + +[`IotaHTTPTransportError`](IotaHTTPTransportError.md).[`stack`](IotaHTTPTransportError.md#stack) + +--- + +### code + +> **code**: `number` + +--- + +### type + +> **type**: `string` + +## Methods + +### captureStackTrace() + +> `static` **captureStackTrace**(`targetObject`, `constructorOpt`?): `void` + +Create .stack property on a target object + +#### Parameters + +• **targetObject**: `object` + +• **constructorOpt?**: `Function` + +#### Returns + +`void` + +#### Inherited from + +[`IotaHTTPTransportError`](IotaHTTPTransportError.md).[`captureStackTrace`](IotaHTTPTransportError.md#capturestacktrace) diff --git a/docs/content/ts-sdk/api/client/enumerations/Network.md b/docs/content/ts-sdk/api/client/enumerations/Network.md new file mode 100644 index 00000000000..325fa73d1df --- /dev/null +++ b/docs/content/ts-sdk/api/client/enumerations/Network.md @@ -0,0 +1,31 @@ +# Enumeration: Network + +## Enumeration Members + +### Mainnet + +> **Mainnet**: `"mainnet"` + +--- + +### Devnet + +> **Devnet**: `"devnet"` + +--- + +### Testnet + +> **Testnet**: `"testnet"` + +--- + +### Localnet + +> **Localnet**: `"localnet"` + +--- + +### Custom + +> **Custom**: `"custom"` diff --git a/docs/content/ts-sdk/api/client/functions/getAllNetworks.md b/docs/content/ts-sdk/api/client/functions/getAllNetworks.md new file mode 100644 index 00000000000..ed7f0ecf2d8 --- /dev/null +++ b/docs/content/ts-sdk/api/client/functions/getAllNetworks.md @@ -0,0 +1,7 @@ +# Function: getAllNetworks() + +> **getAllNetworks**(): `NetworksConfiguration` + +## Returns + +`NetworksConfiguration` diff --git a/docs/content/ts-sdk/api/client/functions/getAppsBackend.md b/docs/content/ts-sdk/api/client/functions/getAppsBackend.md new file mode 100644 index 00000000000..03840c353a8 --- /dev/null +++ b/docs/content/ts-sdk/api/client/functions/getAppsBackend.md @@ -0,0 +1,7 @@ +# Function: getAppsBackend() + +> **getAppsBackend**(): `string` + +## Returns + +`string` diff --git a/docs/content/ts-sdk/api/client/functions/getDefaultNetwork.md b/docs/content/ts-sdk/api/client/functions/getDefaultNetwork.md new file mode 100644 index 00000000000..1b58aafd25a --- /dev/null +++ b/docs/content/ts-sdk/api/client/functions/getDefaultNetwork.md @@ -0,0 +1,7 @@ +# Function: getDefaultNetwork() + +> **getDefaultNetwork**(): [`Network`](../enumerations/Network.md) + +## Returns + +[`Network`](../enumerations/Network.md) diff --git a/docs/content/ts-sdk/api/client/functions/getFullnodeUrl.md b/docs/content/ts-sdk/api/client/functions/getFullnodeUrl.md new file mode 100644 index 00000000000..0f385a6fc7e --- /dev/null +++ b/docs/content/ts-sdk/api/client/functions/getFullnodeUrl.md @@ -0,0 +1,11 @@ +# Function: getFullnodeUrl() + +> **getFullnodeUrl**(`network`): `string` + +## Parameters + +• **network**: `string` + +## Returns + +`string` diff --git a/docs/content/ts-sdk/api/client/functions/getNetwork.md b/docs/content/ts-sdk/api/client/functions/getNetwork.md new file mode 100644 index 00000000000..1065cbb419f --- /dev/null +++ b/docs/content/ts-sdk/api/client/functions/getNetwork.md @@ -0,0 +1,11 @@ +# Function: getNetwork() + +> **getNetwork**(`network`): [`NetworkConfiguration`](../interfaces/NetworkConfiguration.md) + +## Parameters + +• **network**: `string` + +## Returns + +[`NetworkConfiguration`](../interfaces/NetworkConfiguration.md) diff --git a/docs/content/ts-sdk/api/client/functions/isIotaClient.md b/docs/content/ts-sdk/api/client/functions/isIotaClient.md new file mode 100644 index 00000000000..5b3f572a1a4 --- /dev/null +++ b/docs/content/ts-sdk/api/client/functions/isIotaClient.md @@ -0,0 +1,11 @@ +# Function: isIotaClient() + +> **isIotaClient**(`client`): `client is IotaClient` + +## Parameters + +• **client**: `unknown` + +## Returns + +`client is IotaClient` diff --git a/docs/content/ts-sdk/api/client/index.md b/docs/content/ts-sdk/api/client/index.md new file mode 100644 index 00000000000..33be3f54b19 --- /dev/null +++ b/docs/content/ts-sdk/api/client/index.md @@ -0,0 +1,245 @@ +# client + +## Index + +### Enumerations + +- [Network](enumerations/Network.md) + +### Classes + +- [IotaClient](classes/IotaClient.md) +- [IotaHTTPTransportError](classes/IotaHTTPTransportError.md) +- [JsonRpcError](classes/JsonRpcError.md) +- [IotaHTTPStatusError](classes/IotaHTTPStatusError.md) +- [IotaHTTPTransport](classes/IotaHTTPTransport.md) + +### Interfaces + +- [PaginationArguments](interfaces/PaginationArguments.md) +- [OrderArguments](interfaces/OrderArguments.md) +- [IotaHTTPTransportOptions](interfaces/IotaHTTPTransportOptions.md) +- [IotaTransportRequestOptions](interfaces/IotaTransportRequestOptions.md) +- [IotaTransportSubscribeOptions](interfaces/IotaTransportSubscribeOptions.md) +- [IotaTransport](interfaces/IotaTransport.md) +- [NetworkConfiguration](interfaces/NetworkConfiguration.md) +- [KioskConfiguration](interfaces/KioskConfiguration.md) +- [AddressMetrics](interfaces/AddressMetrics.md) +- [Balance](interfaces/Balance.md) +- [BalanceChange](interfaces/BalanceChange.md) +- [Checkpoint](interfaces/Checkpoint.md) +- [Claim](interfaces/Claim.md) +- [CoinStruct](interfaces/CoinStruct.md) +- [CommitteeInfo](interfaces/CommitteeInfo.md) +- [DelegatedStake](interfaces/DelegatedStake.md) +- [DelegatedTimelockedStake](interfaces/DelegatedTimelockedStake.md) +- [DevInspectArgs](interfaces/DevInspectArgs.md) +- [DevInspectResults](interfaces/DevInspectResults.md) +- [DisplayFieldsResponse](interfaces/DisplayFieldsResponse.md) +- [DryRunTransactionBlockResponse](interfaces/DryRunTransactionBlockResponse.md) +- [DynamicFieldInfo](interfaces/DynamicFieldInfo.md) +- [DynamicFieldName](interfaces/DynamicFieldName.md) +- [ECMHLiveObjectSetDigest](interfaces/ECMHLiveObjectSetDigest.md) +- [EndOfEpochData](interfaces/EndOfEpochData.md) +- [EndOfEpochInfo](interfaces/EndOfEpochInfo.md) +- [EpochInfo](interfaces/EpochInfo.md) +- [EpochMetrics](interfaces/EpochMetrics.md) +- [IotaEvent](interfaces/IotaEvent.md) +- [EventId](interfaces/EventId.md) +- [GasCostSummary](interfaces/GasCostSummary.md) +- [IotaGasData](interfaces/IotaGasData.md) +- [GetPastObjectRequest](interfaces/GetPastObjectRequest.md) +- [IotaActiveJwk](interfaces/IotaActiveJwk.md) +- [IotaAuthenticatorStateExpire](interfaces/IotaAuthenticatorStateExpire.md) +- [IotaChangeEpoch](interfaces/IotaChangeEpoch.md) +- [CoinMetadata](interfaces/CoinMetadata.md) +- [IotaExecutionResult](interfaces/IotaExecutionResult.md) +- [IotaJWK](interfaces/IotaJWK.md) +- [IotaJwkId](interfaces/IotaJwkId.md) +- [IotaMoveAbilitySet](interfaces/IotaMoveAbilitySet.md) +- [IotaMoveModuleId](interfaces/IotaMoveModuleId.md) +- [IotaMoveNormalizedField](interfaces/IotaMoveNormalizedField.md) +- [IotaMoveNormalizedFunction](interfaces/IotaMoveNormalizedFunction.md) +- [IotaMoveNormalizedModule](interfaces/IotaMoveNormalizedModule.md) +- [IotaMoveNormalizedStruct](interfaces/IotaMoveNormalizedStruct.md) +- [IotaMoveStructTypeParameter](interfaces/IotaMoveStructTypeParameter.md) +- [IotaObjectResponse](interfaces/IotaObjectResponse.md) +- [MoveCallIotaTransaction](interfaces/MoveCallIotaTransaction.md) +- [IotaSystemStateSummary](interfaces/IotaSystemStateSummary.md) +- [IotaValidatorSummary](interfaces/IotaValidatorSummary.md) +- [MoveCallMetrics](interfaces/MoveCallMetrics.md) +- [MoveCallParams](interfaces/MoveCallParams.md) +- [MoveFunctionName](interfaces/MoveFunctionName.md) +- [MoveVariant](interfaces/MoveVariant.md) +- [MultiSig](interfaces/MultiSig.md) +- [MultiSigPublicKey](interfaces/MultiSigPublicKey.md) +- [NetworkMetrics](interfaces/NetworkMetrics.md) +- [IotaObjectData](interfaces/IotaObjectData.md) +- [IotaObjectDataOptions](interfaces/IotaObjectDataOptions.md) +- [IotaObjectRef](interfaces/IotaObjectRef.md) +- [IotaObjectResponseQuery](interfaces/IotaObjectResponseQuery.md) +- [OwnedObjectRef](interfaces/OwnedObjectRef.md) +- [PaginatedCheckpoints](interfaces/PaginatedCheckpoints.md) +- [PaginatedCoins](interfaces/PaginatedCoins.md) +- [PaginatedDynamicFieldInfos](interfaces/PaginatedDynamicFieldInfos.md) +- [PaginatedEpochInfos](interfaces/PaginatedEpochInfos.md) +- [PaginatedEpochMetricss](interfaces/PaginatedEpochMetricss.md) +- [PaginatedEvents](interfaces/PaginatedEvents.md) +- [PaginatedObjectsResponse](interfaces/PaginatedObjectsResponse.md) +- [PaginatedTransactionResponse](interfaces/PaginatedTransactionResponse.md) +- [PasskeyAuthenticator](interfaces/PasskeyAuthenticator.md) +- [ProtocolConfig](interfaces/ProtocolConfig.md) +- [CoinSupply](interfaces/CoinSupply.md) +- [IotaTransactionBlock](interfaces/IotaTransactionBlock.md) +- [TransactionBlockBytes](interfaces/TransactionBlockBytes.md) +- [TransactionBlockEffectsModifiedAtVersions](interfaces/TransactionBlockEffectsModifiedAtVersions.md) +- [IotaTransactionBlockResponse](interfaces/IotaTransactionBlockResponse.md) +- [IotaTransactionBlockResponseOptions](interfaces/IotaTransactionBlockResponseOptions.md) +- [IotaTransactionBlockResponseQuery](interfaces/IotaTransactionBlockResponseQuery.md) +- [TransferObjectParams](interfaces/TransferObjectParams.md) +- [TypeOrigin](interfaces/TypeOrigin.md) +- [UpgradeInfo](interfaces/UpgradeInfo.md) +- [ValidatorApy](interfaces/ValidatorApy.md) +- [ValidatorsApy](interfaces/ValidatorsApy.md) +- [ZkLoginAuthenticator](interfaces/ZkLoginAuthenticator.md) +- [ZkLoginInputs](interfaces/ZkLoginInputs.md) +- [ZkLoginProof](interfaces/ZkLoginProof.md) +- [DevInspectTransactionBlockParams](interfaces/DevInspectTransactionBlockParams.md) +- [DryRunTransactionBlockParams](interfaces/DryRunTransactionBlockParams.md) +- [ExecuteTransactionBlockParams](interfaces/ExecuteTransactionBlockParams.md) +- [GetChainIdentifierParams](interfaces/GetChainIdentifierParams.md) +- [GetCheckpointParams](interfaces/GetCheckpointParams.md) +- [GetCheckpointsParams](interfaces/GetCheckpointsParams.md) +- [GetEventsParams](interfaces/GetEventsParams.md) +- [GetLatestCheckpointSequenceNumberParams](interfaces/GetLatestCheckpointSequenceNumberParams.md) +- [GetMoveFunctionArgTypesParams](interfaces/GetMoveFunctionArgTypesParams.md) +- [GetNormalizedMoveFunctionParams](interfaces/GetNormalizedMoveFunctionParams.md) +- [GetNormalizedMoveModuleParams](interfaces/GetNormalizedMoveModuleParams.md) +- [GetNormalizedMoveModulesByPackageParams](interfaces/GetNormalizedMoveModulesByPackageParams.md) +- [GetNormalizedMoveStructParams](interfaces/GetNormalizedMoveStructParams.md) +- [GetObjectParams](interfaces/GetObjectParams.md) +- [GetProtocolConfigParams](interfaces/GetProtocolConfigParams.md) +- [GetTotalTransactionBlocksParams](interfaces/GetTotalTransactionBlocksParams.md) +- [GetTransactionBlockParams](interfaces/GetTransactionBlockParams.md) +- [MultiGetObjectsParams](interfaces/MultiGetObjectsParams.md) +- [MultiGetTransactionBlocksParams](interfaces/MultiGetTransactionBlocksParams.md) +- [TryGetPastObjectParams](interfaces/TryGetPastObjectParams.md) +- [TryMultiGetPastObjectsParams](interfaces/TryMultiGetPastObjectsParams.md) +- [GetAllBalancesParams](interfaces/GetAllBalancesParams.md) +- [GetAllCoinsParams](interfaces/GetAllCoinsParams.md) +- [GetAllEpochAddressMetricsParams](interfaces/GetAllEpochAddressMetricsParams.md) +- [GetBalanceParams](interfaces/GetBalanceParams.md) +- [GetCheckpointAddressMetricsParams](interfaces/GetCheckpointAddressMetricsParams.md) +- [GetCoinMetadataParams](interfaces/GetCoinMetadataParams.md) +- [GetCoinsParams](interfaces/GetCoinsParams.md) +- [GetCommitteeInfoParams](interfaces/GetCommitteeInfoParams.md) +- [GetCurrentEpochParams](interfaces/GetCurrentEpochParams.md) +- [GetDynamicFieldObjectParams](interfaces/GetDynamicFieldObjectParams.md) +- [GetDynamicFieldsParams](interfaces/GetDynamicFieldsParams.md) +- [GetEpochMetricsParams](interfaces/GetEpochMetricsParams.md) +- [GetEpochsParams](interfaces/GetEpochsParams.md) +- [GetLatestAddressMetricsParams](interfaces/GetLatestAddressMetricsParams.md) +- [GetLatestIotaSystemStateParams](interfaces/GetLatestIotaSystemStateParams.md) +- [GetMoveCallMetricsParams](interfaces/GetMoveCallMetricsParams.md) +- [GetNetworkMetricsParams](interfaces/GetNetworkMetricsParams.md) +- [GetReferenceGasPriceParams](interfaces/GetReferenceGasPriceParams.md) +- [GetStakesParams](interfaces/GetStakesParams.md) +- [GetStakesByIdsParams](interfaces/GetStakesByIdsParams.md) +- [GetTimelockedStakesParams](interfaces/GetTimelockedStakesParams.md) +- [GetTimelockedStakesByIdsParams](interfaces/GetTimelockedStakesByIdsParams.md) +- [GetTotalSupplyParams](interfaces/GetTotalSupplyParams.md) +- [GetTotalTransactionsParams](interfaces/GetTotalTransactionsParams.md) +- [GetValidatorsApyParams](interfaces/GetValidatorsApyParams.md) +- [QueryEventsParams](interfaces/QueryEventsParams.md) +- [SubscribeEventParams](interfaces/SubscribeEventParams.md) +- [SubscribeTransactionParams](interfaces/SubscribeTransactionParams.md) +- [UnsafeBatchTransactionParams](interfaces/UnsafeBatchTransactionParams.md) +- [UnsafeMergeCoinsParams](interfaces/UnsafeMergeCoinsParams.md) +- [UnsafeMoveCallParams](interfaces/UnsafeMoveCallParams.md) +- [UnsafePayParams](interfaces/UnsafePayParams.md) +- [UnsafePayAllIotaParams](interfaces/UnsafePayAllIotaParams.md) +- [UnsafePayIotaParams](interfaces/UnsafePayIotaParams.md) +- [UnsafePublishParams](interfaces/UnsafePublishParams.md) +- [UnsafeRequestAddStakeParams](interfaces/UnsafeRequestAddStakeParams.md) +- [UnsafeRequestAddTimelockedStakeParams](interfaces/UnsafeRequestAddTimelockedStakeParams.md) +- [UnsafeRequestWithdrawStakeParams](interfaces/UnsafeRequestWithdrawStakeParams.md) +- [UnsafeRequestWithdrawTimelockedStakeParams](interfaces/UnsafeRequestWithdrawTimelockedStakeParams.md) +- [UnsafeSplitCoinParams](interfaces/UnsafeSplitCoinParams.md) +- [UnsafeSplitCoinEqualParams](interfaces/UnsafeSplitCoinEqualParams.md) +- [UnsafeTransferIotaParams](interfaces/UnsafeTransferIotaParams.md) +- [UnsafeTransferObjectParams](interfaces/UnsafeTransferObjectParams.md) + +### Type Aliases + +- [IotaClientOptions](type-aliases/IotaClientOptions.md) +- [HttpHeaders](type-aliases/HttpHeaders.md) +- [NetworkId](type-aliases/NetworkId.md) +- [ChainType](type-aliases/ChainType.md) +- [EpochPage](type-aliases/EpochPage.md) +- [EpochMetricsPage](type-aliases/EpochMetricsPage.md) +- [CheckpointPage](type-aliases/CheckpointPage.md) +- [AllEpochsAddressMetrics](type-aliases/AllEpochsAddressMetrics.md) +- [MoveCallMetric](type-aliases/MoveCallMetric.md) +- [DynamicFieldPage](type-aliases/DynamicFieldPage.md) +- [IotaMoveNormalizedModules](type-aliases/IotaMoveNormalizedModules.md) +- [IotaMoveObject](type-aliases/IotaMoveObject.md) +- [IotaMovePackage](type-aliases/IotaMovePackage.md) +- [ProgrammableTransaction](type-aliases/ProgrammableTransaction.md) +- [IotaObjectChangePublished](type-aliases/IotaObjectChangePublished.md) +- [IotaObjectChangeTransferred](type-aliases/IotaObjectChangeTransferred.md) +- [IotaObjectChangeMutated](type-aliases/IotaObjectChangeMutated.md) +- [IotaObjectChangeDeleted](type-aliases/IotaObjectChangeDeleted.md) +- [IotaObjectChangeWrapped](type-aliases/IotaObjectChangeWrapped.md) +- [IotaObjectChangeCreated](type-aliases/IotaObjectChangeCreated.md) +- [CoinBalance](type-aliases/CoinBalance.md) +- [Order](type-aliases/Order.md) +- [Unsubscribe](type-aliases/Unsubscribe.md) +- [CheckpointCommitment](type-aliases/CheckpointCommitment.md) +- [CheckpointId](type-aliases/CheckpointId.md) +- [CompressedSignature](type-aliases/CompressedSignature.md) +- [ConsensusDeterminedVersionAssignments](type-aliases/ConsensusDeterminedVersionAssignments.md) +- [IotaParsedData](type-aliases/IotaParsedData.md) +- [DynamicFieldType](type-aliases/DynamicFieldType.md) +- [IotaEventFilter](type-aliases/IotaEventFilter.md) +- [ExecuteTransactionRequestType](type-aliases/ExecuteTransactionRequestType.md) +- [ExecutionStatus](type-aliases/ExecutionStatus.md) +- [InputObjectKind](type-aliases/InputObjectKind.md) +- [IotaArgument](type-aliases/IotaArgument.md) +- [IotaCallArg](type-aliases/IotaCallArg.md) +- [IotaEndOfEpochTransactionKind](type-aliases/IotaEndOfEpochTransactionKind.md) +- [IotaMoveAbility](type-aliases/IotaMoveAbility.md) +- [IotaMoveNormalizedType](type-aliases/IotaMoveNormalizedType.md) +- [IotaMoveVisibility](type-aliases/IotaMoveVisibility.md) +- [IotaObjectDataFilter](type-aliases/IotaObjectDataFilter.md) +- [IotaTransaction](type-aliases/IotaTransaction.md) +- [IotaTransactionBlockBuilderMode](type-aliases/IotaTransactionBlockBuilderMode.md) +- [IotaMoveFunctionArgType](type-aliases/IotaMoveFunctionArgType.md) +- [MoveStruct](type-aliases/MoveStruct.md) +- [MoveValue](type-aliases/MoveValue.md) +- [IotaObjectChange](type-aliases/IotaObjectChange.md) +- [ObjectRead](type-aliases/ObjectRead.md) +- [ObjectResponseError](type-aliases/ObjectResponseError.md) +- [ObjectValueKind](type-aliases/ObjectValueKind.md) +- [ObjectOwner](type-aliases/ObjectOwner.md) +- [ProtocolConfigValue](type-aliases/ProtocolConfigValue.md) +- [PublicKey](type-aliases/PublicKey.md) +- [RPCTransactionRequestParams](type-aliases/RPCTransactionRequestParams.md) +- [RawData](type-aliases/RawData.md) +- [Signature](type-aliases/Signature.md) +- [StakeObject](type-aliases/StakeObject.md) +- [TimelockedStake](type-aliases/TimelockedStake.md) +- [TransactionBlockData](type-aliases/TransactionBlockData.md) +- [TransactionEffects](type-aliases/TransactionEffects.md) +- [IotaTransactionBlockKind](type-aliases/IotaTransactionBlockKind.md) +- [TransactionFilter](type-aliases/TransactionFilter.md) +- [GetOwnedObjectsParams](type-aliases/GetOwnedObjectsParams.md) +- [QueryTransactionBlocksParams](type-aliases/QueryTransactionBlocksParams.md) + +### Functions + +- [getAppsBackend](functions/getAppsBackend.md) +- [isIotaClient](functions/isIotaClient.md) +- [getAllNetworks](functions/getAllNetworks.md) +- [getNetwork](functions/getNetwork.md) +- [getDefaultNetwork](functions/getDefaultNetwork.md) +- [getFullnodeUrl](functions/getFullnodeUrl.md) diff --git a/docs/content/ts-sdk/api/client/interfaces/AddressMetrics.md b/docs/content/ts-sdk/api/client/interfaces/AddressMetrics.md new file mode 100644 index 00000000000..418331ccc9d --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/AddressMetrics.md @@ -0,0 +1,51 @@ +# Interface: AddressMetrics + +Provides metrics about the addresses. + +## Properties + +### checkpoint + +> **checkpoint**: `string` + +The checkpoint sequence number at which the metrics were computed. + +--- + +### cumulativeActiveAddresses + +> **cumulativeActiveAddresses**: `string` + +The count of sender addresses. + +--- + +### cumulativeAddresses + +> **cumulativeAddresses**: `string` + +The count of sender and recipient addresses. + +--- + +### dailyActiveAddresses + +> **dailyActiveAddresses**: `string` + +The count of daily unique sender addresses. + +--- + +### epoch + +> **epoch**: `string` + +The epoch to which the checkpoint is assigned. + +--- + +### timestampMs + +> **timestampMs**: `string` + +The checkpoint timestamp. diff --git a/docs/content/ts-sdk/api/client/interfaces/Balance.md b/docs/content/ts-sdk/api/client/interfaces/Balance.md new file mode 100644 index 00000000000..e88bdc327c5 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/Balance.md @@ -0,0 +1,19 @@ +# Interface: Balance + +## Properties + +### coinObjectCount + +> **coinObjectCount**: `number` + +--- + +### coinType + +> **coinType**: `string` + +--- + +### totalBalance + +> **totalBalance**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/BalanceChange.md b/docs/content/ts-sdk/api/client/interfaces/BalanceChange.md new file mode 100644 index 00000000000..880b39f2e99 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/BalanceChange.md @@ -0,0 +1,24 @@ +# Interface: BalanceChange + +## Properties + +### amount + +> **amount**: `string` + +The amount indicate the balance value changes, negative amount means spending coin value and +positive means receiving coin value. + +--- + +### coinType + +> **coinType**: `string` + +--- + +### owner + +> **owner**: [`ObjectOwner`](../type-aliases/ObjectOwner.md) + +Owner of the balance change diff --git a/docs/content/ts-sdk/api/client/interfaces/Checkpoint.md b/docs/content/ts-sdk/api/client/interfaces/Checkpoint.md new file mode 100644 index 00000000000..977f8292cf9 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/Checkpoint.md @@ -0,0 +1,92 @@ +# Interface: Checkpoint + +## Properties + +### checkpointCommitments + +> **checkpointCommitments**: [`CheckpointCommitment`](../type-aliases/CheckpointCommitment.md)[] + +Commitments to checkpoint state + +--- + +### digest + +> **digest**: `string` + +Checkpoint digest + +--- + +### endOfEpochData? + +> `optional` **endOfEpochData**: `null` \| [`EndOfEpochData`](EndOfEpochData.md) + +Present only on the final checkpoint of the epoch. + +--- + +### epoch + +> **epoch**: `string` + +Checkpoint's epoch ID + +--- + +### epochRollingGasCostSummary + +> **epochRollingGasCostSummary**: [`GasCostSummary`](GasCostSummary.md) + +The running total gas costs of all transactions included in the current epoch so far until this +checkpoint. + +--- + +### networkTotalTransactions + +> **networkTotalTransactions**: `string` + +Total number of transactions committed since genesis, including those in this checkpoint. + +--- + +### previousDigest? + +> `optional` **previousDigest**: `null` \| `string` + +Digest of the previous checkpoint + +--- + +### sequenceNumber + +> **sequenceNumber**: `string` + +Checkpoint sequence number + +--- + +### timestampMs + +> **timestampMs**: `string` + +Timestamp of the checkpoint - number of milliseconds from the Unix epoch Checkpoint timestamps are +monotonic, but not strongly monotonic - subsequent checkpoints can have same timestamp if they +originate from the same underlining consensus commit + +--- + +### transactions + +> **transactions**: `string`[] + +Transaction digests + +--- + +### validatorSignature + +> **validatorSignature**: `string` + +Validator Signature diff --git a/docs/content/ts-sdk/api/client/interfaces/Claim.md b/docs/content/ts-sdk/api/client/interfaces/Claim.md new file mode 100644 index 00000000000..810e376f9ba --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/Claim.md @@ -0,0 +1,15 @@ +# Interface: Claim + +A claim consists of value and index_mod_4. + +## Properties + +### indexMod4 + +> **indexMod4**: `number` + +--- + +### value + +> **value**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/CoinMetadata.md b/docs/content/ts-sdk/api/client/interfaces/CoinMetadata.md new file mode 100644 index 00000000000..408e871dca0 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/CoinMetadata.md @@ -0,0 +1,49 @@ +# Interface: CoinMetadata + +## Properties + +### decimals + +> **decimals**: `number` + +Number of decimal places the coin uses. + +--- + +### description + +> **description**: `string` + +Description of the token + +--- + +### iconUrl? + +> `optional` **iconUrl**: `null` \| `string` + +URL for the token logo + +--- + +### id? + +> `optional` **id**: `null` \| `string` + +Object id for the CoinMetadata object + +--- + +### name + +> **name**: `string` + +Name for the token + +--- + +### symbol + +> **symbol**: `string` + +Symbol for the token diff --git a/docs/content/ts-sdk/api/client/interfaces/CoinStruct.md b/docs/content/ts-sdk/api/client/interfaces/CoinStruct.md new file mode 100644 index 00000000000..9d772291688 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/CoinStruct.md @@ -0,0 +1,37 @@ +# Interface: CoinStruct + +## Properties + +### balance + +> **balance**: `string` + +--- + +### coinObjectId + +> **coinObjectId**: `string` + +--- + +### coinType + +> **coinType**: `string` + +--- + +### digest + +> **digest**: `string` + +--- + +### previousTransaction + +> **previousTransaction**: `string` + +--- + +### version + +> **version**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/CoinSupply.md b/docs/content/ts-sdk/api/client/interfaces/CoinSupply.md new file mode 100644 index 00000000000..3f3206cf892 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/CoinSupply.md @@ -0,0 +1,7 @@ +# Interface: CoinSupply + +## Properties + +### value + +> **value**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/CommitteeInfo.md b/docs/content/ts-sdk/api/client/interfaces/CommitteeInfo.md new file mode 100644 index 00000000000..55e5471a3ff --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/CommitteeInfo.md @@ -0,0 +1,15 @@ +# Interface: CommitteeInfo + +RPC representation of the [Committee] type. + +## Properties + +### epoch + +> **epoch**: `string` + +--- + +### validators + +> **validators**: [`string`, `string`][] diff --git a/docs/content/ts-sdk/api/client/interfaces/DelegatedStake.md b/docs/content/ts-sdk/api/client/interfaces/DelegatedStake.md new file mode 100644 index 00000000000..1e24986e560 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/DelegatedStake.md @@ -0,0 +1,23 @@ +# Interface: DelegatedStake + +## Properties + +### stakes + +> **stakes**: [`StakeObject`](../type-aliases/StakeObject.md)[] + +--- + +### stakingPool + +> **stakingPool**: `string` + +Staking pool object id. + +--- + +### validatorAddress + +> **validatorAddress**: `string` + +Validator's Address. diff --git a/docs/content/ts-sdk/api/client/interfaces/DelegatedTimelockedStake.md b/docs/content/ts-sdk/api/client/interfaces/DelegatedTimelockedStake.md new file mode 100644 index 00000000000..6c1ab4109b3 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/DelegatedTimelockedStake.md @@ -0,0 +1,19 @@ +# Interface: DelegatedTimelockedStake + +## Properties + +### stakes + +> **stakes**: [`TimelockedStake`](../type-aliases/TimelockedStake.md)[] + +--- + +### stakingPool + +> **stakingPool**: `string` + +--- + +### validatorAddress + +> **validatorAddress**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/DevInspectArgs.md b/docs/content/ts-sdk/api/client/interfaces/DevInspectArgs.md new file mode 100644 index 00000000000..2df1d1f8818 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/DevInspectArgs.md @@ -0,0 +1,43 @@ +# Interface: DevInspectArgs + +Additional arguments supplied to dev inspect beyond what is allowed in today's API. + +## Properties + +### gasBudget? + +> `optional` **gasBudget**: `null` \| `string` + +The gas budget for the transaction. + +--- + +### gasObjects? + +> `optional` **gasObjects**: `null` \| [`string`, `string`, `string`][] + +The gas objects used to pay for the transaction. + +--- + +### gasSponsor? + +> `optional` **gasSponsor**: `null` \| `string` + +The sponsor of the gas for the transaction, might be different from the sender. + +--- + +### showRawTxnDataAndEffects? + +> `optional` **showRawTxnDataAndEffects**: `null` \| `boolean` + +Whether to return the raw transaction data and effects. + +--- + +### skipChecks? + +> `optional` **skipChecks**: `null` \| `boolean` + +Whether to skip transaction checks for the transaction. diff --git a/docs/content/ts-sdk/api/client/interfaces/DevInspectResults.md b/docs/content/ts-sdk/api/client/interfaces/DevInspectResults.md new file mode 100644 index 00000000000..cf9d07e4f8e --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/DevInspectResults.md @@ -0,0 +1,53 @@ +# Interface: DevInspectResults + +The response from processing a dev inspect transaction + +## Properties + +### effects + +> **effects**: [`TransactionEffects`](../type-aliases/TransactionEffects.md) + +Summary of effects that likely would be generated if the transaction is actually run. Note however, +that not all dev-inspect transactions are actually usable as transactions so it might not be +possible actually generate these effects from a normal transaction. + +--- + +### error? + +> `optional` **error**: `null` \| `string` + +Execution error from executing the transactions + +--- + +### events + +> **events**: [`IotaEvent`](IotaEvent.md)[] + +Events that likely would be generated if the transaction is actually run. + +--- + +### rawEffects? + +> `optional` **rawEffects**: `number`[] + +The raw effects of the transaction that was dev inspected. + +--- + +### rawTxnData? + +> `optional` **rawTxnData**: `number`[] + +The raw transaction data that was dev inspected. + +--- + +### results? + +> `optional` **results**: `null` \| [`IotaExecutionResult`](IotaExecutionResult.md)[] + +Execution results (including return values) from executing the transactions diff --git a/docs/content/ts-sdk/api/client/interfaces/DevInspectTransactionBlockParams.md b/docs/content/ts-sdk/api/client/interfaces/DevInspectTransactionBlockParams.md new file mode 100644 index 00000000000..a04a8dfbded --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/DevInspectTransactionBlockParams.md @@ -0,0 +1,43 @@ +# Interface: DevInspectTransactionBlockParams + +Runs the transaction in dev-inspect mode. Which allows for nearly any transaction (or Move call) +with any arguments. Detailed results are provided, including both the transaction effects and any +return values. + +## Properties + +### sender + +> **sender**: `string` + +--- + +### transactionBlock + +> **transactionBlock**: `string` \| `Uint8Array` \| [`Transaction`](../../transactions/classes/Transaction.md) + +BCS encoded TransactionKind(as opposed to TransactionData, which include gasBudget and gasPrice) + +--- + +### gasPrice? + +> `optional` **gasPrice**: `null` \| `number` \| `bigint` + +Gas is not charged, but gas usage is still calculated. Default to use reference gas price + +--- + +### epoch? + +> `optional` **epoch**: `null` \| `string` + +The epoch to perform the call. Will be set from the system state object if not provided + +--- + +### additionalArgs? + +> `optional` **additionalArgs**: `null` \| [`DevInspectArgs`](DevInspectArgs.md) + +Additional arguments including gas_budget, gas_objects, gas_sponsor and skip_checks. diff --git a/docs/content/ts-sdk/api/client/interfaces/DisplayFieldsResponse.md b/docs/content/ts-sdk/api/client/interfaces/DisplayFieldsResponse.md new file mode 100644 index 00000000000..686bbac8613 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/DisplayFieldsResponse.md @@ -0,0 +1,13 @@ +# Interface: DisplayFieldsResponse + +## Properties + +### data? + +> `optional` **data**: `null` \| `object` + +--- + +### error? + +> `optional` **error**: `null` \| [`ObjectResponseError`](../type-aliases/ObjectResponseError.md) diff --git a/docs/content/ts-sdk/api/client/interfaces/DryRunTransactionBlockParams.md b/docs/content/ts-sdk/api/client/interfaces/DryRunTransactionBlockParams.md new file mode 100644 index 00000000000..7f8fb88a1bf --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/DryRunTransactionBlockParams.md @@ -0,0 +1,10 @@ +# Interface: DryRunTransactionBlockParams + +Return transaction execution effects including the gas cost summary, while the effects are not +committed to the chain. + +## Properties + +### transactionBlock + +> **transactionBlock**: `string` \| `Uint8Array` diff --git a/docs/content/ts-sdk/api/client/interfaces/DryRunTransactionBlockResponse.md b/docs/content/ts-sdk/api/client/interfaces/DryRunTransactionBlockResponse.md new file mode 100644 index 00000000000..96c17c1fc4b --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/DryRunTransactionBlockResponse.md @@ -0,0 +1,31 @@ +# Interface: DryRunTransactionBlockResponse + +## Properties + +### balanceChanges + +> **balanceChanges**: [`BalanceChange`](BalanceChange.md)[] + +--- + +### effects + +> **effects**: [`TransactionEffects`](../type-aliases/TransactionEffects.md) + +--- + +### events + +> **events**: [`IotaEvent`](IotaEvent.md)[] + +--- + +### input + +> **input**: [`TransactionBlockData`](../type-aliases/TransactionBlockData.md) + +--- + +### objectChanges + +> **objectChanges**: [`IotaObjectChange`](../type-aliases/IotaObjectChange.md)[] diff --git a/docs/content/ts-sdk/api/client/interfaces/DynamicFieldInfo.md b/docs/content/ts-sdk/api/client/interfaces/DynamicFieldInfo.md new file mode 100644 index 00000000000..55e71e3ea44 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/DynamicFieldInfo.md @@ -0,0 +1,43 @@ +# Interface: DynamicFieldInfo + +## Properties + +### bcsName + +> **bcsName**: `string` + +--- + +### digest + +> **digest**: `string` + +--- + +### name + +> **name**: [`DynamicFieldName`](DynamicFieldName.md) + +--- + +### objectId + +> **objectId**: `string` + +--- + +### objectType + +> **objectType**: `string` + +--- + +### type + +> **type**: [`DynamicFieldType`](../type-aliases/DynamicFieldType.md) + +--- + +### version + +> **version**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/DynamicFieldName.md b/docs/content/ts-sdk/api/client/interfaces/DynamicFieldName.md new file mode 100644 index 00000000000..8367d690352 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/DynamicFieldName.md @@ -0,0 +1,13 @@ +# Interface: DynamicFieldName + +## Properties + +### type + +> **type**: `string` + +--- + +### value + +> **value**: `unknown` diff --git a/docs/content/ts-sdk/api/client/interfaces/ECMHLiveObjectSetDigest.md b/docs/content/ts-sdk/api/client/interfaces/ECMHLiveObjectSetDigest.md new file mode 100644 index 00000000000..abca44e384f --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/ECMHLiveObjectSetDigest.md @@ -0,0 +1,9 @@ +# Interface: ECMHLiveObjectSetDigest + +The Sha256 digest of an EllipticCurveMultisetHash committing to the live object set. + +## Properties + +### digest + +> **digest**: `number`[] diff --git a/docs/content/ts-sdk/api/client/interfaces/EndOfEpochData.md b/docs/content/ts-sdk/api/client/interfaces/EndOfEpochData.md new file mode 100644 index 00000000000..2e0db8ec574 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/EndOfEpochData.md @@ -0,0 +1,39 @@ +# Interface: EndOfEpochData + +## Properties + +### epochCommitments + +> **epochCommitments**: [`CheckpointCommitment`](../type-aliases/CheckpointCommitment.md)[] + +Commitments to epoch specific state (e.g. live object set) + +--- + +### epochSupplyChange + +> **epochSupplyChange**: `number` + +The number of tokens that were minted (if positive) or burnt (if negative) in this epoch. + +--- + +### nextEpochCommittee + +> **nextEpochCommittee**: [`string`, `string`][] + +next_epoch_committee is `Some` if and only if the current checkpoint is the last checkpoint of an +epoch. Therefore next_epoch_committee can be used to pick the last checkpoint of an epoch, which is +often useful to get epoch level summary stats like total gas cost of an epoch, or the total number +of transactions from genesis to the end of an epoch. The committee is stored as a vector of +validator pub key and stake pairs. The vector should be sorted based on the Committee data +structure. + +--- + +### nextEpochProtocolVersion + +> **nextEpochProtocolVersion**: `string` + +The protocol version that is in effect during the epoch that starts immediately after this +checkpoint. diff --git a/docs/content/ts-sdk/api/client/interfaces/EndOfEpochInfo.md b/docs/content/ts-sdk/api/client/interfaces/EndOfEpochInfo.md new file mode 100644 index 00000000000..8e92b650662 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/EndOfEpochInfo.md @@ -0,0 +1,75 @@ +# Interface: EndOfEpochInfo + +## Properties + +### burntTokensAmount + +> **burntTokensAmount**: `string` + +--- + +### epochEndTimestamp + +> **epochEndTimestamp**: `string` + +--- + +### lastCheckpointId + +> **lastCheckpointId**: `string` + +--- + +### mintedTokensAmount + +> **mintedTokensAmount**: `string` + +--- + +### protocolVersion + +> **protocolVersion**: `string` + +existing fields from `SystemEpochInfoEventV1` (without epoch) + +--- + +### referenceGasPrice + +> **referenceGasPrice**: `string` + +--- + +### storageCharge + +> **storageCharge**: `string` + +--- + +### storageFundBalance + +> **storageFundBalance**: `string` + +--- + +### storageRebate + +> **storageRebate**: `string` + +--- + +### totalGasFees + +> **totalGasFees**: `string` + +--- + +### totalStake + +> **totalStake**: `string` + +--- + +### totalStakeRewardsDistributed + +> **totalStakeRewardsDistributed**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/EpochInfo.md b/docs/content/ts-sdk/api/client/interfaces/EpochInfo.md new file mode 100644 index 00000000000..d71b6f05069 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/EpochInfo.md @@ -0,0 +1,57 @@ +# Interface: EpochInfo + +## Properties + +### endOfEpochInfo? + +> `optional` **endOfEpochInfo**: `null` \| [`EndOfEpochInfo`](EndOfEpochInfo.md) + +The end of epoch information. + +--- + +### epoch + +> **epoch**: `string` + +Epoch number + +--- + +### epochStartTimestamp + +> **epochStartTimestamp**: `string` + +The timestamp when the epoch started. + +--- + +### epochTotalTransactions + +> **epochTotalTransactions**: `string` + +Count of tx in epoch + +--- + +### firstCheckpointId + +> **firstCheckpointId**: `string` + +First, last checkpoint sequence numbers + +--- + +### referenceGasPrice? + +> `optional` **referenceGasPrice**: `null` \| `string` + +The reference gas price for the given epoch. + +--- + +### validators + +> **validators**: [`IotaValidatorSummary`](IotaValidatorSummary.md)[] + +List of validators included in epoch diff --git a/docs/content/ts-sdk/api/client/interfaces/EpochMetrics.md b/docs/content/ts-sdk/api/client/interfaces/EpochMetrics.md new file mode 100644 index 00000000000..0e2dd8c0058 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/EpochMetrics.md @@ -0,0 +1,43 @@ +# Interface: EpochMetrics + +A light-weight version of `EpochInfo` for faster loading + +## Properties + +### endOfEpochInfo? + +> `optional` **endOfEpochInfo**: `null` \| [`EndOfEpochInfo`](EndOfEpochInfo.md) + +The end of epoch information. + +--- + +### epoch + +> **epoch**: `string` + +The current epoch ID. + +--- + +### epochStartTimestamp + +> **epochStartTimestamp**: `string` + +The timestamp when the epoch started. + +--- + +### epochTotalTransactions + +> **epochTotalTransactions**: `string` + +The total number of transactions in the epoch. + +--- + +### firstCheckpointId + +> **firstCheckpointId**: `string` + +The first checkpoint ID of the epoch. diff --git a/docs/content/ts-sdk/api/client/interfaces/EventId.md b/docs/content/ts-sdk/api/client/interfaces/EventId.md new file mode 100644 index 00000000000..6b7f7ccebcc --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/EventId.md @@ -0,0 +1,16 @@ +# Interface: EventId + +Unique ID of a Iota Event, the ID is a combination of tx seq number and event seq number, the ID is +local to this particular fullnode and will be different from other fullnode. + +## Properties + +### eventSeq + +> **eventSeq**: `string` + +--- + +### txDigest + +> **txDigest**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/ExecuteTransactionBlockParams.md b/docs/content/ts-sdk/api/client/interfaces/ExecuteTransactionBlockParams.md new file mode 100644 index 00000000000..1cf7d422d44 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/ExecuteTransactionBlockParams.md @@ -0,0 +1,45 @@ +# Interface: ExecuteTransactionBlockParams + +Execute the transaction and wait for results if desired. Request types: 1. WaitForEffectsCert: waits +for TransactionEffectsCert and then return to client. This mode is a proxy for transaction +finality. 2. WaitForLocalExecution: waits for TransactionEffectsCert and make sure the node executed +the transaction locally before returning the client. The local execution makes sure this node is +aware of this transaction when client fires subsequent queries. However if the node fails to execute +the transaction locally in a timely manner, a bool type in the response is set to false to indicated +the case. request_type is default to be `WaitForEffectsCert` unless options.show_events or +options.show_effects is true + +## Properties + +### transactionBlock + +> **transactionBlock**: `string` \| `Uint8Array` + +BCS serialized transaction data bytes without its type tag, as base-64 encoded string. + +--- + +### signature + +> **signature**: `string` \| `string`[] + +A list of signatures (`flag || signature || pubkey` bytes, as base-64 encoded string). Signature is +committed to the intent message of the transaction data, as base-64 encoded string. + +--- + +### options? + +> `optional` **options**: `null` \| [`IotaTransactionBlockResponseOptions`](IotaTransactionBlockResponseOptions.md) + +options for specifying the content to be returned + +--- + +### ~~requestType?~~ + +> `optional` **requestType**: `null` \| [`ExecuteTransactionRequestType`](../type-aliases/ExecuteTransactionRequestType.md) + +#### Deprecated + +requestType will be ignored by JSON RPC in the future diff --git a/docs/content/ts-sdk/api/client/interfaces/GasCostSummary.md b/docs/content/ts-sdk/api/client/interfaces/GasCostSummary.md new file mode 100644 index 00000000000..5f0e852e40c --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GasCostSummary.md @@ -0,0 +1,60 @@ +# Interface: GasCostSummary + +Summary of the charges in a transaction. Storage is charged independently of computation. There are +3 parts to the storage charges: `storage_cost`: it is the charge of storage at the time the +transaction is executed. The cost of storage is the number of bytes of the objects being mutated +multiplied by a variable storage cost per byte `storage_rebate`: this is the amount a user gets back +when manipulating an object. The `storage_rebate` is the `storage_cost` for an object minus fees. +`non_refundable_storage_fee`: not all the value of the object storage cost is given back to user and +there is a small fraction that is kept by the system. This value tracks that charge. + +When looking at a gas cost summary the amount charged to the user is +`computation_cost + storage_cost - storage_rebate` and that is the amount that is deducted from the +gas coins. `non_refundable_storage_fee` is collected from the objects being mutated/deleted and it +is tracked by the system in storage funds. + +Objects deleted, including the older versions of objects mutated, have the storage field on the +objects added up to a pool of "potential rebate". This rebate then is reduced by the "nonrefundable +rate" such that: +`potential_rebate(storage cost of deleted/mutated objects) = storage_rebate + non_refundable_storage_fee` + +## Properties + +### computationCost + +> **computationCost**: `string` + +Cost of computation/execution + +--- + +### computationCostBurned + +> **computationCostBurned**: `string` + +The burned component of the computation/execution costs + +--- + +### nonRefundableStorageFee + +> **nonRefundableStorageFee**: `string` + +The fee for the rebate. The portion of the storage rebate kept by the system. + +--- + +### storageCost + +> **storageCost**: `string` + +Storage cost, it's the sum of all storage cost for all objects created or mutated. + +--- + +### storageRebate + +> **storageRebate**: `string` + +The amount of storage cost refunded to the user for all objects deleted or mutated in the +transaction. diff --git a/docs/content/ts-sdk/api/client/interfaces/GetAllBalancesParams.md b/docs/content/ts-sdk/api/client/interfaces/GetAllBalancesParams.md new file mode 100644 index 00000000000..0f97cbbd409 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetAllBalancesParams.md @@ -0,0 +1,11 @@ +# Interface: GetAllBalancesParams + +Return the total coin balance for all coin type, owned by the address owner. + +## Properties + +### owner + +> **owner**: `string` + +the owner's Iota address diff --git a/docs/content/ts-sdk/api/client/interfaces/GetAllCoinsParams.md b/docs/content/ts-sdk/api/client/interfaces/GetAllCoinsParams.md new file mode 100644 index 00000000000..c378282f13b --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetAllCoinsParams.md @@ -0,0 +1,27 @@ +# Interface: GetAllCoinsParams + +Return all Coin objects owned by an address. + +## Properties + +### owner + +> **owner**: `string` + +the owner's Iota address + +--- + +### cursor? + +> `optional` **cursor**: `null` \| `string` + +optional paging cursor + +--- + +### limit? + +> `optional` **limit**: `null` \| `number` + +maximum number of items per page diff --git a/docs/content/ts-sdk/api/client/interfaces/GetAllEpochAddressMetricsParams.md b/docs/content/ts-sdk/api/client/interfaces/GetAllEpochAddressMetricsParams.md new file mode 100644 index 00000000000..26e7e26fa0d --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetAllEpochAddressMetricsParams.md @@ -0,0 +1,7 @@ +# Interface: GetAllEpochAddressMetricsParams + +## Properties + +### descendingOrder? + +> `optional` **descendingOrder**: `null` \| `boolean` diff --git a/docs/content/ts-sdk/api/client/interfaces/GetBalanceParams.md b/docs/content/ts-sdk/api/client/interfaces/GetBalanceParams.md new file mode 100644 index 00000000000..89d78b0fbdb --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetBalanceParams.md @@ -0,0 +1,20 @@ +# Interface: GetBalanceParams + +Return the total coin balance for one coin type, owned by the address owner. + +## Properties + +### owner + +> **owner**: `string` + +the owner's Iota address + +--- + +### coinType? + +> `optional` **coinType**: `null` \| `string` + +optional type names for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC), +default to 0x2::iota::IOTA if not specified. diff --git a/docs/content/ts-sdk/api/client/interfaces/GetChainIdentifierParams.md b/docs/content/ts-sdk/api/client/interfaces/GetChainIdentifierParams.md new file mode 100644 index 00000000000..8c4953d8483 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetChainIdentifierParams.md @@ -0,0 +1,3 @@ +# Interface: GetChainIdentifierParams + +Return the first four bytes of the chain's genesis checkpoint digest. diff --git a/docs/content/ts-sdk/api/client/interfaces/GetCheckpointAddressMetricsParams.md b/docs/content/ts-sdk/api/client/interfaces/GetCheckpointAddressMetricsParams.md new file mode 100644 index 00000000000..84279878c68 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetCheckpointAddressMetricsParams.md @@ -0,0 +1,7 @@ +# Interface: GetCheckpointAddressMetricsParams + +## Properties + +### checkpoint + +> **checkpoint**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/GetCheckpointParams.md b/docs/content/ts-sdk/api/client/interfaces/GetCheckpointParams.md new file mode 100644 index 00000000000..2198026d961 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetCheckpointParams.md @@ -0,0 +1,11 @@ +# Interface: GetCheckpointParams + +Return a checkpoint + +## Properties + +### id + +> **id**: `string` + +Checkpoint identifier, can use either checkpoint digest, or checkpoint sequence number as input. diff --git a/docs/content/ts-sdk/api/client/interfaces/GetCheckpointsParams.md b/docs/content/ts-sdk/api/client/interfaces/GetCheckpointsParams.md new file mode 100644 index 00000000000..d9636260ff0 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetCheckpointsParams.md @@ -0,0 +1,28 @@ +# Interface: GetCheckpointsParams + +Return paginated list of checkpoints + +## Properties + +### cursor? + +> `optional` **cursor**: `null` \| `string` + +An optional paging cursor. If provided, the query will start from the next item after the specified +cursor. Default to start from the first item if not specified. + +--- + +### limit? + +> `optional` **limit**: `null` \| `number` + +Maximum item returned per page, default to [QUERY_MAX_RESULT_LIMIT_CHECKPOINTS] if not specified. + +--- + +### descendingOrder + +> **descendingOrder**: `boolean` + +query result ordering, default to false (ascending order), oldest record first. diff --git a/docs/content/ts-sdk/api/client/interfaces/GetCoinMetadataParams.md b/docs/content/ts-sdk/api/client/interfaces/GetCoinMetadataParams.md new file mode 100644 index 00000000000..1132256d456 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetCoinMetadataParams.md @@ -0,0 +1,11 @@ +# Interface: GetCoinMetadataParams + +Return metadata (e.g., symbol, decimals) for a coin. + +## Properties + +### coinType + +> **coinType**: `string` + +type name for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC) diff --git a/docs/content/ts-sdk/api/client/interfaces/GetCoinsParams.md b/docs/content/ts-sdk/api/client/interfaces/GetCoinsParams.md new file mode 100644 index 00000000000..f5870cd1bd3 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetCoinsParams.md @@ -0,0 +1,36 @@ +# Interface: GetCoinsParams + +Return all Coin<`coin_type`> objects owned by an address. + +## Properties + +### owner + +> **owner**: `string` + +the owner's Iota address + +--- + +### coinType? + +> `optional` **coinType**: `null` \| `string` + +optional type name for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC), +default to 0x2::iota::IOTA if not specified. + +--- + +### cursor? + +> `optional` **cursor**: `null` \| `string` + +optional paging cursor + +--- + +### limit? + +> `optional` **limit**: `null` \| `number` + +maximum number of items per page diff --git a/docs/content/ts-sdk/api/client/interfaces/GetCommitteeInfoParams.md b/docs/content/ts-sdk/api/client/interfaces/GetCommitteeInfoParams.md new file mode 100644 index 00000000000..28734880cdc --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetCommitteeInfoParams.md @@ -0,0 +1,11 @@ +# Interface: GetCommitteeInfoParams + +Return the committee information for the asked `epoch`. + +## Properties + +### epoch? + +> `optional` **epoch**: `null` \| `string` + +The epoch of interest. If None, default to the latest epoch diff --git a/docs/content/ts-sdk/api/client/interfaces/GetCurrentEpochParams.md b/docs/content/ts-sdk/api/client/interfaces/GetCurrentEpochParams.md new file mode 100644 index 00000000000..880377cae49 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetCurrentEpochParams.md @@ -0,0 +1,3 @@ +# Interface: GetCurrentEpochParams + +Return current epoch info diff --git a/docs/content/ts-sdk/api/client/interfaces/GetDynamicFieldObjectParams.md b/docs/content/ts-sdk/api/client/interfaces/GetDynamicFieldObjectParams.md new file mode 100644 index 00000000000..4f86b718daa --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetDynamicFieldObjectParams.md @@ -0,0 +1,19 @@ +# Interface: GetDynamicFieldObjectParams + +Return the dynamic field object information for a specified object + +## Properties + +### parentId + +> **parentId**: `string` + +The ID of the queried parent object + +--- + +### name + +> **name**: [`DynamicFieldName`](DynamicFieldName.md) + +The Name of the dynamic field diff --git a/docs/content/ts-sdk/api/client/interfaces/GetDynamicFieldsParams.md b/docs/content/ts-sdk/api/client/interfaces/GetDynamicFieldsParams.md new file mode 100644 index 00000000000..ffe4b64e5f7 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetDynamicFieldsParams.md @@ -0,0 +1,28 @@ +# Interface: GetDynamicFieldsParams + +Return the list of dynamic field objects owned by an object. + +## Properties + +### parentId + +> **parentId**: `string` + +The ID of the parent object + +--- + +### cursor? + +> `optional` **cursor**: `null` \| `string` + +An optional paging cursor. If provided, the query will start from the next item after the specified +cursor. Default to start from the first item if not specified. + +--- + +### limit? + +> `optional` **limit**: `null` \| `number` + +Maximum item returned per page, default to [QUERY_MAX_RESULT_LIMIT] if not specified. diff --git a/docs/content/ts-sdk/api/client/interfaces/GetEpochMetricsParams.md b/docs/content/ts-sdk/api/client/interfaces/GetEpochMetricsParams.md new file mode 100644 index 00000000000..42c9c7ddeb7 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetEpochMetricsParams.md @@ -0,0 +1,27 @@ +# Interface: GetEpochMetricsParams + +Return a list of epoch metrics, which is a subset of epoch info + +## Properties + +### cursor? + +> `optional` **cursor**: `null` \| `string` + +Optional paging cursor + +--- + +### limit? + +> `optional` **limit**: `null` \| `number` + +Maximum number of items per page + +--- + +### descendingOrder? + +> `optional` **descendingOrder**: `null` \| `boolean` + +Flag to return results in descending order diff --git a/docs/content/ts-sdk/api/client/interfaces/GetEpochsParams.md b/docs/content/ts-sdk/api/client/interfaces/GetEpochsParams.md new file mode 100644 index 00000000000..a71efe0d58d --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetEpochsParams.md @@ -0,0 +1,27 @@ +# Interface: GetEpochsParams + +Return a list of epoch info + +## Properties + +### cursor? + +> `optional` **cursor**: `null` \| `string` + +Optional paging cursor + +--- + +### limit? + +> `optional` **limit**: `null` \| `number` + +Maximum number of items per page + +--- + +### descendingOrder? + +> `optional` **descendingOrder**: `null` \| `boolean` + +Flag to return results in descending order diff --git a/docs/content/ts-sdk/api/client/interfaces/GetEventsParams.md b/docs/content/ts-sdk/api/client/interfaces/GetEventsParams.md new file mode 100644 index 00000000000..275a989ed85 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetEventsParams.md @@ -0,0 +1,11 @@ +# Interface: GetEventsParams + +Return transaction events. + +## Properties + +### transactionDigest + +> **transactionDigest**: `string` + +the event query criteria. diff --git a/docs/content/ts-sdk/api/client/interfaces/GetLatestAddressMetricsParams.md b/docs/content/ts-sdk/api/client/interfaces/GetLatestAddressMetricsParams.md new file mode 100644 index 00000000000..487e885f696 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetLatestAddressMetricsParams.md @@ -0,0 +1,3 @@ +# Interface: GetLatestAddressMetricsParams + +Address related metrics diff --git a/docs/content/ts-sdk/api/client/interfaces/GetLatestCheckpointSequenceNumberParams.md b/docs/content/ts-sdk/api/client/interfaces/GetLatestCheckpointSequenceNumberParams.md new file mode 100644 index 00000000000..42747fcad47 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetLatestCheckpointSequenceNumberParams.md @@ -0,0 +1,3 @@ +# Interface: GetLatestCheckpointSequenceNumberParams + +Return the sequence number of the latest checkpoint that has been executed diff --git a/docs/content/ts-sdk/api/client/interfaces/GetLatestIotaSystemStateParams.md b/docs/content/ts-sdk/api/client/interfaces/GetLatestIotaSystemStateParams.md new file mode 100644 index 00000000000..60ec042acdd --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetLatestIotaSystemStateParams.md @@ -0,0 +1,3 @@ +# Interface: GetLatestIotaSystemStateParams + +Return the latest IOTA system state object on-chain. diff --git a/docs/content/ts-sdk/api/client/interfaces/GetMoveCallMetricsParams.md b/docs/content/ts-sdk/api/client/interfaces/GetMoveCallMetricsParams.md new file mode 100644 index 00000000000..435cf769e16 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetMoveCallMetricsParams.md @@ -0,0 +1,3 @@ +# Interface: GetMoveCallMetricsParams + +Return move call metrics diff --git a/docs/content/ts-sdk/api/client/interfaces/GetMoveFunctionArgTypesParams.md b/docs/content/ts-sdk/api/client/interfaces/GetMoveFunctionArgTypesParams.md new file mode 100644 index 00000000000..2cda001f228 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetMoveFunctionArgTypesParams.md @@ -0,0 +1,21 @@ +# Interface: GetMoveFunctionArgTypesParams + +Return the argument types of a Move function, based on normalized Type. + +## Properties + +### package + +> **package**: `string` + +--- + +### module + +> **module**: `string` + +--- + +### function + +> **function**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/GetNetworkMetricsParams.md b/docs/content/ts-sdk/api/client/interfaces/GetNetworkMetricsParams.md new file mode 100644 index 00000000000..94f16044ae3 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetNetworkMetricsParams.md @@ -0,0 +1,3 @@ +# Interface: GetNetworkMetricsParams + +Return Network metrics diff --git a/docs/content/ts-sdk/api/client/interfaces/GetNormalizedMoveFunctionParams.md b/docs/content/ts-sdk/api/client/interfaces/GetNormalizedMoveFunctionParams.md new file mode 100644 index 00000000000..148f75022ab --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetNormalizedMoveFunctionParams.md @@ -0,0 +1,21 @@ +# Interface: GetNormalizedMoveFunctionParams + +Return a structured representation of Move function + +## Properties + +### package + +> **package**: `string` + +--- + +### module + +> **module**: `string` + +--- + +### function + +> **function**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/GetNormalizedMoveModuleParams.md b/docs/content/ts-sdk/api/client/interfaces/GetNormalizedMoveModuleParams.md new file mode 100644 index 00000000000..67d95263a1f --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetNormalizedMoveModuleParams.md @@ -0,0 +1,15 @@ +# Interface: GetNormalizedMoveModuleParams + +Return a structured representation of Move module + +## Properties + +### package + +> **package**: `string` + +--- + +### module + +> **module**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/GetNormalizedMoveModulesByPackageParams.md b/docs/content/ts-sdk/api/client/interfaces/GetNormalizedMoveModulesByPackageParams.md new file mode 100644 index 00000000000..d64eabe098a --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetNormalizedMoveModulesByPackageParams.md @@ -0,0 +1,9 @@ +# Interface: GetNormalizedMoveModulesByPackageParams + +Return structured representations of all modules in the given package + +## Properties + +### package + +> **package**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/GetNormalizedMoveStructParams.md b/docs/content/ts-sdk/api/client/interfaces/GetNormalizedMoveStructParams.md new file mode 100644 index 00000000000..6e70879d963 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetNormalizedMoveStructParams.md @@ -0,0 +1,21 @@ +# Interface: GetNormalizedMoveStructParams + +Return a structured representation of Move struct + +## Properties + +### package + +> **package**: `string` + +--- + +### module + +> **module**: `string` + +--- + +### struct + +> **struct**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/GetObjectParams.md b/docs/content/ts-sdk/api/client/interfaces/GetObjectParams.md new file mode 100644 index 00000000000..9425140b67d --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetObjectParams.md @@ -0,0 +1,19 @@ +# Interface: GetObjectParams + +Return the object information for a specified object + +## Properties + +### id + +> **id**: `string` + +the ID of the queried object + +--- + +### options? + +> `optional` **options**: `null` \| [`IotaObjectDataOptions`](IotaObjectDataOptions.md) + +options for specifying the content to be returned diff --git a/docs/content/ts-sdk/api/client/interfaces/GetPastObjectRequest.md b/docs/content/ts-sdk/api/client/interfaces/GetPastObjectRequest.md new file mode 100644 index 00000000000..b1027f6ede7 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetPastObjectRequest.md @@ -0,0 +1,17 @@ +# Interface: GetPastObjectRequest + +## Properties + +### objectId + +> **objectId**: `string` + +the ID of the queried object + +--- + +### version + +> **version**: `string` + +the version of the queried object. diff --git a/docs/content/ts-sdk/api/client/interfaces/GetProtocolConfigParams.md b/docs/content/ts-sdk/api/client/interfaces/GetProtocolConfigParams.md new file mode 100644 index 00000000000..19224f6e0d8 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetProtocolConfigParams.md @@ -0,0 +1,13 @@ +# Interface: GetProtocolConfigParams + +Return the protocol config table for the given version number. If the version number is not +specified, If none is specified, the node uses the version of the latest epoch it has processed. + +## Properties + +### version? + +> `optional` **version**: `null` \| `string` + +An optional protocol version specifier. If omitted, the latest protocol config table for the node +will be returned. diff --git a/docs/content/ts-sdk/api/client/interfaces/GetReferenceGasPriceParams.md b/docs/content/ts-sdk/api/client/interfaces/GetReferenceGasPriceParams.md new file mode 100644 index 00000000000..726f8f17aee --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetReferenceGasPriceParams.md @@ -0,0 +1,3 @@ +# Interface: GetReferenceGasPriceParams + +Return the reference gas price for the network diff --git a/docs/content/ts-sdk/api/client/interfaces/GetStakesByIdsParams.md b/docs/content/ts-sdk/api/client/interfaces/GetStakesByIdsParams.md new file mode 100644 index 00000000000..141035404c2 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetStakesByIdsParams.md @@ -0,0 +1,9 @@ +# Interface: GetStakesByIdsParams + +Return one or more [DelegatedStake]. If a Stake was withdrawn its status will be Unstaked. + +## Properties + +### stakedIotaIds + +> **stakedIotaIds**: `string`[] diff --git a/docs/content/ts-sdk/api/client/interfaces/GetStakesParams.md b/docs/content/ts-sdk/api/client/interfaces/GetStakesParams.md new file mode 100644 index 00000000000..2a8b1dc9c9e --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetStakesParams.md @@ -0,0 +1,9 @@ +# Interface: GetStakesParams + +Return all [DelegatedStake]. + +## Properties + +### owner + +> **owner**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/GetTimelockedStakesByIdsParams.md b/docs/content/ts-sdk/api/client/interfaces/GetTimelockedStakesByIdsParams.md new file mode 100644 index 00000000000..a632c0fc887 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetTimelockedStakesByIdsParams.md @@ -0,0 +1,9 @@ +# Interface: GetTimelockedStakesByIdsParams + +Return one or more [DelegatedTimelockedStake]. If a Stake was withdrawn its status will be Unstaked. + +## Properties + +### timelockedStakedIotaIds + +> **timelockedStakedIotaIds**: `string`[] diff --git a/docs/content/ts-sdk/api/client/interfaces/GetTimelockedStakesParams.md b/docs/content/ts-sdk/api/client/interfaces/GetTimelockedStakesParams.md new file mode 100644 index 00000000000..dfb0a20d4e0 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetTimelockedStakesParams.md @@ -0,0 +1,9 @@ +# Interface: GetTimelockedStakesParams + +Return all [DelegatedTimelockedStake]. + +## Properties + +### owner + +> **owner**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/GetTotalSupplyParams.md b/docs/content/ts-sdk/api/client/interfaces/GetTotalSupplyParams.md new file mode 100644 index 00000000000..56a28352d08 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetTotalSupplyParams.md @@ -0,0 +1,11 @@ +# Interface: GetTotalSupplyParams + +Return total supply for a coin. + +## Properties + +### coinType + +> **coinType**: `string` + +type name for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC) diff --git a/docs/content/ts-sdk/api/client/interfaces/GetTotalTransactionBlocksParams.md b/docs/content/ts-sdk/api/client/interfaces/GetTotalTransactionBlocksParams.md new file mode 100644 index 00000000000..0a652fc5681 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetTotalTransactionBlocksParams.md @@ -0,0 +1,3 @@ +# Interface: GetTotalTransactionBlocksParams + +Return the total number of transaction blocks known to the server. diff --git a/docs/content/ts-sdk/api/client/interfaces/GetTotalTransactionsParams.md b/docs/content/ts-sdk/api/client/interfaces/GetTotalTransactionsParams.md new file mode 100644 index 00000000000..fc4e2ee6e59 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetTotalTransactionsParams.md @@ -0,0 +1 @@ +# Interface: GetTotalTransactionsParams diff --git a/docs/content/ts-sdk/api/client/interfaces/GetTransactionBlockParams.md b/docs/content/ts-sdk/api/client/interfaces/GetTransactionBlockParams.md new file mode 100644 index 00000000000..46e07f5fee7 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetTransactionBlockParams.md @@ -0,0 +1,19 @@ +# Interface: GetTransactionBlockParams + +Return the transaction response object. + +## Properties + +### digest + +> **digest**: `string` + +the digest of the queried transaction + +--- + +### options? + +> `optional` **options**: `null` \| [`IotaTransactionBlockResponseOptions`](IotaTransactionBlockResponseOptions.md) + +options for specifying the content to be returned diff --git a/docs/content/ts-sdk/api/client/interfaces/GetValidatorsApyParams.md b/docs/content/ts-sdk/api/client/interfaces/GetValidatorsApyParams.md new file mode 100644 index 00000000000..ae82c5de3e5 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/GetValidatorsApyParams.md @@ -0,0 +1,3 @@ +# Interface: GetValidatorsApyParams + +Return the validator APY diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaActiveJwk.md b/docs/content/ts-sdk/api/client/interfaces/IotaActiveJwk.md new file mode 100644 index 00000000000..616901c4dd7 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaActiveJwk.md @@ -0,0 +1,19 @@ +# Interface: IotaActiveJwk + +## Properties + +### epoch + +> **epoch**: `string` + +--- + +### jwk + +> **jwk**: [`IotaJWK`](IotaJWK.md) + +--- + +### jwk\_id + +> **jwk\_id**: [`IotaJwkId`](IotaJwkId.md) diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaAuthenticatorStateExpire.md b/docs/content/ts-sdk/api/client/interfaces/IotaAuthenticatorStateExpire.md new file mode 100644 index 00000000000..15c3c2fdbe7 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaAuthenticatorStateExpire.md @@ -0,0 +1,7 @@ +# Interface: IotaAuthenticatorStateExpire + +## Properties + +### min\_epoch + +> **min\_epoch**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaChangeEpoch.md b/docs/content/ts-sdk/api/client/interfaces/IotaChangeEpoch.md new file mode 100644 index 00000000000..9150be9478b --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaChangeEpoch.md @@ -0,0 +1,31 @@ +# Interface: IotaChangeEpoch + +## Properties + +### computation\_charge + +> **computation\_charge**: `string` + +--- + +### epoch + +> **epoch**: `string` + +--- + +### epoch\_start\_timestamp\_ms + +> **epoch\_start\_timestamp\_ms**: `string` + +--- + +### storage\_charge + +> **storage\_charge**: `string` + +--- + +### storage\_rebate + +> **storage\_rebate**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaEvent.md b/docs/content/ts-sdk/api/client/interfaces/IotaEvent.md new file mode 100644 index 00000000000..40a03ed7c99 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaEvent.md @@ -0,0 +1,67 @@ +# Interface: IotaEvent + +## Properties + +### bcs + +> **bcs**: `string` + +Base 58 encoded bcs bytes of the move event + +--- + +### id + +> **id**: [`EventId`](EventId.md) + +Sequential event ID, ie (transaction seq number, event seq number). 1) Serves as a unique event ID +for each fullnode 2) Also serves to sequence events for the purposes of pagination and querying. A +higher id is an event seen later by that fullnode. This ID is the "cursor" for event querying. + +--- + +### packageId + +> **packageId**: `string` + +Move package where this event was emitted. + +--- + +### parsedJson + +> **parsedJson**: `unknown` + +Parsed json value of the event + +--- + +### sender + +> **sender**: `string` + +Sender's Iota address. + +--- + +### timestampMs? + +> `optional` **timestampMs**: `null` \| `string` + +UTC timestamp in milliseconds since epoch (1/1/1970) + +--- + +### transactionModule + +> **transactionModule**: `string` + +Move module where this event was emitted. + +--- + +### type + +> **type**: `string` + +Move event type. diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaExecutionResult.md b/docs/content/ts-sdk/api/client/interfaces/IotaExecutionResult.md new file mode 100644 index 00000000000..ba33a7adf84 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaExecutionResult.md @@ -0,0 +1,17 @@ +# Interface: IotaExecutionResult + +## Properties + +### mutableReferenceOutputs? + +> `optional` **mutableReferenceOutputs**: [[`IotaArgument`](../type-aliases/IotaArgument.md), `number`[], `string`][] + +The value of any arguments that were mutably borrowed. Non-mut borrowed values are not included + +--- + +### returnValues? + +> `optional` **returnValues**: [`number`[], `string`][] + +The return values from the transaction diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaGasData.md b/docs/content/ts-sdk/api/client/interfaces/IotaGasData.md new file mode 100644 index 00000000000..b95801801e2 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaGasData.md @@ -0,0 +1,25 @@ +# Interface: IotaGasData + +## Properties + +### budget + +> **budget**: `string` + +--- + +### owner + +> **owner**: `string` + +--- + +### payment + +> **payment**: [`IotaObjectRef`](IotaObjectRef.md)[] + +--- + +### price + +> **price**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaHTTPTransportOptions.md b/docs/content/ts-sdk/api/client/interfaces/IotaHTTPTransportOptions.md new file mode 100644 index 00000000000..4e4f9bf5e15 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaHTTPTransportOptions.md @@ -0,0 +1,97 @@ +# Interface: IotaHTTPTransportOptions + +## Properties + +### fetch()? + +> `optional` **fetch**: (`input`, `init`?) => `Promise`\<`Response`\>(`input`, `init`?) => `Promise`\<`Response`\> + +[MDN Reference](https://developer.mozilla.org/docs/Web/API/fetch) + +#### Parameters + +• **input**: `URL` \| `RequestInfo` + +• **init?**: `RequestInit` + +#### Returns + +`Promise`\<`Response`\> + +#### Parameters + +• **input**: `string` \| `URL` \| `Request` + +• **init?**: `RequestInit` + +#### Returns + +`Promise`\<`Response`\> + +--- + +### WebSocketConstructor()? + +> `optional` **WebSocketConstructor**: (`url`, `protocols`?) => `WebSocket` + +#### Parameters + +• **url**: `string` \| `URL` + +• **protocols?**: `string` \| `string`[] + +#### Returns + +`WebSocket` + +#### prototype + +> **prototype**: `WebSocket` + +#### CONNECTING + +> `readonly` **CONNECTING**: `0` + +#### OPEN + +> `readonly` **OPEN**: `1` + +#### CLOSING + +> `readonly` **CLOSING**: `2` + +#### CLOSED + +> `readonly` **CLOSED**: `3` + +--- + +### url + +> **url**: `string` + +--- + +### rpc? + +> `optional` **rpc**: `object` + +#### headers? + +> `optional` **headers**: [`HttpHeaders`](../type-aliases/HttpHeaders.md) + +#### url? + +> `optional` **url**: `string` + +--- + +### websocket? + +> `optional` **websocket**: `WebsocketClientOptions` & `object` + +#### Type declaration + +##### url? + +> `optional` **url**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaJWK.md b/docs/content/ts-sdk/api/client/interfaces/IotaJWK.md new file mode 100644 index 00000000000..0de351c914e --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaJWK.md @@ -0,0 +1,25 @@ +# Interface: IotaJWK + +## Properties + +### alg + +> **alg**: `string` + +--- + +### e + +> **e**: `string` + +--- + +### kty + +> **kty**: `string` + +--- + +### n + +> **n**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaJwkId.md b/docs/content/ts-sdk/api/client/interfaces/IotaJwkId.md new file mode 100644 index 00000000000..7bdc005d104 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaJwkId.md @@ -0,0 +1,13 @@ +# Interface: IotaJwkId + +## Properties + +### iss + +> **iss**: `string` + +--- + +### kid + +> **kid**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaMoveAbilitySet.md b/docs/content/ts-sdk/api/client/interfaces/IotaMoveAbilitySet.md new file mode 100644 index 00000000000..99dbd56a4c1 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaMoveAbilitySet.md @@ -0,0 +1,7 @@ +# Interface: IotaMoveAbilitySet + +## Properties + +### abilities + +> **abilities**: [`IotaMoveAbility`](../type-aliases/IotaMoveAbility.md)[] diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaMoveModuleId.md b/docs/content/ts-sdk/api/client/interfaces/IotaMoveModuleId.md new file mode 100644 index 00000000000..52f844004ec --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaMoveModuleId.md @@ -0,0 +1,13 @@ +# Interface: IotaMoveModuleId + +## Properties + +### address + +> **address**: `string` + +--- + +### name + +> **name**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaMoveNormalizedField.md b/docs/content/ts-sdk/api/client/interfaces/IotaMoveNormalizedField.md new file mode 100644 index 00000000000..f3e61999179 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaMoveNormalizedField.md @@ -0,0 +1,13 @@ +# Interface: IotaMoveNormalizedField + +## Properties + +### name + +> **name**: `string` + +--- + +### type + +> **type**: [`IotaMoveNormalizedType`](../type-aliases/IotaMoveNormalizedType.md) diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaMoveNormalizedFunction.md b/docs/content/ts-sdk/api/client/interfaces/IotaMoveNormalizedFunction.md new file mode 100644 index 00000000000..fbd5df5baa8 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaMoveNormalizedFunction.md @@ -0,0 +1,31 @@ +# Interface: IotaMoveNormalizedFunction + +## Properties + +### isEntry + +> **isEntry**: `boolean` + +--- + +### parameters + +> **parameters**: [`IotaMoveNormalizedType`](../type-aliases/IotaMoveNormalizedType.md)[] + +--- + +### return + +> **return**: [`IotaMoveNormalizedType`](../type-aliases/IotaMoveNormalizedType.md)[] + +--- + +### typeParameters + +> **typeParameters**: [`IotaMoveAbilitySet`](IotaMoveAbilitySet.md)[] + +--- + +### visibility + +> **visibility**: [`IotaMoveVisibility`](../type-aliases/IotaMoveVisibility.md) diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaMoveNormalizedModule.md b/docs/content/ts-sdk/api/client/interfaces/IotaMoveNormalizedModule.md new file mode 100644 index 00000000000..ee2f40a67e5 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaMoveNormalizedModule.md @@ -0,0 +1,45 @@ +# Interface: IotaMoveNormalizedModule + +## Properties + +### address + +> **address**: `string` + +--- + +### exposedFunctions + +> **exposedFunctions**: `object` + +#### Index Signature + +\[`key`: `string`\]: [`IotaMoveNormalizedFunction`](IotaMoveNormalizedFunction.md) + +--- + +### fileFormatVersion + +> **fileFormatVersion**: `number` + +--- + +### friends + +> **friends**: [`IotaMoveModuleId`](IotaMoveModuleId.md)[] + +--- + +### name + +> **name**: `string` + +--- + +### structs + +> **structs**: `object` + +#### Index Signature + +\[`key`: `string`\]: [`IotaMoveNormalizedStruct`](IotaMoveNormalizedStruct.md) diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaMoveNormalizedStruct.md b/docs/content/ts-sdk/api/client/interfaces/IotaMoveNormalizedStruct.md new file mode 100644 index 00000000000..d1b33f6803b --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaMoveNormalizedStruct.md @@ -0,0 +1,19 @@ +# Interface: IotaMoveNormalizedStruct + +## Properties + +### abilities + +> **abilities**: [`IotaMoveAbilitySet`](IotaMoveAbilitySet.md) + +--- + +### fields + +> **fields**: [`IotaMoveNormalizedField`](IotaMoveNormalizedField.md)[] + +--- + +### typeParameters + +> **typeParameters**: [`IotaMoveStructTypeParameter`](IotaMoveStructTypeParameter.md)[] diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaMoveStructTypeParameter.md b/docs/content/ts-sdk/api/client/interfaces/IotaMoveStructTypeParameter.md new file mode 100644 index 00000000000..a7648fc96d2 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaMoveStructTypeParameter.md @@ -0,0 +1,13 @@ +# Interface: IotaMoveStructTypeParameter + +## Properties + +### constraints + +> **constraints**: [`IotaMoveAbilitySet`](IotaMoveAbilitySet.md) + +--- + +### isPhantom + +> **isPhantom**: `boolean` diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaObjectData.md b/docs/content/ts-sdk/api/client/interfaces/IotaObjectData.md new file mode 100644 index 00000000000..1d2105593ef --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaObjectData.md @@ -0,0 +1,85 @@ +# Interface: IotaObjectData + +## Properties + +### bcs? + +> `optional` **bcs**: `null` \| [`RawData`](../type-aliases/RawData.md) + +Move object content or package content in BCS, default to be None unless +IotaObjectDataOptions.showBcs is set to true + +--- + +### content? + +> `optional` **content**: `null` \| [`IotaParsedData`](../type-aliases/IotaParsedData.md) + +Move object content or package content, default to be None unless IotaObjectDataOptions.showContent +is set to true + +--- + +### digest + +> **digest**: `string` + +Base64 string representing the object digest + +--- + +### display? + +> `optional` **display**: `null` \| [`DisplayFieldsResponse`](DisplayFieldsResponse.md) + +The Display metadata for frontend UI rendering, default to be None unless +IotaObjectDataOptions.showContent is set to true This can also be None if the struct type does not +have Display defined + +--- + +### objectId + +> **objectId**: `string` + +--- + +### owner? + +> `optional` **owner**: `null` \| [`ObjectOwner`](../type-aliases/ObjectOwner.md) + +The owner of this object. Default to be None unless IotaObjectDataOptions.showOwner is set to true + +--- + +### previousTransaction? + +> `optional` **previousTransaction**: `null` \| `string` + +The digest of the transaction that created or last mutated this object. Default to be None unless +IotaObjectDataOptions. showPreviousTransaction is set to true + +--- + +### storageRebate? + +> `optional` **storageRebate**: `null` \| `string` + +The amount of IOTA we would rebate if this object gets deleted. This number is re-calculated each +time the object is mutated based on the present storage gas price. + +--- + +### type? + +> `optional` **type**: `null` \| `string` + +The type of the object. Default to be None unless IotaObjectDataOptions.showType is set to true + +--- + +### version + +> **version**: `string` + +Object version. diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaObjectDataOptions.md b/docs/content/ts-sdk/api/client/interfaces/IotaObjectDataOptions.md new file mode 100644 index 00000000000..ee6b3a8e9b0 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaObjectDataOptions.md @@ -0,0 +1,58 @@ +# Interface: IotaObjectDataOptions + +## Properties + +### showBcs? + +> `optional` **showBcs**: `boolean` + +Whether to show the content in BCS format. Default to be False + +--- + +### showContent? + +> `optional` **showContent**: `boolean` + +Whether to show the content(i.e., package content or Move struct content) of the object. Default to +be False + +--- + +### showDisplay? + +> `optional` **showDisplay**: `boolean` + +Whether to show the Display metadata of the object for frontend rendering. Default to be False + +--- + +### showOwner? + +> `optional` **showOwner**: `boolean` + +Whether to show the owner of the object. Default to be False + +--- + +### showPreviousTransaction? + +> `optional` **showPreviousTransaction**: `boolean` + +Whether to show the previous transaction digest of the object. Default to be False + +--- + +### showStorageRebate? + +> `optional` **showStorageRebate**: `boolean` + +Whether to show the storage rebate of the object. Default to be False + +--- + +### showType? + +> `optional` **showType**: `boolean` + +Whether to show the type of the object. Default to be False diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaObjectRef.md b/docs/content/ts-sdk/api/client/interfaces/IotaObjectRef.md new file mode 100644 index 00000000000..929957478b6 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaObjectRef.md @@ -0,0 +1,25 @@ +# Interface: IotaObjectRef + +## Properties + +### digest + +> **digest**: `string` + +Base64 string representing the object digest + +--- + +### objectId + +> **objectId**: `string` + +Hex code as string representing the object id + +--- + +### version + +> **version**: `string` + +Object version. diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaObjectResponse.md b/docs/content/ts-sdk/api/client/interfaces/IotaObjectResponse.md new file mode 100644 index 00000000000..d20f8477626 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaObjectResponse.md @@ -0,0 +1,13 @@ +# Interface: IotaObjectResponse + +## Properties + +### data? + +> `optional` **data**: `null` \| [`IotaObjectData`](IotaObjectData.md) + +--- + +### error? + +> `optional` **error**: `null` \| [`ObjectResponseError`](../type-aliases/ObjectResponseError.md) diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaObjectResponseQuery.md b/docs/content/ts-sdk/api/client/interfaces/IotaObjectResponseQuery.md new file mode 100644 index 00000000000..36b3f1a28bb --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaObjectResponseQuery.md @@ -0,0 +1,17 @@ +# Interface: IotaObjectResponseQuery + +## Properties + +### filter? + +> `optional` **filter**: `null` \| [`IotaObjectDataFilter`](../type-aliases/IotaObjectDataFilter.md) + +If None, no filter will be applied + +--- + +### options? + +> `optional` **options**: `null` \| [`IotaObjectDataOptions`](IotaObjectDataOptions.md) + +config which fields to include in the response, by default only digest is included diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaSystemStateSummary.md b/docs/content/ts-sdk/api/client/interfaces/IotaSystemStateSummary.md new file mode 100644 index 00000000000..61acf4eacbd --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaSystemStateSummary.md @@ -0,0 +1,288 @@ +# Interface: IotaSystemStateSummary + +This is the JSON-RPC type for the IOTA system state object. It flattens all fields to make them +top-level fields such that it as minimum dependencies to the internal data structures of the IOTA +system state type. + +## Properties + +### activeValidators + +> **activeValidators**: [`IotaValidatorSummary`](IotaValidatorSummary.md)[] + +The list of active validators in the current epoch. + +--- + +### atRiskValidators + +> **atRiskValidators**: [`string`, `string`][] + +Map storing the number of epochs for which each validator has been below the low stake threshold. + +--- + +### epoch + +> **epoch**: `string` + +The current epoch ID, starting from 0. + +--- + +### epochDurationMs + +> **epochDurationMs**: `string` + +The duration of an epoch, in milliseconds. + +--- + +### epochStartTimestampMs + +> **epochStartTimestampMs**: `string` + +Unix timestamp of the current epoch start + +--- + +### inactivePoolsId + +> **inactivePoolsId**: `string` + +ID of the object that maps from a staking pool ID to the inactive validator that has that pool as +its staking pool. + +--- + +### inactivePoolsSize + +> **inactivePoolsSize**: `string` + +Number of inactive staking pools. + +--- + +### iotaTotalSupply + +> **iotaTotalSupply**: `string` + +The current IOTA supply. + +--- + +### iotaTreasuryCapId + +> **iotaTreasuryCapId**: `string` + +The `TreasuryCap<IOTA>` object ID. + +--- + +### maxValidatorCount + +> **maxValidatorCount**: `string` + +Maximum number of active validators at any moment. We do not allow the number of validators in any +epoch to go above this. + +--- + +### minValidatorCount + +> **minValidatorCount**: `string` + +Minimum number of active validators at any moment. We do not allow the number of validators in any +epoch to go under this. + +--- + +### minValidatorJoiningStake + +> **minValidatorJoiningStake**: `string` + +Lower-bound on the amount of stake required to become a validator. + +--- + +### pendingActiveValidatorsId + +> **pendingActiveValidatorsId**: `string` + +ID of the object that contains the list of new validators that will join at the end of the epoch. + +--- + +### pendingActiveValidatorsSize + +> **pendingActiveValidatorsSize**: `string` + +Number of new validators that will join at the end of the epoch. + +--- + +### pendingRemovals + +> **pendingRemovals**: `string`[] + +Removal requests from the validators. Each element is an index pointing to `active_validators`. + +--- + +### protocolVersion + +> **protocolVersion**: `string` + +The current protocol version, starting from 1. + +--- + +### referenceGasPrice + +> **referenceGasPrice**: `string` + +The reference gas price for the current epoch. + +--- + +### safeMode + +> **safeMode**: `boolean` + +Whether the system is running in a downgraded safe mode due to a non-recoverable bug. This is set +whenever we failed to execute advance_epoch, and ended up executing advance_epoch_safe_mode. It can +be reset once we are able to successfully execute advance_epoch. + +--- + +### safeModeComputationRewards + +> **safeModeComputationRewards**: `string` + +Amount of computation rewards accumulated (and not yet distributed) during safe mode. + +--- + +### safeModeNonRefundableStorageFee + +> **safeModeNonRefundableStorageFee**: `string` + +Amount of non-refundable storage fee accumulated during safe mode. + +--- + +### safeModeStorageCharges + +> **safeModeStorageCharges**: `string` + +Amount of storage charges accumulated (and not yet distributed) during safe mode. + +--- + +### safeModeStorageRebates + +> **safeModeStorageRebates**: `string` + +Amount of storage rebates accumulated (and not yet burned) during safe mode. + +--- + +### stakingPoolMappingsId + +> **stakingPoolMappingsId**: `string` + +ID of the object that maps from staking pool's ID to the iota address of a validator. + +--- + +### stakingPoolMappingsSize + +> **stakingPoolMappingsSize**: `string` + +Number of staking pool mappings. + +--- + +### storageFundNonRefundableBalance + +> **storageFundNonRefundableBalance**: `string` + +The non-refundable portion of the storage fund coming from non-refundable storage rebates and any +leftover staking rewards. + +--- + +### storageFundTotalObjectStorageRebates + +> **storageFundTotalObjectStorageRebates**: `string` + +The storage rebates of all the objects on-chain stored in the storage fund. + +--- + +### systemStateVersion + +> **systemStateVersion**: `string` + +The current version of the system state data structure type. + +--- + +### totalStake + +> **totalStake**: `string` + +Total amount of stake from all active validators at the beginning of the epoch. + +--- + +### validatorCandidatesId + +> **validatorCandidatesId**: `string` + +ID of the object that stores preactive validators, mapping their addresses to their `Validator` +structs. + +--- + +### validatorCandidatesSize + +> **validatorCandidatesSize**: `string` + +Number of preactive validators. + +--- + +### validatorLowStakeGracePeriod + +> **validatorLowStakeGracePeriod**: `string` + +A validator can have stake below `validator_low_stake_threshold` for this many epochs before being +kicked out. + +--- + +### validatorLowStakeThreshold + +> **validatorLowStakeThreshold**: `string` + +Validators with stake amount below `validator_low_stake_threshold` are considered to have low stake +and will be escorted out of the validator set after being below this threshold for more than +`validator_low_stake_grace_period` number of epochs. + +--- + +### validatorReportRecords + +> **validatorReportRecords**: [`string`, `string`[]][] + +A map storing the records of validator reporting each other. + +--- + +### validatorVeryLowStakeThreshold + +> **validatorVeryLowStakeThreshold**: `string` + +Validators with stake below `validator_very_low_stake_threshold` will be removed immediately at +epoch change, no grace period. diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaTransactionBlock.md b/docs/content/ts-sdk/api/client/interfaces/IotaTransactionBlock.md new file mode 100644 index 00000000000..da80ed00cb9 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaTransactionBlock.md @@ -0,0 +1,13 @@ +# Interface: IotaTransactionBlock + +## Properties + +### data + +> **data**: [`TransactionBlockData`](../type-aliases/TransactionBlockData.md) + +--- + +### txSignatures + +> **txSignatures**: `string`[] diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaTransactionBlockResponse.md b/docs/content/ts-sdk/api/client/interfaces/IotaTransactionBlockResponse.md new file mode 100644 index 00000000000..ad39282bed1 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaTransactionBlockResponse.md @@ -0,0 +1,81 @@ +# Interface: IotaTransactionBlockResponse + +## Properties + +### balanceChanges? + +> `optional` **balanceChanges**: `null` \| [`BalanceChange`](BalanceChange.md)[] + +--- + +### checkpoint? + +> `optional` **checkpoint**: `null` \| `string` + +The checkpoint number when this transaction was included and hence finalized. This is only returned +in the read api, not in the transaction execution api. + +--- + +### confirmedLocalExecution? + +> `optional` **confirmedLocalExecution**: `null` \| `boolean` + +--- + +### digest + +> **digest**: `string` + +--- + +### effects? + +> `optional` **effects**: `null` \| [`TransactionEffects`](../type-aliases/TransactionEffects.md) + +--- + +### errors? + +> `optional` **errors**: `string`[] + +--- + +### events? + +> `optional` **events**: `null` \| [`IotaEvent`](IotaEvent.md)[] + +--- + +### objectChanges? + +> `optional` **objectChanges**: `null` \| [`IotaObjectChange`](../type-aliases/IotaObjectChange.md)[] + +--- + +### rawEffects? + +> `optional` **rawEffects**: `number`[] + +--- + +### rawTransaction? + +> `optional` **rawTransaction**: `string` + +BCS encoded [SenderSignedData] that includes input object references returns empty array if +`show_raw_transaction` is false + +--- + +### timestampMs? + +> `optional` **timestampMs**: `null` \| `string` + +--- + +### transaction? + +> `optional` **transaction**: `null` \| [`IotaTransactionBlock`](IotaTransactionBlock.md) + +Transaction input data diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaTransactionBlockResponseOptions.md b/docs/content/ts-sdk/api/client/interfaces/IotaTransactionBlockResponseOptions.md new file mode 100644 index 00000000000..9d9e5fd4065 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaTransactionBlockResponseOptions.md @@ -0,0 +1,57 @@ +# Interface: IotaTransactionBlockResponseOptions + +## Properties + +### showBalanceChanges? + +> `optional` **showBalanceChanges**: `boolean` + +Whether to show balance_changes. Default to be False + +--- + +### showEffects? + +> `optional` **showEffects**: `boolean` + +Whether to show transaction effects. Default to be False + +--- + +### showEvents? + +> `optional` **showEvents**: `boolean` + +Whether to show transaction events. Default to be False + +--- + +### showInput? + +> `optional` **showInput**: `boolean` + +Whether to show transaction input data. Default to be False + +--- + +### showObjectChanges? + +> `optional` **showObjectChanges**: `boolean` + +Whether to show object_changes. Default to be False + +--- + +### showRawEffects? + +> `optional` **showRawEffects**: `boolean` + +Whether to show raw transaction effects. Default to be False + +--- + +### showRawInput? + +> `optional` **showRawInput**: `boolean` + +Whether to show bcs-encoded transaction input data diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaTransactionBlockResponseQuery.md b/docs/content/ts-sdk/api/client/interfaces/IotaTransactionBlockResponseQuery.md new file mode 100644 index 00000000000..a3ebf2cc2d1 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaTransactionBlockResponseQuery.md @@ -0,0 +1,17 @@ +# Interface: IotaTransactionBlockResponseQuery + +## Properties + +### filter? + +> `optional` **filter**: `null` \| [`TransactionFilter`](../type-aliases/TransactionFilter.md) + +If None, no filter will be applied + +--- + +### options? + +> `optional` **options**: `null` \| [`IotaTransactionBlockResponseOptions`](IotaTransactionBlockResponseOptions.md) + +config which fields to include in the response, by default only digest is included diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaTransport.md b/docs/content/ts-sdk/api/client/interfaces/IotaTransport.md new file mode 100644 index 00000000000..bf8540667e9 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaTransport.md @@ -0,0 +1,37 @@ +# Interface: IotaTransport + +## Methods + +### request() + +> **request**\<`T`\>(`input`): `Promise`\<`T`\> + +#### Type Parameters + +• **T** = `unknown` + +#### Parameters + +• **input**: [`IotaTransportRequestOptions`](IotaTransportRequestOptions.md) + +#### Returns + +`Promise`\<`T`\> + +--- + +### subscribe() + +> **subscribe**\<`T`\>(`input`): `Promise`\<() => `Promise`\<`boolean`\>\> + +#### Type Parameters + +• **T** = `unknown` + +#### Parameters + +• **input**: [`IotaTransportSubscribeOptions`](IotaTransportSubscribeOptions.md)\<`T`\> + +#### Returns + +`Promise`\<() => `Promise`\<`boolean`\>\> diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaTransportRequestOptions.md b/docs/content/ts-sdk/api/client/interfaces/IotaTransportRequestOptions.md new file mode 100644 index 00000000000..ee306cd816b --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaTransportRequestOptions.md @@ -0,0 +1,13 @@ +# Interface: IotaTransportRequestOptions + +## Properties + +### method + +> **method**: `string` + +--- + +### params + +> **params**: `unknown`[] diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaTransportSubscribeOptions.md b/docs/content/ts-sdk/api/client/interfaces/IotaTransportSubscribeOptions.md new file mode 100644 index 00000000000..8e95b561428 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaTransportSubscribeOptions.md @@ -0,0 +1,37 @@ +# Interface: IotaTransportSubscribeOptions\<T\> + +## Type Parameters + +• **T** + +## Properties + +### method + +> **method**: `string` + +--- + +### unsubscribe + +> **unsubscribe**: `string` + +--- + +### params + +> **params**: `unknown`[] + +--- + +### onMessage() + +> **onMessage**: (`event`) => `void` + +#### Parameters + +• **event**: `T` + +#### Returns + +`void` diff --git a/docs/content/ts-sdk/api/client/interfaces/IotaValidatorSummary.md b/docs/content/ts-sdk/api/client/interfaces/IotaValidatorSummary.md new file mode 100644 index 00000000000..441e9aa0a50 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/IotaValidatorSummary.md @@ -0,0 +1,248 @@ +# Interface: IotaValidatorSummary + +This is the JSON-RPC type for the IOTA validator. It flattens all inner structures to top-level +fields so that they are decoupled from the internal definitions. + +## Properties + +### authorityPubkeyBytes + +> **authorityPubkeyBytes**: `string` + +--- + +### commissionRate + +> **commissionRate**: `string` + +--- + +### description + +> **description**: `string` + +--- + +### exchangeRatesId + +> **exchangeRatesId**: `string` + +ID of the exchange rate table object. + +--- + +### exchangeRatesSize + +> **exchangeRatesSize**: `string` + +Number of exchange rates in the table. + +--- + +### gasPrice + +> **gasPrice**: `string` + +--- + +### imageUrl + +> **imageUrl**: `string` + +--- + +### iotaAddress + +> **iotaAddress**: `string` + +--- + +### name + +> **name**: `string` + +--- + +### netAddress + +> **netAddress**: `string` + +--- + +### networkPubkeyBytes + +> **networkPubkeyBytes**: `string` + +--- + +### nextEpochAuthorityPubkeyBytes? + +> `optional` **nextEpochAuthorityPubkeyBytes**: `null` \| `string` + +--- + +### nextEpochCommissionRate + +> **nextEpochCommissionRate**: `string` + +--- + +### nextEpochGasPrice + +> **nextEpochGasPrice**: `string` + +--- + +### nextEpochNetAddress? + +> `optional` **nextEpochNetAddress**: `null` \| `string` + +--- + +### nextEpochNetworkPubkeyBytes? + +> `optional` **nextEpochNetworkPubkeyBytes**: `null` \| `string` + +--- + +### nextEpochP2pAddress? + +> `optional` **nextEpochP2pAddress**: `null` \| `string` + +--- + +### nextEpochPrimaryAddress? + +> `optional` **nextEpochPrimaryAddress**: `null` \| `string` + +--- + +### nextEpochProofOfPossession? + +> `optional` **nextEpochProofOfPossession**: `null` \| `string` + +--- + +### nextEpochProtocolPubkeyBytes? + +> `optional` **nextEpochProtocolPubkeyBytes**: `null` \| `string` + +--- + +### nextEpochStake + +> **nextEpochStake**: `string` + +--- + +### operationCapId + +> **operationCapId**: `string` + +--- + +### p2pAddress + +> **p2pAddress**: `string` + +--- + +### pendingPoolTokenWithdraw + +> **pendingPoolTokenWithdraw**: `string` + +Pending pool token withdrawn during the current epoch, emptied at epoch boundaries. + +--- + +### pendingStake + +> **pendingStake**: `string` + +Pending stake amount for this epoch. + +--- + +### pendingTotalIotaWithdraw + +> **pendingTotalIotaWithdraw**: `string` + +Pending stake withdrawn during the current epoch, emptied at epoch boundaries. + +--- + +### poolTokenBalance + +> **poolTokenBalance**: `string` + +Total number of pool tokens issued by the pool. + +--- + +### primaryAddress + +> **primaryAddress**: `string` + +--- + +### projectUrl + +> **projectUrl**: `string` + +--- + +### proofOfPossessionBytes + +> **proofOfPossessionBytes**: `string` + +--- + +### protocolPubkeyBytes + +> **protocolPubkeyBytes**: `string` + +--- + +### rewardsPool + +> **rewardsPool**: `string` + +The epoch stake rewards will be added here at the end of each epoch. + +--- + +### stakingPoolActivationEpoch? + +> `optional` **stakingPoolActivationEpoch**: `null` \| `string` + +The epoch at which this pool became active. + +--- + +### stakingPoolDeactivationEpoch? + +> `optional` **stakingPoolDeactivationEpoch**: `null` \| `string` + +The epoch at which this staking pool ceased to be active. `None` = {pre-active, active}, + +--- + +### stakingPoolId + +> **stakingPoolId**: `string` + +ID of the staking pool object. + +--- + +### stakingPoolIotaBalance + +> **stakingPoolIotaBalance**: `string` + +The total number of IOTA tokens in this pool. + +--- + +### votingPower + +> **votingPower**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/KioskConfiguration.md b/docs/content/ts-sdk/api/client/interfaces/KioskConfiguration.md new file mode 100644 index 00000000000..467b17aeda4 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/KioskConfiguration.md @@ -0,0 +1,25 @@ +# Interface: KioskConfiguration + +## Properties + +### royaltyRulePackageId + +> **royaltyRulePackageId**: `string` + +--- + +### kioskLockRulePackageId + +> **kioskLockRulePackageId**: `string` + +--- + +### floorPriceRulePackageId + +> **floorPriceRulePackageId**: `string` + +--- + +### personalKioskRulePackageId + +> **personalKioskRulePackageId**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/MoveCallIotaTransaction.md b/docs/content/ts-sdk/api/client/interfaces/MoveCallIotaTransaction.md new file mode 100644 index 00000000000..cc6d5e31d27 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/MoveCallIotaTransaction.md @@ -0,0 +1,44 @@ +# Interface: MoveCallIotaTransaction + +The transaction for calling a Move function, either an entry function or a public function (which +cannot return references). + +## Properties + +### arguments? + +> `optional` **arguments**: [`IotaArgument`](../type-aliases/IotaArgument.md)[] + +The arguments to the function. + +--- + +### function + +> **function**: `string` + +The function to be called. + +--- + +### module + +> **module**: `string` + +The specific module in the package containing the function. + +--- + +### package + +> **package**: `string` + +The package containing the module and function. + +--- + +### type\_arguments? + +> `optional` **type\_arguments**: `string`[] + +The type arguments to the function. diff --git a/docs/content/ts-sdk/api/client/interfaces/MoveCallMetrics.md b/docs/content/ts-sdk/api/client/interfaces/MoveCallMetrics.md new file mode 100644 index 00000000000..9973d3f3e0c --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/MoveCallMetrics.md @@ -0,0 +1,25 @@ +# Interface: MoveCallMetrics + +## Properties + +### rank30Days + +> **rank30Days**: [[`MoveFunctionName`](MoveFunctionName.md), `string`][] + +The count of calls of each function in the last 30 days. + +--- + +### rank3Days + +> **rank3Days**: [[`MoveFunctionName`](MoveFunctionName.md), `string`][] + +The count of calls of each function in the last 3 days. + +--- + +### rank7Days + +> **rank7Days**: [[`MoveFunctionName`](MoveFunctionName.md), `string`][] + +The count of calls of each function in the last 7 days. diff --git a/docs/content/ts-sdk/api/client/interfaces/MoveCallParams.md b/docs/content/ts-sdk/api/client/interfaces/MoveCallParams.md new file mode 100644 index 00000000000..0df4e11284b --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/MoveCallParams.md @@ -0,0 +1,31 @@ +# Interface: MoveCallParams + +## Properties + +### arguments + +> **arguments**: `unknown`[] + +--- + +### function + +> **function**: `string` + +--- + +### module + +> **module**: `string` + +--- + +### packageObjectId + +> **packageObjectId**: `string` + +--- + +### typeArguments? + +> `optional` **typeArguments**: `string`[] diff --git a/docs/content/ts-sdk/api/client/interfaces/MoveFunctionName.md b/docs/content/ts-sdk/api/client/interfaces/MoveFunctionName.md new file mode 100644 index 00000000000..b4611e5b520 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/MoveFunctionName.md @@ -0,0 +1,27 @@ +# Interface: MoveFunctionName + +Identifies a Move function. + +## Properties + +### function + +> **function**: `string` + +The function name. + +--- + +### module + +> **module**: `string` + +The module name to which the function belongs. + +--- + +### package + +> **package**: `string` + +The package ID to which the function belongs. diff --git a/docs/content/ts-sdk/api/client/interfaces/MoveVariant.md b/docs/content/ts-sdk/api/client/interfaces/MoveVariant.md new file mode 100644 index 00000000000..b5ec11a3d8f --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/MoveVariant.md @@ -0,0 +1,23 @@ +# Interface: MoveVariant + +## Properties + +### fields + +> **fields**: `object` + +#### Index Signature + +\[`key`: `string`\]: [`MoveValue`](../type-aliases/MoveValue.md) + +--- + +### type + +> **type**: `string` + +--- + +### variant + +> **variant**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/MultiGetObjectsParams.md b/docs/content/ts-sdk/api/client/interfaces/MultiGetObjectsParams.md new file mode 100644 index 00000000000..bb4b886dc0f --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/MultiGetObjectsParams.md @@ -0,0 +1,19 @@ +# Interface: MultiGetObjectsParams + +Return the object data for a list of objects + +## Properties + +### ids + +> **ids**: `string`[] + +the IDs of the queried objects + +--- + +### options? + +> `optional` **options**: `null` \| [`IotaObjectDataOptions`](IotaObjectDataOptions.md) + +options for specifying the content to be returned diff --git a/docs/content/ts-sdk/api/client/interfaces/MultiGetTransactionBlocksParams.md b/docs/content/ts-sdk/api/client/interfaces/MultiGetTransactionBlocksParams.md new file mode 100644 index 00000000000..1c9436be4be --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/MultiGetTransactionBlocksParams.md @@ -0,0 +1,20 @@ +# Interface: MultiGetTransactionBlocksParams + +Returns an ordered list of transaction responses The method will throw an error if the input +contains any duplicate or the input size exceeds QUERY_MAX_RESULT_LIMIT + +## Properties + +### digests + +> **digests**: `string`[] + +A list of transaction digests. + +--- + +### options? + +> `optional` **options**: `null` \| [`IotaTransactionBlockResponseOptions`](IotaTransactionBlockResponseOptions.md) + +config options to control which fields to fetch diff --git a/docs/content/ts-sdk/api/client/interfaces/MultiSig.md b/docs/content/ts-sdk/api/client/interfaces/MultiSig.md new file mode 100644 index 00000000000..b3f6150e610 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/MultiSig.md @@ -0,0 +1,28 @@ +# Interface: MultiSig + +The struct that contains signatures and public keys necessary for authenticating a MultiSig. + +## Properties + +### bitmap + +> **bitmap**: `number` + +A bitmap that indicates the position of which public key the signature should be authenticated with. + +--- + +### multisig\_pk + +> **multisig\_pk**: [`MultiSigPublicKey`](MultiSigPublicKey.md) + +The public key encoded with each public key with its signature scheme used along with the +corresponding weight. + +--- + +### sigs + +> **sigs**: [`CompressedSignature`](../type-aliases/CompressedSignature.md)[] + +The plain signature encoded with signature scheme. diff --git a/docs/content/ts-sdk/api/client/interfaces/MultiSigPublicKey.md b/docs/content/ts-sdk/api/client/interfaces/MultiSigPublicKey.md new file mode 100644 index 00000000000..28f052a45e2 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/MultiSigPublicKey.md @@ -0,0 +1,20 @@ +# Interface: MultiSigPublicKey + +The struct that contains the public key used for authenticating a MultiSig. + +## Properties + +### pk\_map + +> **pk\_map**: [[`PublicKey`](../type-aliases/PublicKey.md), `number`][] + +A list of public key and its corresponding weight. + +--- + +### threshold + +> **threshold**: `number` + +If the total weight of the public keys corresponding to verified signatures is larger than +threshold, the MultiSig is verified. diff --git a/docs/content/ts-sdk/api/client/interfaces/NetworkConfiguration.md b/docs/content/ts-sdk/api/client/interfaces/NetworkConfiguration.md new file mode 100644 index 00000000000..d065dc211ff --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/NetworkConfiguration.md @@ -0,0 +1,43 @@ +# Interface: NetworkConfiguration + +## Properties + +### id + +> **id**: [`Network`](../enumerations/Network.md) + +--- + +### name + +> **name**: `string` + +--- + +### url + +> **url**: `string` + +--- + +### explorer + +> **explorer**: `string` + +--- + +### chain + +> **chain**: \`$\{string\}:$\{string\}\` + +--- + +### faucet? + +> `optional` **faucet**: `string` + +--- + +### kiosk? + +> `optional` **kiosk**: [`KioskConfiguration`](KioskConfiguration.md) diff --git a/docs/content/ts-sdk/api/client/interfaces/NetworkMetrics.md b/docs/content/ts-sdk/api/client/interfaces/NetworkMetrics.md new file mode 100644 index 00000000000..3ab8ca92476 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/NetworkMetrics.md @@ -0,0 +1,57 @@ +# Interface: NetworkMetrics + +## Properties + +### currentCheckpoint + +> **currentCheckpoint**: `string` + +Current checkpoint number + +--- + +### currentEpoch + +> **currentEpoch**: `string` + +Current epoch number + +--- + +### currentTps + +> **currentTps**: `number` + +Current TPS - Transaction Blocks per Second. + +--- + +### totalAddresses + +> **totalAddresses**: `string` + +Total number of addresses seen in the network + +--- + +### totalObjects + +> **totalObjects**: `string` + +Total number of live objects in the network + +--- + +### totalPackages + +> **totalPackages**: `string` + +Total number of packages published in the network + +--- + +### tps30Days + +> **tps30Days**: `number` + +Peak TPS in the past 30 days diff --git a/docs/content/ts-sdk/api/client/interfaces/OrderArguments.md b/docs/content/ts-sdk/api/client/interfaces/OrderArguments.md new file mode 100644 index 00000000000..2a7e253eee2 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/OrderArguments.md @@ -0,0 +1,7 @@ +# Interface: OrderArguments + +## Properties + +### order? + +> `optional` **order**: `null` \| [`Order`](../type-aliases/Order.md) diff --git a/docs/content/ts-sdk/api/client/interfaces/OwnedObjectRef.md b/docs/content/ts-sdk/api/client/interfaces/OwnedObjectRef.md new file mode 100644 index 00000000000..ab63f1639fa --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/OwnedObjectRef.md @@ -0,0 +1,13 @@ +# Interface: OwnedObjectRef + +## Properties + +### owner + +> **owner**: [`ObjectOwner`](../type-aliases/ObjectOwner.md) + +--- + +### reference + +> **reference**: [`IotaObjectRef`](IotaObjectRef.md) diff --git a/docs/content/ts-sdk/api/client/interfaces/PaginatedCheckpoints.md b/docs/content/ts-sdk/api/client/interfaces/PaginatedCheckpoints.md new file mode 100644 index 00000000000..acd0188123d --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/PaginatedCheckpoints.md @@ -0,0 +1,23 @@ +# Interface: PaginatedCheckpoints + +`next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the +next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first +item. + +## Properties + +### data + +> **data**: [`Checkpoint`](Checkpoint.md)[] + +--- + +### hasNextPage + +> **hasNextPage**: `boolean` + +--- + +### nextCursor? + +> `optional` **nextCursor**: `null` \| `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/PaginatedCoins.md b/docs/content/ts-sdk/api/client/interfaces/PaginatedCoins.md new file mode 100644 index 00000000000..0e3be66b2f3 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/PaginatedCoins.md @@ -0,0 +1,23 @@ +# Interface: PaginatedCoins + +`next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the +next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first +item. + +## Properties + +### data + +> **data**: [`CoinStruct`](CoinStruct.md)[] + +--- + +### hasNextPage + +> **hasNextPage**: `boolean` + +--- + +### nextCursor? + +> `optional` **nextCursor**: `null` \| `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/PaginatedDynamicFieldInfos.md b/docs/content/ts-sdk/api/client/interfaces/PaginatedDynamicFieldInfos.md new file mode 100644 index 00000000000..7c4bf33f4a6 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/PaginatedDynamicFieldInfos.md @@ -0,0 +1,23 @@ +# Interface: PaginatedDynamicFieldInfos + +`next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the +next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first +item. + +## Properties + +### data + +> **data**: [`DynamicFieldInfo`](DynamicFieldInfo.md)[] + +--- + +### hasNextPage + +> **hasNextPage**: `boolean` + +--- + +### nextCursor? + +> `optional` **nextCursor**: `null` \| `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/PaginatedEpochInfos.md b/docs/content/ts-sdk/api/client/interfaces/PaginatedEpochInfos.md new file mode 100644 index 00000000000..d82329f9387 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/PaginatedEpochInfos.md @@ -0,0 +1,23 @@ +# Interface: PaginatedEpochInfos + +`next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the +next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first +item. + +## Properties + +### data + +> **data**: [`EpochInfo`](EpochInfo.md)[] + +--- + +### hasNextPage + +> **hasNextPage**: `boolean` + +--- + +### nextCursor? + +> `optional` **nextCursor**: `null` \| `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/PaginatedEpochMetricss.md b/docs/content/ts-sdk/api/client/interfaces/PaginatedEpochMetricss.md new file mode 100644 index 00000000000..c4a4a7d697f --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/PaginatedEpochMetricss.md @@ -0,0 +1,23 @@ +# Interface: PaginatedEpochMetricss + +`next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the +next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first +item. + +## Properties + +### data + +> **data**: [`EpochMetrics`](EpochMetrics.md)[] + +--- + +### hasNextPage + +> **hasNextPage**: `boolean` + +--- + +### nextCursor? + +> `optional` **nextCursor**: `null` \| `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/PaginatedEvents.md b/docs/content/ts-sdk/api/client/interfaces/PaginatedEvents.md new file mode 100644 index 00000000000..300f3849c7e --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/PaginatedEvents.md @@ -0,0 +1,23 @@ +# Interface: PaginatedEvents + +`next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the +next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first +item. + +## Properties + +### data + +> **data**: [`IotaEvent`](IotaEvent.md)[] + +--- + +### hasNextPage + +> **hasNextPage**: `boolean` + +--- + +### nextCursor? + +> `optional` **nextCursor**: `null` \| [`EventId`](EventId.md) diff --git a/docs/content/ts-sdk/api/client/interfaces/PaginatedObjectsResponse.md b/docs/content/ts-sdk/api/client/interfaces/PaginatedObjectsResponse.md new file mode 100644 index 00000000000..047de986799 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/PaginatedObjectsResponse.md @@ -0,0 +1,23 @@ +# Interface: PaginatedObjectsResponse + +`next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the +next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first +item. + +## Properties + +### data + +> **data**: [`IotaObjectResponse`](IotaObjectResponse.md)[] + +--- + +### hasNextPage + +> **hasNextPage**: `boolean` + +--- + +### nextCursor? + +> `optional` **nextCursor**: `null` \| `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/PaginatedTransactionResponse.md b/docs/content/ts-sdk/api/client/interfaces/PaginatedTransactionResponse.md new file mode 100644 index 00000000000..2a820321557 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/PaginatedTransactionResponse.md @@ -0,0 +1,23 @@ +# Interface: PaginatedTransactionResponse + +`next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the +next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first +item. + +## Properties + +### data + +> **data**: [`IotaTransactionBlockResponse`](IotaTransactionBlockResponse.md)[] + +--- + +### hasNextPage + +> **hasNextPage**: `boolean` + +--- + +### nextCursor? + +> `optional` **nextCursor**: `null` \| `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/PaginationArguments.md b/docs/content/ts-sdk/api/client/interfaces/PaginationArguments.md new file mode 100644 index 00000000000..48e3a007045 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/PaginationArguments.md @@ -0,0 +1,21 @@ +# Interface: PaginationArguments\<Cursor\> + +## Type Parameters + +• **Cursor** + +## Properties + +### cursor? + +> `optional` **cursor**: `Cursor` + +Optional paging cursor + +--- + +### limit? + +> `optional` **limit**: `null` \| `number` + +Maximum item returned per page diff --git a/docs/content/ts-sdk/api/client/interfaces/PasskeyAuthenticator.md b/docs/content/ts-sdk/api/client/interfaces/PasskeyAuthenticator.md new file mode 100644 index 00000000000..2bba01e9c04 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/PasskeyAuthenticator.md @@ -0,0 +1,24 @@ +# Interface: PasskeyAuthenticator + +An passkey authenticator with parsed fields. See field definition below. Can be initialized from +[struct RawPasskeyAuthenticator]. + +## Properties + +### authenticator\_data + +> **authenticator\_data**: `number`[] + +`authenticatorData` is a bytearray that encodes +[Authenticator Data](https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data) structure returned +by the authenticator attestation response as is. + +--- + +### client\_data\_json + +> **client\_data\_json**: `string` + +`clientDataJSON` contains a JSON-compatible UTF-8 encoded string of the client data which is passed +to the authenticator by the client during the authentication request (see +[CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata)) diff --git a/docs/content/ts-sdk/api/client/interfaces/ProtocolConfig.md b/docs/content/ts-sdk/api/client/interfaces/ProtocolConfig.md new file mode 100644 index 00000000000..86dd2b6510d --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/ProtocolConfig.md @@ -0,0 +1,39 @@ +# Interface: ProtocolConfig + +## Properties + +### attributes + +> **attributes**: `object` + +#### Index Signature + +\[`key`: `string`\]: [`ProtocolConfigValue`](../type-aliases/ProtocolConfigValue.md) \| `null` + +--- + +### featureFlags + +> **featureFlags**: `object` + +#### Index Signature + +\[`key`: `string`\]: `boolean` + +--- + +### maxSupportedProtocolVersion + +> **maxSupportedProtocolVersion**: `string` + +--- + +### minSupportedProtocolVersion + +> **minSupportedProtocolVersion**: `string` + +--- + +### protocolVersion + +> **protocolVersion**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/QueryEventsParams.md b/docs/content/ts-sdk/api/client/interfaces/QueryEventsParams.md new file mode 100644 index 00000000000..2ee5773831f --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/QueryEventsParams.md @@ -0,0 +1,37 @@ +# Interface: QueryEventsParams + +Return list of events for a specified query criteria. + +## Properties + +### query + +> **query**: [`IotaEventFilter`](../type-aliases/IotaEventFilter.md) + +The event query criteria. See +[Event filter](https://docs.iota.org/developer/iota-101/using-events#applying-event-filters) +documentation for examples. + +--- + +### cursor? + +> `optional` **cursor**: `null` \| [`EventId`](EventId.md) + +optional paging cursor + +--- + +### limit? + +> `optional` **limit**: `null` \| `number` + +maximum number of items per page, default to [QUERY_MAX_RESULT_LIMIT] if not specified. + +--- + +### order? + +> `optional` **order**: `null` \| `"ascending"` \| `"descending"` + +query result ordering, default to false (ascending order), oldest record first. diff --git a/docs/content/ts-sdk/api/client/interfaces/SubscribeEventParams.md b/docs/content/ts-sdk/api/client/interfaces/SubscribeEventParams.md new file mode 100644 index 00000000000..448b21e9591 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/SubscribeEventParams.md @@ -0,0 +1,13 @@ +# Interface: SubscribeEventParams + +Subscribe to a stream of Iota event + +## Properties + +### filter + +> **filter**: [`IotaEventFilter`](../type-aliases/IotaEventFilter.md) + +The filter criteria of the event stream. See +[Event filter](https://docs.iota.org/developer/iota-101/using-events#applying-event-filters) +documentation for examples. diff --git a/docs/content/ts-sdk/api/client/interfaces/SubscribeTransactionParams.md b/docs/content/ts-sdk/api/client/interfaces/SubscribeTransactionParams.md new file mode 100644 index 00000000000..080041b1f59 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/SubscribeTransactionParams.md @@ -0,0 +1,9 @@ +# Interface: SubscribeTransactionParams + +Subscribe to a stream of Iota transaction effects + +## Properties + +### filter + +> **filter**: [`TransactionFilter`](../type-aliases/TransactionFilter.md) diff --git a/docs/content/ts-sdk/api/client/interfaces/TransactionBlockBytes.md b/docs/content/ts-sdk/api/client/interfaces/TransactionBlockBytes.md new file mode 100644 index 00000000000..b85858cd1b6 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/TransactionBlockBytes.md @@ -0,0 +1,25 @@ +# Interface: TransactionBlockBytes + +## Properties + +### gas + +> **gas**: [`IotaObjectRef`](IotaObjectRef.md)[] + +the gas objects to be used + +--- + +### inputObjects + +> **inputObjects**: [`InputObjectKind`](../type-aliases/InputObjectKind.md)[] + +objects to be used in this transaction + +--- + +### txBytes + +> **txBytes**: `string` + +BCS serialized transaction data bytes without its type tag, as base-64 encoded string. diff --git a/docs/content/ts-sdk/api/client/interfaces/TransactionBlockEffectsModifiedAtVersions.md b/docs/content/ts-sdk/api/client/interfaces/TransactionBlockEffectsModifiedAtVersions.md new file mode 100644 index 00000000000..4ddb17de766 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/TransactionBlockEffectsModifiedAtVersions.md @@ -0,0 +1,13 @@ +# Interface: TransactionBlockEffectsModifiedAtVersions + +## Properties + +### objectId + +> **objectId**: `string` + +--- + +### sequenceNumber + +> **sequenceNumber**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/TransferObjectParams.md b/docs/content/ts-sdk/api/client/interfaces/TransferObjectParams.md new file mode 100644 index 00000000000..3d1289d1796 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/TransferObjectParams.md @@ -0,0 +1,13 @@ +# Interface: TransferObjectParams + +## Properties + +### objectId + +> **objectId**: `string` + +--- + +### recipient + +> **recipient**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/TryGetPastObjectParams.md b/docs/content/ts-sdk/api/client/interfaces/TryGetPastObjectParams.md new file mode 100644 index 00000000000..3be99d62b98 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/TryGetPastObjectParams.md @@ -0,0 +1,29 @@ +# Interface: TryGetPastObjectParams + +Note there is no software-level guarantee/SLA that objects with past versions can be retrieved by +this API, even if the object and version exists/existed. The result may vary across nodes depending +on their pruning policies. Return the object information for a specified version + +## Properties + +### id + +> **id**: `string` + +the ID of the queried object + +--- + +### version + +> **version**: `number` + +the version of the queried object. If None, default to the latest known version + +--- + +### options? + +> `optional` **options**: `null` \| [`IotaObjectDataOptions`](IotaObjectDataOptions.md) + +options for specifying the content to be returned diff --git a/docs/content/ts-sdk/api/client/interfaces/TryMultiGetPastObjectsParams.md b/docs/content/ts-sdk/api/client/interfaces/TryMultiGetPastObjectsParams.md new file mode 100644 index 00000000000..681a2aa78ff --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/TryMultiGetPastObjectsParams.md @@ -0,0 +1,21 @@ +# Interface: TryMultiGetPastObjectsParams + +Note there is no software-level guarantee/SLA that objects with past versions can be retrieved by +this API, even if the object and version exists/existed. The result may vary across nodes depending +on their pruning policies. Return the object information for a specified version + +## Properties + +### pastObjects + +> **pastObjects**: [`GetPastObjectRequest`](GetPastObjectRequest.md)[] + +a vector of object and versions to be queried + +--- + +### options? + +> `optional` **options**: `null` \| [`IotaObjectDataOptions`](IotaObjectDataOptions.md) + +options for specifying the content to be returned diff --git a/docs/content/ts-sdk/api/client/interfaces/TypeOrigin.md b/docs/content/ts-sdk/api/client/interfaces/TypeOrigin.md new file mode 100644 index 00000000000..1c21b67dedd --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/TypeOrigin.md @@ -0,0 +1,21 @@ +# Interface: TypeOrigin + +Identifies a struct and the module it was defined in + +## Properties + +### datatype\_name + +> **datatype\_name**: `string` + +--- + +### module\_name + +> **module\_name**: `string` + +--- + +### package + +> **package**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/UnsafeBatchTransactionParams.md b/docs/content/ts-sdk/api/client/interfaces/UnsafeBatchTransactionParams.md new file mode 100644 index 00000000000..a6288e19ef6 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/UnsafeBatchTransactionParams.md @@ -0,0 +1,44 @@ +# Interface: UnsafeBatchTransactionParams + +Create an unsigned batched transaction. + +## Properties + +### signer + +> **signer**: `string` + +the transaction signer's Iota address + +--- + +### singleTransactionParams + +> **singleTransactionParams**: [`RPCTransactionRequestParams`](../type-aliases/RPCTransactionRequestParams.md)[] + +list of transaction request parameters + +--- + +### gas? + +> `optional` **gas**: `null` \| `string` + +gas object to be used in this transaction, node will pick one from the signer's possession if not +provided + +--- + +### gasBudget + +> **gasBudget**: `string` + +the gas budget, the transaction will fail if the gas cost exceed the budget + +--- + +### txnBuilderMode? + +> `optional` **txnBuilderMode**: `null` \| [`IotaTransactionBlockBuilderMode`](../type-aliases/IotaTransactionBlockBuilderMode.md) + +Whether this is a regular transaction or a Dev Inspect Transaction diff --git a/docs/content/ts-sdk/api/client/interfaces/UnsafeMergeCoinsParams.md b/docs/content/ts-sdk/api/client/interfaces/UnsafeMergeCoinsParams.md new file mode 100644 index 00000000000..14c57e62319 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/UnsafeMergeCoinsParams.md @@ -0,0 +1,45 @@ +# Interface: UnsafeMergeCoinsParams + +Create an unsigned transaction to merge multiple coins into one coin. + +## Properties + +### signer + +> **signer**: `string` + +the transaction signer's Iota address + +--- + +### primaryCoin + +> **primaryCoin**: `string` + +the coin object to merge into, this coin will remain after the transaction + +--- + +### coinToMerge + +> **coinToMerge**: `string` + +the coin object to be merged, this coin will be destroyed, the balance will be added to +`primary_coin` + +--- + +### gas? + +> `optional` **gas**: `null` \| `string` + +gas object to be used in this transaction, node will pick one from the signer's possession if not +provided + +--- + +### gasBudget + +> **gasBudget**: `string` + +the gas budget, the transaction will fail if the gas cost exceed the budget diff --git a/docs/content/ts-sdk/api/client/interfaces/UnsafeMoveCallParams.md b/docs/content/ts-sdk/api/client/interfaces/UnsafeMoveCallParams.md new file mode 100644 index 00000000000..8033a1b9ef2 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/UnsafeMoveCallParams.md @@ -0,0 +1,79 @@ +# Interface: UnsafeMoveCallParams + +Create an unsigned transaction to execute a Move call on the network, by calling the specified +function in the module of a given package. + +## Properties + +### signer + +> **signer**: `string` + +the transaction signer's Iota address + +--- + +### packageObjectId + +> **packageObjectId**: `string` + +the Move package ID, e.g. `0x2` + +--- + +### module + +> **module**: `string` + +the Move module name, e.g. `pay` + +--- + +### function + +> **function**: `string` + +the move function name, e.g. `split` + +--- + +### typeArguments + +> **typeArguments**: `string`[] + +the type arguments of the Move function + +--- + +### arguments + +> **arguments**: `unknown`[] + +the arguments to be passed into the Move function, in +[IotaJson](https://docs.iota.org/references/iota-api) format + +--- + +### gas? + +> `optional` **gas**: `null` \| `string` + +gas object to be used in this transaction, node will pick one from the signer's possession if not +provided + +--- + +### gasBudget + +> **gasBudget**: `string` + +the gas budget, the transaction will fail if the gas cost exceed the budget + +--- + +### executionMode? + +> `optional` **executionMode**: `null` \| [`IotaTransactionBlockBuilderMode`](../type-aliases/IotaTransactionBlockBuilderMode.md) + +Whether this is a Normal transaction or a Dev Inspect Transaction. Default to be +`IotaTransactionBlockBuilderMode::Commit` when it's None. diff --git a/docs/content/ts-sdk/api/client/interfaces/UnsafePayAllIotaParams.md b/docs/content/ts-sdk/api/client/interfaces/UnsafePayAllIotaParams.md new file mode 100644 index 00000000000..8ef301e08cf --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/UnsafePayAllIotaParams.md @@ -0,0 +1,39 @@ +# Interface: UnsafePayAllIotaParams + +Send all IOTA coins to one recipient. This is for IOTA coin only and does not require a separate gas +coin object. Specifically, what pay_all_iota does are: 1. accumulate all IOTA from input coins and +deposit all IOTA to the first input coin 2. transfer the updated first coin to the recipient and +also use this first coin as gas coin object. 3. the balance of the first input coin after tx is +sum(input_coins) - actual_gas_cost. 4. all other input coins other than the first are deleted. + +## Properties + +### signer + +> **signer**: `string` + +the transaction signer's Iota address + +--- + +### inputCoins + +> **inputCoins**: `string`[] + +the Iota coins to be used in this transaction, including the coin for gas payment. + +--- + +### recipient + +> **recipient**: `string` + +the recipient address, + +--- + +### gasBudget + +> **gasBudget**: `string` + +the gas budget, the transaction will fail if the gas cost exceed the budget diff --git a/docs/content/ts-sdk/api/client/interfaces/UnsafePayIotaParams.md b/docs/content/ts-sdk/api/client/interfaces/UnsafePayIotaParams.md new file mode 100644 index 00000000000..9a99d4b1006 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/UnsafePayIotaParams.md @@ -0,0 +1,49 @@ +# Interface: UnsafePayIotaParams + +Send IOTA coins to a list of addresses, following a list of amounts. This is for IOTA coin only and +does not require a separate gas coin object. Specifically, what pay_iota does are: 1. debit each +input_coin to create new coin following the order of amounts and assign it to the corresponding +recipient. 2. accumulate all residual IOTA from input coins left and deposit all IOTA to the first +input coin, then use the first input coin as the gas coin object. 3. the balance of the first input +coin after tx is sum(input_coins) - sum(amounts) - actual_gas_cost 4. all other input coints other +than the first one are deleted. + +## Properties + +### signer + +> **signer**: `string` + +the transaction signer's Iota address + +--- + +### inputCoins + +> **inputCoins**: `string`[] + +the Iota coins to be used in this transaction, including the coin for gas payment. + +--- + +### recipients + +> **recipients**: `string`[] + +the recipients' addresses, the length of this vector must be the same as amounts. + +--- + +### amounts + +> **amounts**: `string`[] + +the amounts to be transferred to recipients, following the same order + +--- + +### gasBudget + +> **gasBudget**: `string` + +the gas budget, the transaction will fail if the gas cost exceed the budget diff --git a/docs/content/ts-sdk/api/client/interfaces/UnsafePayParams.md b/docs/content/ts-sdk/api/client/interfaces/UnsafePayParams.md new file mode 100644 index 00000000000..4ad4bb50cc5 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/UnsafePayParams.md @@ -0,0 +1,55 @@ +# Interface: UnsafePayParams + +Send `Coin<T>` to a list of addresses, where `T` can be any coin type, following a list of amounts, +The object specified in the `gas` field will be used to pay the gas fee for the transaction. The gas +object can not appear in `input_coins`. If the gas object is not specified, the RPC server will +auto-select one. + +## Properties + +### signer + +> **signer**: `string` + +the transaction signer's Iota address + +--- + +### inputCoins + +> **inputCoins**: `string`[] + +the Iota coins to be used in this transaction + +--- + +### recipients + +> **recipients**: `string`[] + +the recipients' addresses, the length of this vector must be the same as amounts. + +--- + +### amounts + +> **amounts**: `string`[] + +the amounts to be transferred to recipients, following the same order + +--- + +### gas? + +> `optional` **gas**: `null` \| `string` + +gas object to be used in this transaction, node will pick one from the signer's possession if not +provided + +--- + +### gasBudget + +> **gasBudget**: `string` + +the gas budget, the transaction will fail if the gas cost exceed the budget diff --git a/docs/content/ts-sdk/api/client/interfaces/UnsafePublishParams.md b/docs/content/ts-sdk/api/client/interfaces/UnsafePublishParams.md new file mode 100644 index 00000000000..f71ddfc0c58 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/UnsafePublishParams.md @@ -0,0 +1,44 @@ +# Interface: UnsafePublishParams + +Create an unsigned transaction to publish a Move package. + +## Properties + +### sender + +> **sender**: `string` + +the transaction signer's Iota address + +--- + +### compiledModules + +> **compiledModules**: `string`[] + +the compiled bytes of a Move package + +--- + +### dependencies + +> **dependencies**: `string`[] + +a list of transitive dependency addresses that this set of modules depends on. + +--- + +### gas? + +> `optional` **gas**: `null` \| `string` + +gas object to be used in this transaction, node will pick one from the signer's possession if not +provided + +--- + +### gasBudget + +> **gasBudget**: `string` + +the gas budget, the transaction will fail if the gas cost exceed the budget diff --git a/docs/content/ts-sdk/api/client/interfaces/UnsafeRequestAddStakeParams.md b/docs/content/ts-sdk/api/client/interfaces/UnsafeRequestAddStakeParams.md new file mode 100644 index 00000000000..ff4ff0f0d84 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/UnsafeRequestAddStakeParams.md @@ -0,0 +1,52 @@ +# Interface: UnsafeRequestAddStakeParams + +Add stake to a validator's staking pool using multiple coins and amount. + +## Properties + +### signer + +> **signer**: `string` + +the transaction signer's Iota address + +--- + +### coins + +> **coins**: `string`[] + +Coin<IOTA> object to stake + +--- + +### amount? + +> `optional` **amount**: `null` \| `string` + +stake amount + +--- + +### validator + +> **validator**: `string` + +the validator's Iota address + +--- + +### gas? + +> `optional` **gas**: `null` \| `string` + +gas object to be used in this transaction, node will pick one from the signer's possession if not +provided + +--- + +### gasBudget + +> **gasBudget**: `string` + +the gas budget, the transaction will fail if the gas cost exceed the budget diff --git a/docs/content/ts-sdk/api/client/interfaces/UnsafeRequestAddTimelockedStakeParams.md b/docs/content/ts-sdk/api/client/interfaces/UnsafeRequestAddTimelockedStakeParams.md new file mode 100644 index 00000000000..b012505ed4a --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/UnsafeRequestAddTimelockedStakeParams.md @@ -0,0 +1,43 @@ +# Interface: UnsafeRequestAddTimelockedStakeParams + +Add timelocked stake to a validator's staking pool using multiple balances and amount. + +## Properties + +### signer + +> **signer**: `string` + +the transaction signer's Iota address + +--- + +### lockedBalance + +> **lockedBalance**: `string` + +TimeLock<Balance<IOTA>> object to stake + +--- + +### validator + +> **validator**: `string` + +the validator's Iota address + +--- + +### gas + +> **gas**: `string` + +gas object to be used in this transaction + +--- + +### gasBudget + +> **gasBudget**: `string` + +the gas budget, the transaction will fail if the gas cost exceed the budget diff --git a/docs/content/ts-sdk/api/client/interfaces/UnsafeRequestWithdrawStakeParams.md b/docs/content/ts-sdk/api/client/interfaces/UnsafeRequestWithdrawStakeParams.md new file mode 100644 index 00000000000..fd1f21c21ba --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/UnsafeRequestWithdrawStakeParams.md @@ -0,0 +1,36 @@ +# Interface: UnsafeRequestWithdrawStakeParams + +Withdraw stake from a validator's staking pool. + +## Properties + +### signer + +> **signer**: `string` + +the transaction signer's Iota address + +--- + +### stakedIota + +> **stakedIota**: `string` + +StakedIota object ID + +--- + +### gas? + +> `optional` **gas**: `null` \| `string` + +gas object to be used in this transaction, node will pick one from the signer's possession if not +provided + +--- + +### gasBudget + +> **gasBudget**: `string` + +the gas budget, the transaction will fail if the gas cost exceed the budget diff --git a/docs/content/ts-sdk/api/client/interfaces/UnsafeRequestWithdrawTimelockedStakeParams.md b/docs/content/ts-sdk/api/client/interfaces/UnsafeRequestWithdrawTimelockedStakeParams.md new file mode 100644 index 00000000000..c3ed583dd1c --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/UnsafeRequestWithdrawTimelockedStakeParams.md @@ -0,0 +1,35 @@ +# Interface: UnsafeRequestWithdrawTimelockedStakeParams + +Withdraw timelocked stake from a validator's staking pool. + +## Properties + +### signer + +> **signer**: `string` + +the transaction signer's Iota address + +--- + +### timelockedStakedIota + +> **timelockedStakedIota**: `string` + +TimelockedStakedIota object ID + +--- + +### gas + +> **gas**: `string` + +gas object to be used in this transaction + +--- + +### gasBudget + +> **gasBudget**: `string` + +the gas budget, the transaction will fail if the gas cost exceed the budget diff --git a/docs/content/ts-sdk/api/client/interfaces/UnsafeSplitCoinEqualParams.md b/docs/content/ts-sdk/api/client/interfaces/UnsafeSplitCoinEqualParams.md new file mode 100644 index 00000000000..cb19a46b51e --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/UnsafeSplitCoinEqualParams.md @@ -0,0 +1,44 @@ +# Interface: UnsafeSplitCoinEqualParams + +Create an unsigned transaction to split a coin object into multiple equal-size coins. + +## Properties + +### signer + +> **signer**: `string` + +the transaction signer's Iota address + +--- + +### coinObjectId + +> **coinObjectId**: `string` + +the coin object to be spilt + +--- + +### splitCount + +> **splitCount**: `string` + +the number of coins to split into + +--- + +### gas? + +> `optional` **gas**: `null` \| `string` + +gas object to be used in this transaction, node will pick one from the signer's possession if not +provided + +--- + +### gasBudget + +> **gasBudget**: `string` + +the gas budget, the transaction will fail if the gas cost exceed the budget diff --git a/docs/content/ts-sdk/api/client/interfaces/UnsafeSplitCoinParams.md b/docs/content/ts-sdk/api/client/interfaces/UnsafeSplitCoinParams.md new file mode 100644 index 00000000000..59c93b78247 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/UnsafeSplitCoinParams.md @@ -0,0 +1,44 @@ +# Interface: UnsafeSplitCoinParams + +Create an unsigned transaction to split a coin object into multiple coins. + +## Properties + +### signer + +> **signer**: `string` + +the transaction signer's Iota address + +--- + +### coinObjectId + +> **coinObjectId**: `string` + +the coin object to be spilt + +--- + +### splitAmounts + +> **splitAmounts**: `string`[] + +the amounts to split out from the coin + +--- + +### gas? + +> `optional` **gas**: `null` \| `string` + +gas object to be used in this transaction, node will pick one from the signer's possession if not +provided + +--- + +### gasBudget + +> **gasBudget**: `string` + +the gas budget, the transaction will fail if the gas cost exceed the budget diff --git a/docs/content/ts-sdk/api/client/interfaces/UnsafeTransferIotaParams.md b/docs/content/ts-sdk/api/client/interfaces/UnsafeTransferIotaParams.md new file mode 100644 index 00000000000..6c1333e2eee --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/UnsafeTransferIotaParams.md @@ -0,0 +1,44 @@ +# Interface: UnsafeTransferIotaParams + +Create an unsigned transaction to send IOTA coin object to a Iota address. The IOTA object is also +used as the gas object. + +## Properties + +### signer + +> **signer**: `string` + +the transaction signer's Iota address + +--- + +### iotaObjectId + +> **iotaObjectId**: `string` + +the Iota coin object to be used in this transaction + +--- + +### gasBudget + +> **gasBudget**: `string` + +the gas budget, the transaction will fail if the gas cost exceed the budget + +--- + +### recipient + +> **recipient**: `string` + +the recipient's Iota address + +--- + +### amount? + +> `optional` **amount**: `null` \| `string` + +the amount to be split out and transferred diff --git a/docs/content/ts-sdk/api/client/interfaces/UnsafeTransferObjectParams.md b/docs/content/ts-sdk/api/client/interfaces/UnsafeTransferObjectParams.md new file mode 100644 index 00000000000..282b0735111 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/UnsafeTransferObjectParams.md @@ -0,0 +1,45 @@ +# Interface: UnsafeTransferObjectParams + +Create an unsigned transaction to transfer an object from one address to another. The object's type +must allow public transfers + +## Properties + +### signer + +> **signer**: `string` + +the transaction signer's Iota address + +--- + +### objectId + +> **objectId**: `string` + +the ID of the object to be transferred + +--- + +### gas? + +> `optional` **gas**: `null` \| `string` + +gas object to be used in this transaction, node will pick one from the signer's possession if not +provided + +--- + +### gasBudget + +> **gasBudget**: `string` + +the gas budget, the transaction will fail if the gas cost exceed the budget + +--- + +### recipient + +> **recipient**: `string` + +the recipient's Iota address diff --git a/docs/content/ts-sdk/api/client/interfaces/UpgradeInfo.md b/docs/content/ts-sdk/api/client/interfaces/UpgradeInfo.md new file mode 100644 index 00000000000..b101ea09001 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/UpgradeInfo.md @@ -0,0 +1,19 @@ +# Interface: UpgradeInfo + +Upgraded package info for the linkage table + +## Properties + +### upgraded\_id + +> **upgraded\_id**: `string` + +ID of the upgraded packages + +--- + +### upgraded\_version + +> **upgraded\_version**: `string` + +Version of the upgraded package diff --git a/docs/content/ts-sdk/api/client/interfaces/ValidatorApy.md b/docs/content/ts-sdk/api/client/interfaces/ValidatorApy.md new file mode 100644 index 00000000000..2f273ef63b3 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/ValidatorApy.md @@ -0,0 +1,13 @@ +# Interface: ValidatorApy + +## Properties + +### address + +> **address**: `string` + +--- + +### apy + +> **apy**: `number` diff --git a/docs/content/ts-sdk/api/client/interfaces/ValidatorsApy.md b/docs/content/ts-sdk/api/client/interfaces/ValidatorsApy.md new file mode 100644 index 00000000000..fc7ae2867f3 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/ValidatorsApy.md @@ -0,0 +1,13 @@ +# Interface: ValidatorsApy + +## Properties + +### apys + +> **apys**: [`ValidatorApy`](ValidatorApy.md)[] + +--- + +### epoch + +> **epoch**: `string` diff --git a/docs/content/ts-sdk/api/client/interfaces/ZkLoginAuthenticator.md b/docs/content/ts-sdk/api/client/interfaces/ZkLoginAuthenticator.md new file mode 100644 index 00000000000..b7d56e93103 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/ZkLoginAuthenticator.md @@ -0,0 +1,21 @@ +# Interface: ZkLoginAuthenticator + +An zk login authenticator with all the necessary fields. + +## Properties + +### inputs + +> **inputs**: [`ZkLoginInputs`](ZkLoginInputs.md) + +--- + +### maxEpoch + +> **maxEpoch**: `string` + +--- + +### userSignature + +> **userSignature**: [`Signature`](../type-aliases/Signature.md) diff --git a/docs/content/ts-sdk/api/client/interfaces/ZkLoginInputs.md b/docs/content/ts-sdk/api/client/interfaces/ZkLoginInputs.md new file mode 100644 index 00000000000..e77e86206d2 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/ZkLoginInputs.md @@ -0,0 +1,27 @@ +# Interface: ZkLoginInputs + +All inputs required for the zk login proof verification and other public inputs. + +## Properties + +### addressSeed + +> **addressSeed**: `string` + +--- + +### headerBase64 + +> **headerBase64**: `string` + +--- + +### issBase64Details + +> **issBase64Details**: [`Claim`](Claim.md) + +--- + +### proofPoints + +> **proofPoints**: [`ZkLoginProof`](ZkLoginProof.md) diff --git a/docs/content/ts-sdk/api/client/interfaces/ZkLoginProof.md b/docs/content/ts-sdk/api/client/interfaces/ZkLoginProof.md new file mode 100644 index 00000000000..4bbdb50a0c6 --- /dev/null +++ b/docs/content/ts-sdk/api/client/interfaces/ZkLoginProof.md @@ -0,0 +1,21 @@ +# Interface: ZkLoginProof + +The struct for zk login proof. + +## Properties + +### a + +> **a**: `string`[] + +--- + +### b + +> **b**: `string`[][] + +--- + +### c + +> **c**: `string`[] diff --git a/docs/content/ts-sdk/api/client/type-aliases/AllEpochsAddressMetrics.md b/docs/content/ts-sdk/api/client/type-aliases/AllEpochsAddressMetrics.md new file mode 100644 index 00000000000..66824162015 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/AllEpochsAddressMetrics.md @@ -0,0 +1,3 @@ +# Type Alias: AllEpochsAddressMetrics + +> **AllEpochsAddressMetrics**: [`AddressMetrics`](../interfaces/AddressMetrics.md)[] diff --git a/docs/content/ts-sdk/api/client/type-aliases/ChainType.md b/docs/content/ts-sdk/api/client/type-aliases/ChainType.md new file mode 100644 index 00000000000..0f161fc3552 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/ChainType.md @@ -0,0 +1,3 @@ +# Type Alias: ChainType + +> **ChainType**: \`$\{string\}:$\{string\}\` diff --git a/docs/content/ts-sdk/api/client/type-aliases/CheckpointCommitment.md b/docs/content/ts-sdk/api/client/type-aliases/CheckpointCommitment.md new file mode 100644 index 00000000000..7e3a5c89f1e --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/CheckpointCommitment.md @@ -0,0 +1,9 @@ +# Type Alias: CheckpointCommitment + +> **CheckpointCommitment**: `object` + +## Type declaration + +### ECMHLiveObjectSetDigest + +> **ECMHLiveObjectSetDigest**: [`ECMHLiveObjectSetDigest`](../interfaces/ECMHLiveObjectSetDigest.md) diff --git a/docs/content/ts-sdk/api/client/type-aliases/CheckpointId.md b/docs/content/ts-sdk/api/client/type-aliases/CheckpointId.md new file mode 100644 index 00000000000..ccd838ad71f --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/CheckpointId.md @@ -0,0 +1,3 @@ +# Type Alias: CheckpointId + +> **CheckpointId**: `string` \| `string` diff --git a/docs/content/ts-sdk/api/client/type-aliases/CheckpointPage.md b/docs/content/ts-sdk/api/client/type-aliases/CheckpointPage.md new file mode 100644 index 00000000000..37ceab5fa74 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/CheckpointPage.md @@ -0,0 +1,17 @@ +# Type Alias: CheckpointPage + +> **CheckpointPage**: `object` + +## Type declaration + +### data + +> **data**: [`Checkpoint`](../interfaces/Checkpoint.md)[] + +### nextCursor + +> **nextCursor**: `string` \| `null` + +### hasNextPage + +> **hasNextPage**: `boolean` diff --git a/docs/content/ts-sdk/api/client/type-aliases/CoinBalance.md b/docs/content/ts-sdk/api/client/type-aliases/CoinBalance.md new file mode 100644 index 00000000000..d732ee8b9c4 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/CoinBalance.md @@ -0,0 +1,17 @@ +# Type Alias: CoinBalance + +> **CoinBalance**: `object` + +## Type declaration + +### coinType + +> **coinType**: `string` + +### coinObjectCount + +> **coinObjectCount**: `number` + +### totalBalance + +> **totalBalance**: `string` diff --git a/docs/content/ts-sdk/api/client/type-aliases/CompressedSignature.md b/docs/content/ts-sdk/api/client/type-aliases/CompressedSignature.md new file mode 100644 index 00000000000..8a5bdd2ac41 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/CompressedSignature.md @@ -0,0 +1,5 @@ +# Type Alias: CompressedSignature + +> **CompressedSignature**: `object` \| `object` \| `object` \| `object` + +Unlike [enum Signature], [enum CompressedSignature] does not contain public key. diff --git a/docs/content/ts-sdk/api/client/type-aliases/ConsensusDeterminedVersionAssignments.md b/docs/content/ts-sdk/api/client/type-aliases/ConsensusDeterminedVersionAssignments.md new file mode 100644 index 00000000000..c183c48de8d --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/ConsensusDeterminedVersionAssignments.md @@ -0,0 +1,11 @@ +# Type Alias: ConsensusDeterminedVersionAssignments + +> **ConsensusDeterminedVersionAssignments**: `object` + +Uses an enum to allow for future expansion of the ConsensusDeterminedVersionAssignments. + +## Type declaration + +### CancelledTransactions + +> **CancelledTransactions**: [`string`, [`string`, `string`][]][] diff --git a/docs/content/ts-sdk/api/client/type-aliases/DynamicFieldPage.md b/docs/content/ts-sdk/api/client/type-aliases/DynamicFieldPage.md new file mode 100644 index 00000000000..50cf6e7176c --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/DynamicFieldPage.md @@ -0,0 +1,17 @@ +# Type Alias: DynamicFieldPage + +> **DynamicFieldPage**: `object` + +## Type declaration + +### data + +> **data**: [`DynamicFieldInfo`](../interfaces/DynamicFieldInfo.md)[] + +### nextCursor + +> **nextCursor**: `string` \| `null` + +### hasNextPage + +> **hasNextPage**: `boolean` diff --git a/docs/content/ts-sdk/api/client/type-aliases/DynamicFieldType.md b/docs/content/ts-sdk/api/client/type-aliases/DynamicFieldType.md new file mode 100644 index 00000000000..e5229fba910 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/DynamicFieldType.md @@ -0,0 +1,3 @@ +# Type Alias: DynamicFieldType + +> **DynamicFieldType**: `"DynamicField"` \| `"DynamicObject"` diff --git a/docs/content/ts-sdk/api/client/type-aliases/EpochMetricsPage.md b/docs/content/ts-sdk/api/client/type-aliases/EpochMetricsPage.md new file mode 100644 index 00000000000..5d4d5f7fd02 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/EpochMetricsPage.md @@ -0,0 +1,17 @@ +# Type Alias: EpochMetricsPage + +> **EpochMetricsPage**: `object` + +## Type declaration + +### data + +> **data**: [`EpochMetrics`](../interfaces/EpochMetrics.md)[] + +### nextCursor + +> **nextCursor**: `string` \| `null` + +### hasNextPage + +> **hasNextPage**: `boolean` diff --git a/docs/content/ts-sdk/api/client/type-aliases/EpochPage.md b/docs/content/ts-sdk/api/client/type-aliases/EpochPage.md new file mode 100644 index 00000000000..8ced10634fb --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/EpochPage.md @@ -0,0 +1,17 @@ +# Type Alias: EpochPage + +> **EpochPage**: `object` + +## Type declaration + +### data + +> **data**: [`EpochInfo`](../interfaces/EpochInfo.md)[] + +### nextCursor + +> **nextCursor**: `string` \| `null` + +### hasNextPage + +> **hasNextPage**: `boolean` diff --git a/docs/content/ts-sdk/api/client/type-aliases/ExecuteTransactionRequestType.md b/docs/content/ts-sdk/api/client/type-aliases/ExecuteTransactionRequestType.md new file mode 100644 index 00000000000..66c07a62f2a --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/ExecuteTransactionRequestType.md @@ -0,0 +1,3 @@ +# Type Alias: ExecuteTransactionRequestType + +> **ExecuteTransactionRequestType**: `"WaitForEffectsCert"` \| `"WaitForLocalExecution"` diff --git a/docs/content/ts-sdk/api/client/type-aliases/ExecutionStatus.md b/docs/content/ts-sdk/api/client/type-aliases/ExecutionStatus.md new file mode 100644 index 00000000000..9053a7504ab --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/ExecutionStatus.md @@ -0,0 +1,13 @@ +# Type Alias: ExecutionStatus + +> **ExecutionStatus**: `object` + +## Type declaration + +### status + +> **status**: `"success"` \| `"failure"` + +### error? + +> `optional` **error**: `string` diff --git a/docs/content/ts-sdk/api/client/type-aliases/GetOwnedObjectsParams.md b/docs/content/ts-sdk/api/client/type-aliases/GetOwnedObjectsParams.md new file mode 100644 index 00000000000..cb5aaab254e --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/GetOwnedObjectsParams.md @@ -0,0 +1,28 @@ +# Type Alias: GetOwnedObjectsParams + +> **GetOwnedObjectsParams**: `object` & [`IotaObjectResponseQuery`](../interfaces/IotaObjectResponseQuery.md) + +Return the list of objects owned by an address. Note that if the address owns more than +`QUERY_MAX_RESULT_LIMIT` objects, the pagination is not accurate, because previous page may have +been updated when the next page is fetched. Please use iotax_queryObjects if this is a concern. + +## Type declaration + +### owner + +> **owner**: `string` + +the owner's Iota address + +### cursor? + +> `optional` **cursor**: `string` \| `null` + +An optional paging cursor. If provided, the query will start from the next item after the specified +cursor. Default to start from the first item if not specified. + +### limit? + +> `optional` **limit**: `number` \| `null` + +Max number of items returned per page, default to [QUERY_MAX_RESULT_LIMIT] if not specified. diff --git a/docs/content/ts-sdk/api/client/type-aliases/HttpHeaders.md b/docs/content/ts-sdk/api/client/type-aliases/HttpHeaders.md new file mode 100644 index 00000000000..66cbfed62dc --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/HttpHeaders.md @@ -0,0 +1,9 @@ +# Type Alias: HttpHeaders + +> **HttpHeaders**: `object` + +An object defining headers to be passed to the RPC server + +## Index Signature + +\[`header`: `string`\]: `string` diff --git a/docs/content/ts-sdk/api/client/type-aliases/InputObjectKind.md b/docs/content/ts-sdk/api/client/type-aliases/InputObjectKind.md new file mode 100644 index 00000000000..b6282ac6bac --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/InputObjectKind.md @@ -0,0 +1,3 @@ +# Type Alias: InputObjectKind + +> **InputObjectKind**: `object` \| `object` \| `object` diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaArgument.md b/docs/content/ts-sdk/api/client/type-aliases/IotaArgument.md new file mode 100644 index 00000000000..527b7c68812 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaArgument.md @@ -0,0 +1,5 @@ +# Type Alias: IotaArgument + +> **IotaArgument**: `"GasCoin"` \| `object` \| `object` \| `object` + +An argument to a transaction in a programmable transaction block diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaCallArg.md b/docs/content/ts-sdk/api/client/type-aliases/IotaCallArg.md new file mode 100644 index 00000000000..43b055efa61 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaCallArg.md @@ -0,0 +1,3 @@ +# Type Alias: IotaCallArg + +> **IotaCallArg**: `object` \| `object` \| `object` \| `object` diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaClientOptions.md b/docs/content/ts-sdk/api/client/type-aliases/IotaClientOptions.md new file mode 100644 index 00000000000..90678e95f1a --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaClientOptions.md @@ -0,0 +1,6 @@ +# Type Alias: IotaClientOptions + +> **IotaClientOptions**: `NetworkOrTransport` + +Configuration options for the IotaClient +You must provide either a `url` or a `transport` diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaEndOfEpochTransactionKind.md b/docs/content/ts-sdk/api/client/type-aliases/IotaEndOfEpochTransactionKind.md new file mode 100644 index 00000000000..e4e87103982 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaEndOfEpochTransactionKind.md @@ -0,0 +1,3 @@ +# Type Alias: IotaEndOfEpochTransactionKind + +> **IotaEndOfEpochTransactionKind**: `"AuthenticatorStateCreate"` \| `object` \| `object` \| `object` \| `object` diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaEventFilter.md b/docs/content/ts-sdk/api/client/type-aliases/IotaEventFilter.md new file mode 100644 index 00000000000..029499c5617 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaEventFilter.md @@ -0,0 +1,3 @@ +# Type Alias: IotaEventFilter + +> **IotaEventFilter**: `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaMoveAbility.md b/docs/content/ts-sdk/api/client/type-aliases/IotaMoveAbility.md new file mode 100644 index 00000000000..d3a71608f39 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaMoveAbility.md @@ -0,0 +1,3 @@ +# Type Alias: IotaMoveAbility + +> **IotaMoveAbility**: `"Copy"` \| `"Drop"` \| `"Store"` \| `"Key"` diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaMoveFunctionArgType.md b/docs/content/ts-sdk/api/client/type-aliases/IotaMoveFunctionArgType.md new file mode 100644 index 00000000000..eedf2ab093d --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaMoveFunctionArgType.md @@ -0,0 +1,3 @@ +# Type Alias: IotaMoveFunctionArgType + +> **IotaMoveFunctionArgType**: `"Pure"` \| `object` diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaMoveNormalizedModules.md b/docs/content/ts-sdk/api/client/type-aliases/IotaMoveNormalizedModules.md new file mode 100644 index 00000000000..536db7d4d35 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaMoveNormalizedModules.md @@ -0,0 +1,3 @@ +# Type Alias: IotaMoveNormalizedModules + +> **IotaMoveNormalizedModules**: `Record`\<`string`, [`IotaMoveNormalizedModule`](../interfaces/IotaMoveNormalizedModule.md)\> diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaMoveNormalizedType.md b/docs/content/ts-sdk/api/client/type-aliases/IotaMoveNormalizedType.md new file mode 100644 index 00000000000..511c6533d98 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaMoveNormalizedType.md @@ -0,0 +1,3 @@ +# Type Alias: IotaMoveNormalizedType + +> **IotaMoveNormalizedType**: `"Bool"` \| `"U8"` \| `"U16"` \| `"U32"` \| `"U64"` \| `"U128"` \| `"U256"` \| `"Address"` \| `"Signer"` \| `object` \| `object` \| `object` \| `object` \| `object` diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaMoveObject.md b/docs/content/ts-sdk/api/client/type-aliases/IotaMoveObject.md new file mode 100644 index 00000000000..3fd6b213bde --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaMoveObject.md @@ -0,0 +1,3 @@ +# Type Alias: IotaMoveObject + +> **IotaMoveObject**: `Extract`\<[`IotaParsedData`](IotaParsedData.md), `object`\> diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaMovePackage.md b/docs/content/ts-sdk/api/client/type-aliases/IotaMovePackage.md new file mode 100644 index 00000000000..beb04366e33 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaMovePackage.md @@ -0,0 +1,3 @@ +# Type Alias: IotaMovePackage + +> **IotaMovePackage**: `Extract`\<[`IotaParsedData`](IotaParsedData.md), `object`\> diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaMoveVisibility.md b/docs/content/ts-sdk/api/client/type-aliases/IotaMoveVisibility.md new file mode 100644 index 00000000000..ce97a9ce264 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaMoveVisibility.md @@ -0,0 +1,3 @@ +# Type Alias: IotaMoveVisibility + +> **IotaMoveVisibility**: `"Private"` \| `"Public"` \| `"Friend"` diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaObjectChange.md b/docs/content/ts-sdk/api/client/type-aliases/IotaObjectChange.md new file mode 100644 index 00000000000..2c4f6fd7553 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaObjectChange.md @@ -0,0 +1,6 @@ +# Type Alias: IotaObjectChange + +> **IotaObjectChange**: `object` \| `object` \| `object` \| `object` \| `object` \| `object` + +ObjectChange are derived from the object mutations in the TransactionEffect to provide richer object +information. diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaObjectChangeCreated.md b/docs/content/ts-sdk/api/client/type-aliases/IotaObjectChangeCreated.md new file mode 100644 index 00000000000..6f15567b3d2 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaObjectChangeCreated.md @@ -0,0 +1,3 @@ +# Type Alias: IotaObjectChangeCreated + +> **IotaObjectChangeCreated**: `Extract`\<[`IotaObjectChange`](IotaObjectChange.md), `object`\> diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaObjectChangeDeleted.md b/docs/content/ts-sdk/api/client/type-aliases/IotaObjectChangeDeleted.md new file mode 100644 index 00000000000..758abe5c7e5 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaObjectChangeDeleted.md @@ -0,0 +1,3 @@ +# Type Alias: IotaObjectChangeDeleted + +> **IotaObjectChangeDeleted**: `Extract`\<[`IotaObjectChange`](IotaObjectChange.md), `object`\> diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaObjectChangeMutated.md b/docs/content/ts-sdk/api/client/type-aliases/IotaObjectChangeMutated.md new file mode 100644 index 00000000000..197bf328451 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaObjectChangeMutated.md @@ -0,0 +1,3 @@ +# Type Alias: IotaObjectChangeMutated + +> **IotaObjectChangeMutated**: `Extract`\<[`IotaObjectChange`](IotaObjectChange.md), `object`\> diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaObjectChangePublished.md b/docs/content/ts-sdk/api/client/type-aliases/IotaObjectChangePublished.md new file mode 100644 index 00000000000..e7b8dffc541 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaObjectChangePublished.md @@ -0,0 +1,3 @@ +# Type Alias: IotaObjectChangePublished + +> **IotaObjectChangePublished**: `Extract`\<[`IotaObjectChange`](IotaObjectChange.md), `object`\> diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaObjectChangeTransferred.md b/docs/content/ts-sdk/api/client/type-aliases/IotaObjectChangeTransferred.md new file mode 100644 index 00000000000..3413123602b --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaObjectChangeTransferred.md @@ -0,0 +1,3 @@ +# Type Alias: IotaObjectChangeTransferred + +> **IotaObjectChangeTransferred**: `Extract`\<[`IotaObjectChange`](IotaObjectChange.md), `object`\> diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaObjectChangeWrapped.md b/docs/content/ts-sdk/api/client/type-aliases/IotaObjectChangeWrapped.md new file mode 100644 index 00000000000..86f6372dce9 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaObjectChangeWrapped.md @@ -0,0 +1,3 @@ +# Type Alias: IotaObjectChangeWrapped + +> **IotaObjectChangeWrapped**: `Extract`\<[`IotaObjectChange`](IotaObjectChange.md), `object`\> diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaObjectDataFilter.md b/docs/content/ts-sdk/api/client/type-aliases/IotaObjectDataFilter.md new file mode 100644 index 00000000000..5b0f3fefc67 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaObjectDataFilter.md @@ -0,0 +1,3 @@ +# Type Alias: IotaObjectDataFilter + +> **IotaObjectDataFilter**: `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaParsedData.md b/docs/content/ts-sdk/api/client/type-aliases/IotaParsedData.md new file mode 100644 index 00000000000..f1d525a210b --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaParsedData.md @@ -0,0 +1,3 @@ +# Type Alias: IotaParsedData + +> **IotaParsedData**: `object` \| `object` diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaTransaction.md b/docs/content/ts-sdk/api/client/type-aliases/IotaTransaction.md new file mode 100644 index 00000000000..29d0859477d --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaTransaction.md @@ -0,0 +1,5 @@ +# Type Alias: IotaTransaction + +> **IotaTransaction**: `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` + +A single transaction in a programmable transaction block. diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaTransactionBlockBuilderMode.md b/docs/content/ts-sdk/api/client/type-aliases/IotaTransactionBlockBuilderMode.md new file mode 100644 index 00000000000..46cf3da249f --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaTransactionBlockBuilderMode.md @@ -0,0 +1,3 @@ +# Type Alias: IotaTransactionBlockBuilderMode + +> **IotaTransactionBlockBuilderMode**: `"Commit"` \| `"DevInspect"` diff --git a/docs/content/ts-sdk/api/client/type-aliases/IotaTransactionBlockKind.md b/docs/content/ts-sdk/api/client/type-aliases/IotaTransactionBlockKind.md new file mode 100644 index 00000000000..a893a704a51 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/IotaTransactionBlockKind.md @@ -0,0 +1,3 @@ +# Type Alias: IotaTransactionBlockKind + +> **IotaTransactionBlockKind**: `object` \| `object` \| `object` \| `object` \| `object` \| `object` diff --git a/docs/content/ts-sdk/api/client/type-aliases/MoveCallMetric.md b/docs/content/ts-sdk/api/client/type-aliases/MoveCallMetric.md new file mode 100644 index 00000000000..c3e0fe4d780 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/MoveCallMetric.md @@ -0,0 +1,3 @@ +# Type Alias: MoveCallMetric + +> **MoveCallMetric**: [`object`, `string`] diff --git a/docs/content/ts-sdk/api/client/type-aliases/MoveStruct.md b/docs/content/ts-sdk/api/client/type-aliases/MoveStruct.md new file mode 100644 index 00000000000..312003bc846 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/MoveStruct.md @@ -0,0 +1,3 @@ +# Type Alias: MoveStruct + +> **MoveStruct**: [`MoveValue`](MoveValue.md)[] \| `object` \| `object` diff --git a/docs/content/ts-sdk/api/client/type-aliases/MoveValue.md b/docs/content/ts-sdk/api/client/type-aliases/MoveValue.md new file mode 100644 index 00000000000..4cf8d12c405 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/MoveValue.md @@ -0,0 +1,3 @@ +# Type Alias: MoveValue + +> **MoveValue**: `number` \| `boolean` \| `string` \| [`MoveValue`](MoveValue.md)[] \| `string` \| `object` \| [`MoveStruct`](MoveStruct.md) \| `null` \| [`MoveVariant`](../interfaces/MoveVariant.md) diff --git a/docs/content/ts-sdk/api/client/type-aliases/NetworkId.md b/docs/content/ts-sdk/api/client/type-aliases/NetworkId.md new file mode 100644 index 00000000000..801f6e66072 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/NetworkId.md @@ -0,0 +1,3 @@ +# Type Alias: NetworkId + +> **NetworkId**: [`Network`](../enumerations/Network.md) \| `string` diff --git a/docs/content/ts-sdk/api/client/type-aliases/ObjectOwner.md b/docs/content/ts-sdk/api/client/type-aliases/ObjectOwner.md new file mode 100644 index 00000000000..92227cc8d12 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/ObjectOwner.md @@ -0,0 +1,3 @@ +# Type Alias: ObjectOwner + +> **ObjectOwner**: `object` \| `object` \| `object` \| `"Immutable"` diff --git a/docs/content/ts-sdk/api/client/type-aliases/ObjectRead.md b/docs/content/ts-sdk/api/client/type-aliases/ObjectRead.md new file mode 100644 index 00000000000..261496046e9 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/ObjectRead.md @@ -0,0 +1,3 @@ +# Type Alias: ObjectRead + +> **ObjectRead**: `object` \| `object` \| `object` \| `object` \| `object` diff --git a/docs/content/ts-sdk/api/client/type-aliases/ObjectResponseError.md b/docs/content/ts-sdk/api/client/type-aliases/ObjectResponseError.md new file mode 100644 index 00000000000..7d4a1eb309e --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/ObjectResponseError.md @@ -0,0 +1,3 @@ +# Type Alias: ObjectResponseError + +> **ObjectResponseError**: `object` \| `object` \| `object` \| `object` \| `object` diff --git a/docs/content/ts-sdk/api/client/type-aliases/ObjectValueKind.md b/docs/content/ts-sdk/api/client/type-aliases/ObjectValueKind.md new file mode 100644 index 00000000000..d6a2fd3cc71 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/ObjectValueKind.md @@ -0,0 +1,3 @@ +# Type Alias: ObjectValueKind + +> **ObjectValueKind**: `"ByImmutableReference"` \| `"ByMutableReference"` \| `"ByValue"` diff --git a/docs/content/ts-sdk/api/client/type-aliases/Order.md b/docs/content/ts-sdk/api/client/type-aliases/Order.md new file mode 100644 index 00000000000..02d225e1e28 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/Order.md @@ -0,0 +1,3 @@ +# Type Alias: Order + +> **Order**: `"ascending"` \| `"descending"` diff --git a/docs/content/ts-sdk/api/client/type-aliases/ProgrammableTransaction.md b/docs/content/ts-sdk/api/client/type-aliases/ProgrammableTransaction.md new file mode 100644 index 00000000000..9e5c4dedd98 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/ProgrammableTransaction.md @@ -0,0 +1,13 @@ +# Type Alias: ProgrammableTransaction + +> **ProgrammableTransaction**: `object` + +## Type declaration + +### transactions + +> **transactions**: [`IotaTransaction`](IotaTransaction.md)[] + +### inputs + +> **inputs**: [`IotaCallArg`](IotaCallArg.md)[] diff --git a/docs/content/ts-sdk/api/client/type-aliases/ProtocolConfigValue.md b/docs/content/ts-sdk/api/client/type-aliases/ProtocolConfigValue.md new file mode 100644 index 00000000000..2736c43f41e --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/ProtocolConfigValue.md @@ -0,0 +1,3 @@ +# Type Alias: ProtocolConfigValue + +> **ProtocolConfigValue**: `object` \| `object` \| `object` \| `object` \| `object` diff --git a/docs/content/ts-sdk/api/client/type-aliases/PublicKey.md b/docs/content/ts-sdk/api/client/type-aliases/PublicKey.md new file mode 100644 index 00000000000..93198d6dc31 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/PublicKey.md @@ -0,0 +1,3 @@ +# Type Alias: PublicKey + +> **PublicKey**: `object` \| `object` \| `object` \| `object` \| `object` diff --git a/docs/content/ts-sdk/api/client/type-aliases/QueryTransactionBlocksParams.md b/docs/content/ts-sdk/api/client/type-aliases/QueryTransactionBlocksParams.md new file mode 100644 index 00000000000..6db24317834 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/QueryTransactionBlocksParams.md @@ -0,0 +1,26 @@ +# Type Alias: QueryTransactionBlocksParams + +> **QueryTransactionBlocksParams**: `object` & [`IotaTransactionBlockResponseQuery`](../interfaces/IotaTransactionBlockResponseQuery.md) + +Return list of transactions for a specified query criteria. + +## Type declaration + +### cursor? + +> `optional` **cursor**: `string` \| `null` + +An optional paging cursor. If provided, the query will start from the next item after the specified +cursor. Default to start from the first item if not specified. + +### limit? + +> `optional` **limit**: `number` \| `null` + +Maximum item returned per page, default to QUERY_MAX_RESULT_LIMIT if not specified. + +### order? + +> `optional` **order**: `"ascending"` \| `"descending"` \| `null` + +query result ordering, default to false (ascending order), oldest record first. diff --git a/docs/content/ts-sdk/api/client/type-aliases/RPCTransactionRequestParams.md b/docs/content/ts-sdk/api/client/type-aliases/RPCTransactionRequestParams.md new file mode 100644 index 00000000000..925786949c0 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/RPCTransactionRequestParams.md @@ -0,0 +1,3 @@ +# Type Alias: RPCTransactionRequestParams + +> **RPCTransactionRequestParams**: `object` \| `object` diff --git a/docs/content/ts-sdk/api/client/type-aliases/RawData.md b/docs/content/ts-sdk/api/client/type-aliases/RawData.md new file mode 100644 index 00000000000..31063b30e6d --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/RawData.md @@ -0,0 +1,3 @@ +# Type Alias: RawData + +> **RawData**: `object` \| `object` diff --git a/docs/content/ts-sdk/api/client/type-aliases/Signature.md b/docs/content/ts-sdk/api/client/type-aliases/Signature.md new file mode 100644 index 00000000000..2c0e8c35872 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/Signature.md @@ -0,0 +1,3 @@ +# Type Alias: Signature + +> **Signature**: `object` \| `object` \| `object` diff --git a/docs/content/ts-sdk/api/client/type-aliases/StakeObject.md b/docs/content/ts-sdk/api/client/type-aliases/StakeObject.md new file mode 100644 index 00000000000..4337569ac10 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/StakeObject.md @@ -0,0 +1,3 @@ +# Type Alias: StakeObject + +> **StakeObject**: `object` \| `object` \| `object` diff --git a/docs/content/ts-sdk/api/client/type-aliases/TimelockedStake.md b/docs/content/ts-sdk/api/client/type-aliases/TimelockedStake.md new file mode 100644 index 00000000000..9e5a77c5983 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/TimelockedStake.md @@ -0,0 +1,3 @@ +# Type Alias: TimelockedStake + +> **TimelockedStake**: `object` \| `object` \| `object` diff --git a/docs/content/ts-sdk/api/client/type-aliases/TransactionBlockData.md b/docs/content/ts-sdk/api/client/type-aliases/TransactionBlockData.md new file mode 100644 index 00000000000..d8241f2a8df --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/TransactionBlockData.md @@ -0,0 +1,21 @@ +# Type Alias: TransactionBlockData + +> **TransactionBlockData**: `object` + +## Type declaration + +### gasData + +> **gasData**: [`IotaGasData`](../interfaces/IotaGasData.md) + +### messageVersion + +> **messageVersion**: `"v1"` + +### sender + +> **sender**: `string` + +### transaction + +> **transaction**: [`IotaTransactionBlockKind`](IotaTransactionBlockKind.md) diff --git a/docs/content/ts-sdk/api/client/type-aliases/TransactionEffects.md b/docs/content/ts-sdk/api/client/type-aliases/TransactionEffects.md new file mode 100644 index 00000000000..ac07e60a246 --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/TransactionEffects.md @@ -0,0 +1,102 @@ +# Type Alias: TransactionEffects + +> **TransactionEffects**: `object` + +## Type declaration + +### created? + +> `optional` **created**: [`OwnedObjectRef`](../interfaces/OwnedObjectRef.md)[] + +ObjectRef and owner of new objects created. + +### deleted? + +> `optional` **deleted**: [`IotaObjectRef`](../interfaces/IotaObjectRef.md)[] + +Object Refs of objects now deleted (the old refs). + +### dependencies? + +> `optional` **dependencies**: `string`[] + +The set of transaction digests this transaction depends on. + +### eventsDigest? + +> `optional` **eventsDigest**: `string` \| `null` + +The digest of the events emitted during execution, can be None if the transaction does not emit any +event. + +### executedEpoch + +> **executedEpoch**: `string` + +The epoch when this transaction was executed. + +### gasObject + +> **gasObject**: [`OwnedObjectRef`](../interfaces/OwnedObjectRef.md) + +The updated gas object reference. Have a dedicated field for convenient access. It's also included +in mutated. + +### gasUsed + +> **gasUsed**: [`GasCostSummary`](../interfaces/GasCostSummary.md) + +### messageVersion + +> **messageVersion**: `"v1"` + +### modifiedAtVersions? + +> `optional` **modifiedAtVersions**: [`TransactionBlockEffectsModifiedAtVersions`](../interfaces/TransactionBlockEffectsModifiedAtVersions.md)[] + +The version that every modified (mutated or deleted) object had before it was modified by this +transaction. + +### mutated? + +> `optional` **mutated**: [`OwnedObjectRef`](../interfaces/OwnedObjectRef.md)[] + +ObjectRef and owner of mutated objects, including gas object. + +### sharedObjects? + +> `optional` **sharedObjects**: [`IotaObjectRef`](../interfaces/IotaObjectRef.md)[] + +The object references of the shared objects used in this transaction. Empty if no shared objects +were used. + +### status + +> **status**: [`ExecutionStatus`](ExecutionStatus.md) + +The status of the execution + +### transactionDigest + +> **transactionDigest**: `string` + +The transaction digest + +### unwrapped? + +> `optional` **unwrapped**: [`OwnedObjectRef`](../interfaces/OwnedObjectRef.md)[] + +ObjectRef and owner of objects that are unwrapped in this transaction. Unwrapped objects are objects +that were wrapped into other objects in the past, and just got extracted out. + +### unwrappedThenDeleted? + +> `optional` **unwrappedThenDeleted**: [`IotaObjectRef`](../interfaces/IotaObjectRef.md)[] + +Object refs of objects previously wrapped in other objects but now deleted. + +### wrapped? + +> `optional` **wrapped**: [`IotaObjectRef`](../interfaces/IotaObjectRef.md)[] + +Object refs of objects now wrapped in other objects. diff --git a/docs/content/ts-sdk/api/client/type-aliases/TransactionFilter.md b/docs/content/ts-sdk/api/client/type-aliases/TransactionFilter.md new file mode 100644 index 00000000000..4800d811b4d --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/TransactionFilter.md @@ -0,0 +1,3 @@ +# Type Alias: TransactionFilter + +> **TransactionFilter**: `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` diff --git a/docs/content/ts-sdk/api/client/type-aliases/Unsubscribe.md b/docs/content/ts-sdk/api/client/type-aliases/Unsubscribe.md new file mode 100644 index 00000000000..17b357f44fa --- /dev/null +++ b/docs/content/ts-sdk/api/client/type-aliases/Unsubscribe.md @@ -0,0 +1,7 @@ +# Type Alias: Unsubscribe() + +> **Unsubscribe**: () => `Promise`\<`boolean`\> + +## Returns + +`Promise`\<`boolean`\> diff --git a/docs/content/ts-sdk/api/cryptography/classes/Keypair.md b/docs/content/ts-sdk/api/cryptography/classes/Keypair.md new file mode 100644 index 00000000000..b2540b63eb7 --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/classes/Keypair.md @@ -0,0 +1,173 @@ +# Class: `abstract` Keypair + +TODO: Document + +## Extends + +- [`Signer`](Signer.md) + +## Extended by + +- [`Ed25519Keypair`](../../keypairs/ed25519/classes/Ed25519Keypair.md) +- [`Secp256k1Keypair`](../../keypairs/secp256k1/classes/Secp256k1Keypair.md) + +## Constructors + +### new Keypair() + +> **new Keypair**(): [`Keypair`](Keypair.md) + +#### Returns + +[`Keypair`](Keypair.md) + +#### Inherited from + +[`Signer`](Signer.md).[`constructor`](Signer.md#constructors) + +## Methods + +### sign() + +> `abstract` **sign**(`bytes`): `Promise`\<`Uint8Array`\> + +#### Parameters + +• **bytes**: `Uint8Array` + +#### Returns + +`Promise`\<`Uint8Array`\> + +#### Inherited from + +[`Signer`](Signer.md).[`sign`](Signer.md#sign) + +--- + +### signWithIntent() + +> **signWithIntent**(`bytes`, `intent`): `Promise`\<[`SignatureWithBytes`](../interfaces/SignatureWithBytes.md)\> + +Sign messages with a specific intent. By combining the message bytes with the intent before hashing and signing, +it ensures that a signed message is tied to a specific purpose and domain separator is provided + +#### Parameters + +• **bytes**: `Uint8Array` + +• **intent**: [`IntentScope`](../type-aliases/IntentScope.md) + +#### Returns + +`Promise`\<[`SignatureWithBytes`](../interfaces/SignatureWithBytes.md)\> + +#### Inherited from + +[`Signer`](Signer.md).[`signWithIntent`](Signer.md#signwithintent) + +--- + +### signTransaction() + +> **signTransaction**(`bytes`): `Promise`\<[`SignatureWithBytes`](../interfaces/SignatureWithBytes.md)\> + +Signs provided transaction by calling `signWithIntent()` with a `TransactionData` provided as intent scope + +#### Parameters + +• **bytes**: `Uint8Array` + +#### Returns + +`Promise`\<[`SignatureWithBytes`](../interfaces/SignatureWithBytes.md)\> + +#### Inherited from + +[`Signer`](Signer.md).[`signTransaction`](Signer.md#signtransaction) + +--- + +### signPersonalMessage() + +> **signPersonalMessage**(`bytes`): `Promise`\<`object`\> + +Signs provided personal message by calling `signWithIntent()` with a `PersonalMessage` provided as intent scope + +#### Parameters + +• **bytes**: `Uint8Array` + +#### Returns + +`Promise`\<`object`\> + +##### bytes + +> **bytes**: `string` + +##### signature + +> **signature**: `string` + +#### Inherited from + +[`Signer`](Signer.md).[`signPersonalMessage`](Signer.md#signpersonalmessage) + +--- + +### toIotaAddress() + +> **toIotaAddress**(): `string` + +#### Returns + +`string` + +#### Inherited from + +[`Signer`](Signer.md).[`toIotaAddress`](Signer.md#toiotaaddress) + +--- + +### getKeyScheme() + +> `abstract` **getKeyScheme**(): [`SignatureScheme`](../type-aliases/SignatureScheme.md) + +Get the key scheme of the keypair: Secp256k1 or ED25519 + +#### Returns + +[`SignatureScheme`](../type-aliases/SignatureScheme.md) + +#### Inherited from + +[`Signer`](Signer.md).[`getKeyScheme`](Signer.md#getkeyscheme) + +--- + +### getPublicKey() + +> `abstract` **getPublicKey**(): [`PublicKey`](PublicKey.md) + +The public key for this keypair + +#### Returns + +[`PublicKey`](PublicKey.md) + +#### Inherited from + +[`Signer`](Signer.md).[`getPublicKey`](Signer.md#getpublickey) + +--- + +### getSecretKey() + +> `abstract` **getSecretKey**(): `string` + +This returns the Bech32 secret key string for this keypair. + +#### Returns + +`string` diff --git a/docs/content/ts-sdk/api/cryptography/classes/PublicKey.md b/docs/content/ts-sdk/api/cryptography/classes/PublicKey.md new file mode 100644 index 00000000000..3793a8aab8d --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/classes/PublicKey.md @@ -0,0 +1,206 @@ +# Class: `abstract` PublicKey + +A public key + +## Extended by + +- [`Ed25519PublicKey`](../../keypairs/ed25519/classes/Ed25519PublicKey.md) +- [`Secp256k1PublicKey`](../../keypairs/secp256k1/classes/Secp256k1PublicKey.md) +- [`MultiSigPublicKey`](../../multisig/classes/MultiSigPublicKey.md) + +## Constructors + +### new PublicKey() + +> **new PublicKey**(): [`PublicKey`](PublicKey.md) + +#### Returns + +[`PublicKey`](PublicKey.md) + +## Methods + +### equals() + +> **equals**(`publicKey`): `boolean` + +Checks if two public keys are equal + +#### Parameters + +• **publicKey**: [`PublicKey`](PublicKey.md) + +#### Returns + +`boolean` + +--- + +### toBase64() + +> **toBase64**(): `string` + +Return the base-64 representation of the public key + +#### Returns + +`string` + +--- + +### toString() + +> **toString**(): `never` + +#### Returns + +`never` + +--- + +### toIotaPublicKey() + +> **toIotaPublicKey**(): `string` + +Return the IOTA representation of the public key encoded in +base-64. A IOTA public key is formed by the concatenation +of the scheme flag with the raw bytes of the public key + +#### Returns + +`string` + +--- + +### verifyWithIntent() + +> **verifyWithIntent**(`bytes`, `signature`, `intent`): `Promise`\<`boolean`\> + +#### Parameters + +• **bytes**: `Uint8Array` + +• **signature**: `string` \| `Uint8Array` + +• **intent**: [`IntentScope`](../type-aliases/IntentScope.md) + +#### Returns + +`Promise`\<`boolean`\> + +--- + +### verifyPersonalMessage() + +> **verifyPersonalMessage**(`message`, `signature`): `Promise`\<`boolean`\> + +Verifies that the signature is valid for for the provided PersonalMessage + +#### Parameters + +• **message**: `Uint8Array` + +• **signature**: `string` \| `Uint8Array` + +#### Returns + +`Promise`\<`boolean`\> + +--- + +### verifyTransaction() + +> **verifyTransaction**(`transaction`, `signature`): `Promise`\<`boolean`\> + +Verifies that the signature is valid for for the provided Transaction + +#### Parameters + +• **transaction**: `Uint8Array` + +• **signature**: `string` \| `Uint8Array` + +#### Returns + +`Promise`\<`boolean`\> + +--- + +### toIotaBytes() + +> **toIotaBytes**(): `Uint8Array` + +Returns the bytes representation of the public key +prefixed with the signature scheme flag + +#### Returns + +`Uint8Array` + +--- + +### toIotaBytesForAddress() + +> **toIotaBytesForAddress**(): `Uint8Array` + +Returns the bytes representation of the public key +prefixed with the signature scheme flag. If the +signature scheme is ED25519, no prefix is set. + +#### Returns + +`Uint8Array` + +--- + +### toIotaAddress() + +> **toIotaAddress**(): `string` + +Return the IOTA address associated with this Ed25519 public key + +#### Returns + +`string` + +--- + +### toRawBytes() + +> `abstract` **toRawBytes**(): `Uint8Array` + +Return the byte array representation of the public key + +#### Returns + +`Uint8Array` + +--- + +### flag() + +> `abstract` **flag**(): `number` + +Return signature scheme flag of the public key + +#### Returns + +`number` + +--- + +### verify() + +> `abstract` **verify**(`data`, `signature`): `Promise`\<`boolean`\> + +Verifies that the signature is valid for for the provided message + +#### Parameters + +• **data**: `Uint8Array` + +• **signature**: `string` \| `Uint8Array` + +#### Returns + +`Promise`\<`boolean`\> diff --git a/docs/content/ts-sdk/api/cryptography/classes/Signer.md b/docs/content/ts-sdk/api/cryptography/classes/Signer.md new file mode 100644 index 00000000000..7755ea9e1ff --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/classes/Signer.md @@ -0,0 +1,125 @@ +# Class: `abstract` Signer + +TODO: Document + +## Extended by + +- [`Keypair`](Keypair.md) +- [`MultiSigSigner`](../../multisig/classes/MultiSigSigner.md) + +## Constructors + +### new Signer() + +> **new Signer**(): [`Signer`](Signer.md) + +#### Returns + +[`Signer`](Signer.md) + +## Methods + +### sign() + +> `abstract` **sign**(`bytes`): `Promise`\<`Uint8Array`\> + +#### Parameters + +• **bytes**: `Uint8Array` + +#### Returns + +`Promise`\<`Uint8Array`\> + +--- + +### signWithIntent() + +> **signWithIntent**(`bytes`, `intent`): `Promise`\<[`SignatureWithBytes`](../interfaces/SignatureWithBytes.md)\> + +Sign messages with a specific intent. By combining the message bytes with the intent before hashing and signing, +it ensures that a signed message is tied to a specific purpose and domain separator is provided + +#### Parameters + +• **bytes**: `Uint8Array` + +• **intent**: [`IntentScope`](../type-aliases/IntentScope.md) + +#### Returns + +`Promise`\<[`SignatureWithBytes`](../interfaces/SignatureWithBytes.md)\> + +--- + +### signTransaction() + +> **signTransaction**(`bytes`): `Promise`\<[`SignatureWithBytes`](../interfaces/SignatureWithBytes.md)\> + +Signs provided transaction by calling `signWithIntent()` with a `TransactionData` provided as intent scope + +#### Parameters + +• **bytes**: `Uint8Array` + +#### Returns + +`Promise`\<[`SignatureWithBytes`](../interfaces/SignatureWithBytes.md)\> + +--- + +### signPersonalMessage() + +> **signPersonalMessage**(`bytes`): `Promise`\<`object`\> + +Signs provided personal message by calling `signWithIntent()` with a `PersonalMessage` provided as intent scope + +#### Parameters + +• **bytes**: `Uint8Array` + +#### Returns + +`Promise`\<`object`\> + +##### bytes + +> **bytes**: `string` + +##### signature + +> **signature**: `string` + +--- + +### toIotaAddress() + +> **toIotaAddress**(): `string` + +#### Returns + +`string` + +--- + +### getKeyScheme() + +> `abstract` **getKeyScheme**(): [`SignatureScheme`](../type-aliases/SignatureScheme.md) + +Get the key scheme of the keypair: Secp256k1 or ED25519 + +#### Returns + +[`SignatureScheme`](../type-aliases/SignatureScheme.md) + +--- + +### getPublicKey() + +> `abstract` **getPublicKey**(): [`PublicKey`](PublicKey.md) + +The public key for this keypair + +#### Returns + +[`PublicKey`](PublicKey.md) diff --git a/docs/content/ts-sdk/api/cryptography/functions/decodeIotaPrivateKey.md b/docs/content/ts-sdk/api/cryptography/functions/decodeIotaPrivateKey.md new file mode 100644 index 00000000000..0318a390465 --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/functions/decodeIotaPrivateKey.md @@ -0,0 +1,15 @@ +# Function: decodeIotaPrivateKey() + +> **decodeIotaPrivateKey**(`value`): [`ParsedKeypair`](../type-aliases/ParsedKeypair.md) + +This returns an ParsedKeypair object based by validating the +33-byte Bech32 encoded string starting with `iotaprivkey`, and +parse out the signature scheme and the private key in bytes. + +## Parameters + +• **value**: `string` + +## Returns + +[`ParsedKeypair`](../type-aliases/ParsedKeypair.md) diff --git a/docs/content/ts-sdk/api/cryptography/functions/encodeIotaPrivateKey.md b/docs/content/ts-sdk/api/cryptography/functions/encodeIotaPrivateKey.md new file mode 100644 index 00000000000..4b7cffea7d8 --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/functions/encodeIotaPrivateKey.md @@ -0,0 +1,17 @@ +# Function: encodeIotaPrivateKey() + +> **encodeIotaPrivateKey**(`bytes`, `scheme`): `string` + +This returns a Bech32 encoded string starting with `iotaprivkey`, +encoding 33-byte `flag || bytes` for the given the 32-byte private +key and its signature scheme. + +## Parameters + +• **bytes**: `Uint8Array` + +• **scheme**: [`SignatureScheme`](../type-aliases/SignatureScheme.md) + +## Returns + +`string` diff --git a/docs/content/ts-sdk/api/cryptography/functions/isValidBIP32Path.md b/docs/content/ts-sdk/api/cryptography/functions/isValidBIP32Path.md new file mode 100644 index 00000000000..e124c9a26e8 --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/functions/isValidBIP32Path.md @@ -0,0 +1,18 @@ +# Function: isValidBIP32Path() + +> **isValidBIP32Path**(`path`): `boolean` + +Parse and validate a path that is compliant to BIP-32 in form m/54'/4218'/{account_index}'/{change_index}/{address_index} +for Secp256k1 and m/74'/4218'/{account_index}'/{change_index}/{address_index} for Secp256r1. + +Note that the purpose for Secp256k1 is registered as 54, to differentiate from Ed25519 with purpose 44. + +## Parameters + +• **path**: `string` + +path string (e.g. `m/54'/4218'/0'/0/0`). + +## Returns + +`boolean` diff --git a/docs/content/ts-sdk/api/cryptography/functions/isValidHardenedPath.md b/docs/content/ts-sdk/api/cryptography/functions/isValidHardenedPath.md new file mode 100644 index 00000000000..9affc1bd7e7 --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/functions/isValidHardenedPath.md @@ -0,0 +1,15 @@ +# Function: isValidHardenedPath() + +> **isValidHardenedPath**(`path`): `boolean` + +Parse and validate a path that is compliant to SLIP-0010 in form m/44'/4218'/{account_index}'/{change_index}'/{address_index}'. + +## Parameters + +• **path**: `string` + +path string (e.g. `m/44'/4218'/0'/0'/0'`). + +## Returns + +`boolean` diff --git a/docs/content/ts-sdk/api/cryptography/functions/messageWithIntent.md b/docs/content/ts-sdk/api/cryptography/functions/messageWithIntent.md new file mode 100644 index 00000000000..f0f96a48fc9 --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/functions/messageWithIntent.md @@ -0,0 +1,15 @@ +# Function: messageWithIntent() + +> **messageWithIntent**(`scope`, `message`): `Uint8Array` + +Inserts a domain separator for a message that is being signed + +## Parameters + +• **scope**: [`IntentScope`](../type-aliases/IntentScope.md) + +• **message**: `Uint8Array` + +## Returns + +`Uint8Array` diff --git a/docs/content/ts-sdk/api/cryptography/functions/mnemonicToSeed.md b/docs/content/ts-sdk/api/cryptography/functions/mnemonicToSeed.md new file mode 100644 index 00000000000..5681b851070 --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/functions/mnemonicToSeed.md @@ -0,0 +1,15 @@ +# Function: mnemonicToSeed() + +> **mnemonicToSeed**(`mnemonics`): `Uint8Array` + +Uses KDF to derive 64 bytes of key data from mnemonic with empty password. + +## Parameters + +• **mnemonics**: `string` + +24 words string split by spaces. + +## Returns + +`Uint8Array` diff --git a/docs/content/ts-sdk/api/cryptography/functions/mnemonicToSeedHex.md b/docs/content/ts-sdk/api/cryptography/functions/mnemonicToSeedHex.md new file mode 100644 index 00000000000..04e274a65b1 --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/functions/mnemonicToSeedHex.md @@ -0,0 +1,15 @@ +# Function: mnemonicToSeedHex() + +> **mnemonicToSeedHex**(`mnemonics`): `string` + +Derive the seed in hex format from a 24-word mnemonic string. + +## Parameters + +• **mnemonics**: `string` + +24 words string split by spaces. + +## Returns + +`string` diff --git a/docs/content/ts-sdk/api/cryptography/functions/parseSerializedSignature.md b/docs/content/ts-sdk/api/cryptography/functions/parseSerializedSignature.md new file mode 100644 index 00000000000..562ee77562e --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/functions/parseSerializedSignature.md @@ -0,0 +1,13 @@ +# Function: parseSerializedSignature() + +> **parseSerializedSignature**(`serializedSignature`): `object` \| `object` + +Decodes a serialized signature into its constituent components: the signature scheme, the actual signature, and the public key + +## Parameters + +• **serializedSignature**: `string` + +## Returns + +`object` \| `object` diff --git a/docs/content/ts-sdk/api/cryptography/functions/toSerializedSignature.md b/docs/content/ts-sdk/api/cryptography/functions/toSerializedSignature.md new file mode 100644 index 00000000000..7dabe5495da --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/functions/toSerializedSignature.md @@ -0,0 +1,13 @@ +# Function: toSerializedSignature() + +> **toSerializedSignature**(`__namedParameters`): `string` + +Takes in a signature, its associated signing scheme and a public key, then serializes this data + +## Parameters + +• **\_\_namedParameters**: [`SerializeSignatureInput`](../type-aliases/SerializeSignatureInput.md) + +## Returns + +`string` diff --git a/docs/content/ts-sdk/api/cryptography/index.md b/docs/content/ts-sdk/api/cryptography/index.md new file mode 100644 index 00000000000..c13f775cd73 --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/index.md @@ -0,0 +1,42 @@ +# cryptography + +## Index + +### Classes + +- [Signer](classes/Signer.md) +- [Keypair](classes/Keypair.md) +- [PublicKey](classes/PublicKey.md) + +### Interfaces + +- [SignatureWithBytes](interfaces/SignatureWithBytes.md) + +### Type Aliases + +- [IntentScope](type-aliases/IntentScope.md) +- [ParsedKeypair](type-aliases/ParsedKeypair.md) +- [SignatureScheme](type-aliases/SignatureScheme.md) +- [SignatureFlag](type-aliases/SignatureFlag.md) +- [SerializeSignatureInput](type-aliases/SerializeSignatureInput.md) + +### Variables + +- [PRIVATE\_KEY\_SIZE](variables/PRIVATE_KEY_SIZE.md) +- [LEGACY\_PRIVATE\_KEY\_SIZE](variables/LEGACY_PRIVATE_KEY_SIZE.md) +- [IOTA\_PRIVATE\_KEY\_PREFIX](variables/IOTA_PRIVATE_KEY_PREFIX.md) +- [SIGNATURE\_SCHEME\_TO\_FLAG](variables/SIGNATURE_SCHEME_TO_FLAG.md) +- [SIGNATURE\_SCHEME\_TO\_SIZE](variables/SIGNATURE_SCHEME_TO_SIZE.md) +- [SIGNATURE\_FLAG\_TO\_SCHEME](variables/SIGNATURE_FLAG_TO_SCHEME.md) + +### Functions + +- [messageWithIntent](functions/messageWithIntent.md) +- [decodeIotaPrivateKey](functions/decodeIotaPrivateKey.md) +- [encodeIotaPrivateKey](functions/encodeIotaPrivateKey.md) +- [isValidHardenedPath](functions/isValidHardenedPath.md) +- [isValidBIP32Path](functions/isValidBIP32Path.md) +- [mnemonicToSeed](functions/mnemonicToSeed.md) +- [mnemonicToSeedHex](functions/mnemonicToSeedHex.md) +- [toSerializedSignature](functions/toSerializedSignature.md) +- [parseSerializedSignature](functions/parseSerializedSignature.md) diff --git a/docs/content/ts-sdk/api/cryptography/interfaces/SignatureWithBytes.md b/docs/content/ts-sdk/api/cryptography/interfaces/SignatureWithBytes.md new file mode 100644 index 00000000000..ba584635d90 --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/interfaces/SignatureWithBytes.md @@ -0,0 +1,13 @@ +# Interface: SignatureWithBytes + +## Properties + +### bytes + +> **bytes**: `string` + +--- + +### signature + +> **signature**: `string` diff --git a/docs/content/ts-sdk/api/cryptography/type-aliases/IntentScope.md b/docs/content/ts-sdk/api/cryptography/type-aliases/IntentScope.md new file mode 100644 index 00000000000..6cba4a432ad --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/type-aliases/IntentScope.md @@ -0,0 +1,3 @@ +# Type Alias: IntentScope + +> **IntentScope**: `Exclude`\<keyof _typeof_ `bcs.IntentScope.$inferType`, `"$kind"`\> diff --git a/docs/content/ts-sdk/api/cryptography/type-aliases/ParsedKeypair.md b/docs/content/ts-sdk/api/cryptography/type-aliases/ParsedKeypair.md new file mode 100644 index 00000000000..d35bea74c82 --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/type-aliases/ParsedKeypair.md @@ -0,0 +1,13 @@ +# Type Alias: ParsedKeypair + +> **ParsedKeypair**: `object` + +## Type declaration + +### schema + +> **schema**: [`SignatureScheme`](SignatureScheme.md) + +### secretKey + +> **secretKey**: `Uint8Array` diff --git a/docs/content/ts-sdk/api/cryptography/type-aliases/SerializeSignatureInput.md b/docs/content/ts-sdk/api/cryptography/type-aliases/SerializeSignatureInput.md new file mode 100644 index 00000000000..aacf1be5579 --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/type-aliases/SerializeSignatureInput.md @@ -0,0 +1,23 @@ +# Type Alias: SerializeSignatureInput + +> **SerializeSignatureInput**: `object` + +Pair of signature and corresponding public key + +## Type declaration + +### signatureScheme + +> **signatureScheme**: [`SignatureScheme`](SignatureScheme.md) + +### signature + +> **signature**: `Uint8Array` + +Base64-encoded signature + +### publicKey? + +> `optional` **publicKey**: [`PublicKey`](../classes/PublicKey.md) + +Base64-encoded public key diff --git a/docs/content/ts-sdk/api/cryptography/type-aliases/SignatureFlag.md b/docs/content/ts-sdk/api/cryptography/type-aliases/SignatureFlag.md new file mode 100644 index 00000000000..06bdc308af2 --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/type-aliases/SignatureFlag.md @@ -0,0 +1,3 @@ +# Type Alias: SignatureFlag + +> **SignatureFlag**: keyof _typeof_ [`SIGNATURE_FLAG_TO_SCHEME`](../variables/SIGNATURE_FLAG_TO_SCHEME.md) diff --git a/docs/content/ts-sdk/api/cryptography/type-aliases/SignatureScheme.md b/docs/content/ts-sdk/api/cryptography/type-aliases/SignatureScheme.md new file mode 100644 index 00000000000..10bacc122d5 --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/type-aliases/SignatureScheme.md @@ -0,0 +1,3 @@ +# Type Alias: SignatureScheme + +> **SignatureScheme**: `"ED25519"` \| `"Secp256k1"` \| `"Secp256r1"` \| `"MultiSig"` diff --git a/docs/content/ts-sdk/api/cryptography/variables/IOTA_PRIVATE_KEY_PREFIX.md b/docs/content/ts-sdk/api/cryptography/variables/IOTA_PRIVATE_KEY_PREFIX.md new file mode 100644 index 00000000000..f15475f4a0b --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/variables/IOTA_PRIVATE_KEY_PREFIX.md @@ -0,0 +1,3 @@ +# Variable: IOTA\_PRIVATE\_KEY\_PREFIX + +> `const` **IOTA\_PRIVATE\_KEY\_PREFIX**: `"iotaprivkey"` = `'iotaprivkey'` diff --git a/docs/content/ts-sdk/api/cryptography/variables/LEGACY_PRIVATE_KEY_SIZE.md b/docs/content/ts-sdk/api/cryptography/variables/LEGACY_PRIVATE_KEY_SIZE.md new file mode 100644 index 00000000000..d35b901d802 --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/variables/LEGACY_PRIVATE_KEY_SIZE.md @@ -0,0 +1,3 @@ +# Variable: LEGACY\_PRIVATE\_KEY\_SIZE + +> `const` **LEGACY\_PRIVATE\_KEY\_SIZE**: `64` = `64` diff --git a/docs/content/ts-sdk/api/cryptography/variables/PRIVATE_KEY_SIZE.md b/docs/content/ts-sdk/api/cryptography/variables/PRIVATE_KEY_SIZE.md new file mode 100644 index 00000000000..a02f817c1d7 --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/variables/PRIVATE_KEY_SIZE.md @@ -0,0 +1,3 @@ +# Variable: PRIVATE\_KEY\_SIZE + +> `const` **PRIVATE\_KEY\_SIZE**: `32` = `32` diff --git a/docs/content/ts-sdk/api/cryptography/variables/SIGNATURE_FLAG_TO_SCHEME.md b/docs/content/ts-sdk/api/cryptography/variables/SIGNATURE_FLAG_TO_SCHEME.md new file mode 100644 index 00000000000..3b38748eec5 --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/variables/SIGNATURE_FLAG_TO_SCHEME.md @@ -0,0 +1,21 @@ +# Variable: SIGNATURE\_FLAG\_TO\_SCHEME + +> `const` **SIGNATURE\_FLAG\_TO\_SCHEME**: `object` + +## Type declaration + +### 0 + +> `readonly` **0**: `"ED25519"` = `'ED25519'` + +### 1 + +> `readonly` **1**: `"Secp256k1"` = `'Secp256k1'` + +### 2 + +> `readonly` **2**: `"Secp256r1"` = `'Secp256r1'` + +### 3 + +> `readonly` **3**: `"MultiSig"` = `'MultiSig'` diff --git a/docs/content/ts-sdk/api/cryptography/variables/SIGNATURE_SCHEME_TO_FLAG.md b/docs/content/ts-sdk/api/cryptography/variables/SIGNATURE_SCHEME_TO_FLAG.md new file mode 100644 index 00000000000..2828146641d --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/variables/SIGNATURE_SCHEME_TO_FLAG.md @@ -0,0 +1,21 @@ +# Variable: SIGNATURE\_SCHEME\_TO\_FLAG + +> `const` **SIGNATURE\_SCHEME\_TO\_FLAG**: `object` + +## Type declaration + +### ED25519 + +> `readonly` **ED25519**: `0` = `0x00` + +### Secp256k1 + +> `readonly` **Secp256k1**: `1` = `0x01` + +### Secp256r1 + +> `readonly` **Secp256r1**: `2` = `0x02` + +### MultiSig + +> `readonly` **MultiSig**: `3` = `0x03` diff --git a/docs/content/ts-sdk/api/cryptography/variables/SIGNATURE_SCHEME_TO_SIZE.md b/docs/content/ts-sdk/api/cryptography/variables/SIGNATURE_SCHEME_TO_SIZE.md new file mode 100644 index 00000000000..59364899c46 --- /dev/null +++ b/docs/content/ts-sdk/api/cryptography/variables/SIGNATURE_SCHEME_TO_SIZE.md @@ -0,0 +1,17 @@ +# Variable: SIGNATURE\_SCHEME\_TO\_SIZE + +> `const` **SIGNATURE\_SCHEME\_TO\_SIZE**: `object` + +## Type declaration + +### ED25519 + +> **ED25519**: `number` = `32` + +### Secp256k1 + +> **Secp256k1**: `number` = `33` + +### Secp256r1 + +> **Secp256r1**: `number` = `33` diff --git a/docs/content/ts-sdk/api/faucet/classes/FaucetRateLimitError.md b/docs/content/ts-sdk/api/faucet/classes/FaucetRateLimitError.md new file mode 100644 index 00000000000..c083e2ff12c --- /dev/null +++ b/docs/content/ts-sdk/api/faucet/classes/FaucetRateLimitError.md @@ -0,0 +1,139 @@ +# Class: FaucetRateLimitError + +## Extends + +- `Error` + +## Constructors + +### new FaucetRateLimitError() + +> **new FaucetRateLimitError**(`message`?): [`FaucetRateLimitError`](FaucetRateLimitError.md) + +#### Parameters + +• **message?**: `string` + +#### Returns + +[`FaucetRateLimitError`](FaucetRateLimitError.md) + +#### Inherited from + +`Error.constructor` + +### new FaucetRateLimitError() + +> **new FaucetRateLimitError**(`message`?, `options`?): [`FaucetRateLimitError`](FaucetRateLimitError.md) + +#### Parameters + +• **message?**: `string` + +• **options?**: `ErrorOptions` + +#### Returns + +[`FaucetRateLimitError`](FaucetRateLimitError.md) + +#### Inherited from + +`Error.constructor` + +## Properties + +### prepareStackTrace()? + +> `static` `optional` **prepareStackTrace**: (`err`, `stackTraces`) => `any` + +Optional override for formatting stack traces + +#### Parameters + +• **err**: `Error` + +• **stackTraces**: `CallSite`[] + +#### Returns + +`any` + +#### See + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +`Error.prepareStackTrace` + +--- + +### stackTraceLimit + +> `static` **stackTraceLimit**: `number` + +#### Inherited from + +`Error.stackTraceLimit` + +--- + +### cause? + +> `optional` **cause**: `unknown` + +#### Inherited from + +`Error.cause` + +--- + +### name + +> **name**: `string` + +#### Inherited from + +`Error.name` + +--- + +### message + +> **message**: `string` + +#### Inherited from + +`Error.message` + +--- + +### stack? + +> `optional` **stack**: `string` + +#### Inherited from + +`Error.stack` + +## Methods + +### captureStackTrace() + +> `static` **captureStackTrace**(`targetObject`, `constructorOpt`?): `void` + +Create .stack property on a target object + +#### Parameters + +• **targetObject**: `object` + +• **constructorOpt?**: `Function` + +#### Returns + +`void` + +#### Inherited from + +`Error.captureStackTrace` diff --git a/docs/content/ts-sdk/api/faucet/functions/getFaucetHost.md b/docs/content/ts-sdk/api/faucet/functions/getFaucetHost.md new file mode 100644 index 00000000000..3baaf30b700 --- /dev/null +++ b/docs/content/ts-sdk/api/faucet/functions/getFaucetHost.md @@ -0,0 +1,11 @@ +# Function: getFaucetHost() + +> **getFaucetHost**(`network`): `string` + +## Parameters + +• **network**: `string` + +## Returns + +`string` diff --git a/docs/content/ts-sdk/api/faucet/functions/getFaucetRequestStatus.md b/docs/content/ts-sdk/api/faucet/functions/getFaucetRequestStatus.md new file mode 100644 index 00000000000..1e8b8ff4b0c --- /dev/null +++ b/docs/content/ts-sdk/api/faucet/functions/getFaucetRequestStatus.md @@ -0,0 +1,17 @@ +# Function: getFaucetRequestStatus() + +> **getFaucetRequestStatus**(`input`): `Promise`\<`BatchStatusFaucetResponse`\> + +## Parameters + +• **input** + +• **input.host**: `string` + +• **input.taskId**: `string` + +• **input.headers?**: `HeadersInit` + +## Returns + +`Promise`\<`BatchStatusFaucetResponse`\> diff --git a/docs/content/ts-sdk/api/faucet/functions/requestIotaFromFaucetV0.md b/docs/content/ts-sdk/api/faucet/functions/requestIotaFromFaucetV0.md new file mode 100644 index 00000000000..5fdaf5b048f --- /dev/null +++ b/docs/content/ts-sdk/api/faucet/functions/requestIotaFromFaucetV0.md @@ -0,0 +1,17 @@ +# Function: requestIotaFromFaucetV0() + +> **requestIotaFromFaucetV0**(`input`): `Promise`\<`FaucetResponse`\> + +## Parameters + +• **input** + +• **input.host**: `string` + +• **input.recipient**: `string` + +• **input.headers?**: `HeadersInit` + +## Returns + +`Promise`\<`FaucetResponse`\> diff --git a/docs/content/ts-sdk/api/faucet/functions/requestIotaFromFaucetV1.md b/docs/content/ts-sdk/api/faucet/functions/requestIotaFromFaucetV1.md new file mode 100644 index 00000000000..91052957506 --- /dev/null +++ b/docs/content/ts-sdk/api/faucet/functions/requestIotaFromFaucetV1.md @@ -0,0 +1,17 @@ +# Function: requestIotaFromFaucetV1() + +> **requestIotaFromFaucetV1**(`input`): `Promise`\<`BatchFaucetResponse`\> + +## Parameters + +• **input** + +• **input.host**: `string` + +• **input.recipient**: `string` + +• **input.headers?**: `HeadersInit` + +## Returns + +`Promise`\<`BatchFaucetResponse`\> diff --git a/docs/content/ts-sdk/api/faucet/index.md b/docs/content/ts-sdk/api/faucet/index.md new file mode 100644 index 00000000000..6542dbbb933 --- /dev/null +++ b/docs/content/ts-sdk/api/faucet/index.md @@ -0,0 +1,14 @@ +# faucet + +## Index + +### Classes + +- [FaucetRateLimitError](classes/FaucetRateLimitError.md) + +### Functions + +- [requestIotaFromFaucetV0](functions/requestIotaFromFaucetV0.md) +- [requestIotaFromFaucetV1](functions/requestIotaFromFaucetV1.md) +- [getFaucetRequestStatus](functions/getFaucetRequestStatus.md) +- [getFaucetHost](functions/getFaucetHost.md) diff --git a/docs/content/ts-sdk/api/graphql/classes/IotaGraphQLClient.md b/docs/content/ts-sdk/api/graphql/classes/IotaGraphQLClient.md new file mode 100644 index 00000000000..8f2abf52ff9 --- /dev/null +++ b/docs/content/ts-sdk/api/graphql/classes/IotaGraphQLClient.md @@ -0,0 +1,63 @@ +# Class: IotaGraphQLClient\<Queries\> + +## Type Parameters + +• **Queries** _extends_ `Record`\<`string`, [`GraphQLDocument`](../type-aliases/GraphQLDocument.md)\> = `object` + +## Constructors + +### new IotaGraphQLClient() + +> **new IotaGraphQLClient**\<`Queries`\>(`__namedParameters`): [`IotaGraphQLClient`](IotaGraphQLClient.md)\<`Queries`\> + +#### Parameters + +• **\_\_namedParameters**: [`IotaGraphQLClientOptions`](../interfaces/IotaGraphQLClientOptions.md)\<`Queries`\> + +#### Returns + +[`IotaGraphQLClient`](IotaGraphQLClient.md)\<`Queries`\> + +## Methods + +### query() + +> **query**\<`Result`, `Variables`\>(`options`): `Promise`\<[`GraphQLQueryResult`](../type-aliases/GraphQLQueryResult.md)\<`Result`\>\> + +#### Type Parameters + +• **Result** = `Record`\<`string`, `unknown`\> + +• **Variables** = `Record`\<`string`, `unknown`\> + +#### Parameters + +• **options**: [`GraphQLQueryOptions`](../type-aliases/GraphQLQueryOptions.md)\<`Result`, `Variables`\> + +#### Returns + +`Promise`\<[`GraphQLQueryResult`](../type-aliases/GraphQLQueryResult.md)\<`Result`\>\> + +--- + +### execute() + +> **execute**\<`Query`, `Result`, `Variables`\>(`query`, `options`): `Promise`\<[`GraphQLQueryResult`](../type-aliases/GraphQLQueryResult.md)\<`Result`\>\> + +#### Type Parameters + +• **Query** _extends_ `string` + +• **Result** = `Queries`\[`Query`\] _extends_ [`GraphQLDocument`](../type-aliases/GraphQLDocument.md)\<`R`, `unknown`\> ? `R` : `Record`\<`string`, `unknown`\> + +• **Variables** = `Queries`\[`Query`\] _extends_ [`GraphQLDocument`](../type-aliases/GraphQLDocument.md)\<`unknown`, `V`\> ? `V` : `Record`\<`string`, `unknown`\> + +#### Parameters + +• **query**: `Query` + +• **options**: `Omit`\<[`GraphQLQueryOptions`](../type-aliases/GraphQLQueryOptions.md)\<`Result`, `Variables`\>, `"query"`\> + +#### Returns + +`Promise`\<[`GraphQLQueryResult`](../type-aliases/GraphQLQueryResult.md)\<`Result`\>\> diff --git a/docs/content/ts-sdk/api/graphql/classes/IotaGraphQLRequestError.md b/docs/content/ts-sdk/api/graphql/classes/IotaGraphQLRequestError.md new file mode 100644 index 00000000000..afb383fce34 --- /dev/null +++ b/docs/content/ts-sdk/api/graphql/classes/IotaGraphQLRequestError.md @@ -0,0 +1,139 @@ +# Class: IotaGraphQLRequestError + +## Extends + +- `Error` + +## Constructors + +### new IotaGraphQLRequestError() + +> **new IotaGraphQLRequestError**(`message`?): [`IotaGraphQLRequestError`](IotaGraphQLRequestError.md) + +#### Parameters + +• **message?**: `string` + +#### Returns + +[`IotaGraphQLRequestError`](IotaGraphQLRequestError.md) + +#### Inherited from + +`Error.constructor` + +### new IotaGraphQLRequestError() + +> **new IotaGraphQLRequestError**(`message`?, `options`?): [`IotaGraphQLRequestError`](IotaGraphQLRequestError.md) + +#### Parameters + +• **message?**: `string` + +• **options?**: `ErrorOptions` + +#### Returns + +[`IotaGraphQLRequestError`](IotaGraphQLRequestError.md) + +#### Inherited from + +`Error.constructor` + +## Properties + +### prepareStackTrace()? + +> `static` `optional` **prepareStackTrace**: (`err`, `stackTraces`) => `any` + +Optional override for formatting stack traces + +#### Parameters + +• **err**: `Error` + +• **stackTraces**: `CallSite`[] + +#### Returns + +`any` + +#### See + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +`Error.prepareStackTrace` + +--- + +### stackTraceLimit + +> `static` **stackTraceLimit**: `number` + +#### Inherited from + +`Error.stackTraceLimit` + +--- + +### cause? + +> `optional` **cause**: `unknown` + +#### Inherited from + +`Error.cause` + +--- + +### name + +> **name**: `string` + +#### Inherited from + +`Error.name` + +--- + +### message + +> **message**: `string` + +#### Inherited from + +`Error.message` + +--- + +### stack? + +> `optional` **stack**: `string` + +#### Inherited from + +`Error.stack` + +## Methods + +### captureStackTrace() + +> `static` **captureStackTrace**(`targetObject`, `constructorOpt`?): `void` + +Create .stack property on a target object + +#### Parameters + +• **targetObject**: `object` + +• **constructorOpt?**: `Function` + +#### Returns + +`void` + +#### Inherited from + +`Error.captureStackTrace` diff --git a/docs/content/ts-sdk/api/graphql/index.md b/docs/content/ts-sdk/api/graphql/index.md new file mode 100644 index 00000000000..c4718be8923 --- /dev/null +++ b/docs/content/ts-sdk/api/graphql/index.md @@ -0,0 +1,19 @@ +# graphql + +## Index + +### Classes + +- [IotaGraphQLRequestError](classes/IotaGraphQLRequestError.md) +- [IotaGraphQLClient](classes/IotaGraphQLClient.md) + +### Interfaces + +- [IotaGraphQLClientOptions](interfaces/IotaGraphQLClientOptions.md) + +### Type Aliases + +- [GraphQLDocument](type-aliases/GraphQLDocument.md) +- [GraphQLQueryOptions](type-aliases/GraphQLQueryOptions.md) +- [GraphQLQueryResult](type-aliases/GraphQLQueryResult.md) +- [GraphQLResponseErrors](type-aliases/GraphQLResponseErrors.md) diff --git a/docs/content/ts-sdk/api/graphql/interfaces/IotaGraphQLClientOptions.md b/docs/content/ts-sdk/api/graphql/interfaces/IotaGraphQLClientOptions.md new file mode 100644 index 00000000000..6d4cc827cf4 --- /dev/null +++ b/docs/content/ts-sdk/api/graphql/interfaces/IotaGraphQLClientOptions.md @@ -0,0 +1,51 @@ +# Interface: IotaGraphQLClientOptions\<Queries\> + +## Type Parameters + +• **Queries** _extends_ `Record`\<`string`, [`GraphQLDocument`](../type-aliases/GraphQLDocument.md)\> + +## Properties + +### url + +> **url**: `string` + +--- + +### fetch()? + +> `optional` **fetch**: (`input`, `init`?) => `Promise`\<`Response`\>(`input`, `init`?) => `Promise`\<`Response`\> + +[MDN Reference](https://developer.mozilla.org/docs/Web/API/fetch) + +#### Parameters + +• **input**: `URL` \| `RequestInfo` + +• **init?**: `RequestInit` + +#### Returns + +`Promise`\<`Response`\> + +#### Parameters + +• **input**: `string` \| `URL` \| `Request` + +• **init?**: `RequestInit` + +#### Returns + +`Promise`\<`Response`\> + +--- + +### headers? + +> `optional` **headers**: `Record`\<`string`, `string`\> + +--- + +### queries? + +> `optional` **queries**: `Queries` diff --git a/docs/content/ts-sdk/api/graphql/type-aliases/GraphQLDocument.md b/docs/content/ts-sdk/api/graphql/type-aliases/GraphQLDocument.md new file mode 100644 index 00000000000..884c60bf206 --- /dev/null +++ b/docs/content/ts-sdk/api/graphql/type-aliases/GraphQLDocument.md @@ -0,0 +1,9 @@ +# Type Alias: GraphQLDocument\<Result, Variables\> + +> **GraphQLDocument**\<`Result`, `Variables`\>: `string` \| `DocumentNode` \| `TypedDocumentNode`\<`Result`, `Variables`\> \| `TadaDocumentNode`\<`Result`, `Variables`\> + +## Type Parameters + +• **Result** = `Record`\<`string`, `unknown`\> + +• **Variables** = `Record`\<`string`, `unknown`\> diff --git a/docs/content/ts-sdk/api/graphql/type-aliases/GraphQLQueryOptions.md b/docs/content/ts-sdk/api/graphql/type-aliases/GraphQLQueryOptions.md new file mode 100644 index 00000000000..60ef82a0a74 --- /dev/null +++ b/docs/content/ts-sdk/api/graphql/type-aliases/GraphQLQueryOptions.md @@ -0,0 +1,23 @@ +# Type Alias: GraphQLQueryOptions\<Result, Variables\> + +> **GraphQLQueryOptions**\<`Result`, `Variables`\>: `object` & `Variables` _extends_ `object` ? `object` : `object` + +## Type declaration + +### query + +> **query**: [`GraphQLDocument`](GraphQLDocument.md)\<`Result`, `Variables`\> + +### operationName? + +> `optional` **operationName**: `string` + +### extensions? + +> `optional` **extensions**: `Record`\<`string`, `unknown`\> + +## Type Parameters + +• **Result** = `Record`\<`string`, `unknown`\> + +• **Variables** = `Record`\<`string`, `unknown`\> diff --git a/docs/content/ts-sdk/api/graphql/type-aliases/GraphQLQueryResult.md b/docs/content/ts-sdk/api/graphql/type-aliases/GraphQLQueryResult.md new file mode 100644 index 00000000000..a515ef6abe6 --- /dev/null +++ b/docs/content/ts-sdk/api/graphql/type-aliases/GraphQLQueryResult.md @@ -0,0 +1,21 @@ +# Type Alias: GraphQLQueryResult\<Result\> + +> **GraphQLQueryResult**\<`Result`\>: `object` + +## Type Parameters + +• **Result** = `Record`\<`string`, `unknown`\> + +## Type declaration + +### data? + +> `optional` **data**: `Result` + +### errors? + +> `optional` **errors**: [`GraphQLResponseErrors`](GraphQLResponseErrors.md) + +### extensions? + +> `optional` **extensions**: `Record`\<`string`, `unknown`\> diff --git a/docs/content/ts-sdk/api/graphql/type-aliases/GraphQLResponseErrors.md b/docs/content/ts-sdk/api/graphql/type-aliases/GraphQLResponseErrors.md new file mode 100644 index 00000000000..1d285edae3f --- /dev/null +++ b/docs/content/ts-sdk/api/graphql/type-aliases/GraphQLResponseErrors.md @@ -0,0 +1,3 @@ +# Type Alias: GraphQLResponseErrors + +> **GraphQLResponseErrors**: `object`[] diff --git a/docs/content/ts-sdk/api/index.md b/docs/content/ts-sdk/api/index.md new file mode 100644 index 00000000000..4ee3103cec3 --- /dev/null +++ b/docs/content/ts-sdk/api/index.md @@ -0,0 +1,16 @@ +# @iota/iota-sdk + +## Modules + +- [bcs](bcs/index.md) +- [client](client/index.md) +- [cryptography](cryptography/index.md) +- [faucet](faucet/index.md) +- [graphql](graphql/index.md) +- [keypairs/ed25519](keypairs/ed25519/index.md) +- [keypairs/secp256k1](keypairs/secp256k1/index.md) +- [keypairs/secp256k1](keypairs/secp256k1/index.md) +- [multisig](multisig/index.md) +- [transactions](transactions/index.md) +- [utils](utils/index.md) +- [verify](verify/index.md) diff --git a/docs/content/ts-sdk/api/keypairs/ed25519/classes/Ed25519Keypair.md b/docs/content/ts-sdk/api/keypairs/ed25519/classes/Ed25519Keypair.md new file mode 100644 index 00000000000..eddf91bcedf --- /dev/null +++ b/docs/content/ts-sdk/api/keypairs/ed25519/classes/Ed25519Keypair.md @@ -0,0 +1,266 @@ +# Class: Ed25519Keypair + +An Ed25519 Keypair used for signing transactions. + +## Extends + +- [`Keypair`](../../../cryptography/classes/Keypair.md) + +## Constructors + +### new Ed25519Keypair() + +> **new Ed25519Keypair**(`keypair`?): [`Ed25519Keypair`](Ed25519Keypair.md) + +Create a new Ed25519 keypair instance. +Generate random keypair if no [Ed25519Keypair](Ed25519Keypair.md) is provided. + +#### Parameters + +• **keypair?**: [`Ed25519KeypairData`](../interfaces/Ed25519KeypairData.md) + +Ed25519 keypair + +#### Returns + +[`Ed25519Keypair`](Ed25519Keypair.md) + +#### Overrides + +[`Keypair`](../../../cryptography/classes/Keypair.md).[`constructor`](../../../cryptography/classes/Keypair.md#constructors) + +## Methods + +### signWithIntent() + +> **signWithIntent**(`bytes`, `intent`): `Promise`\<[`SignatureWithBytes`](../../../cryptography/interfaces/SignatureWithBytes.md)\> + +Sign messages with a specific intent. By combining the message bytes with the intent before hashing and signing, +it ensures that a signed message is tied to a specific purpose and domain separator is provided + +#### Parameters + +• **bytes**: `Uint8Array` + +• **intent**: [`IntentScope`](../../../cryptography/type-aliases/IntentScope.md) + +#### Returns + +`Promise`\<[`SignatureWithBytes`](../../../cryptography/interfaces/SignatureWithBytes.md)\> + +#### Inherited from + +[`Keypair`](../../../cryptography/classes/Keypair.md).[`signWithIntent`](../../../cryptography/classes/Keypair.md#signwithintent) + +--- + +### signTransaction() + +> **signTransaction**(`bytes`): `Promise`\<[`SignatureWithBytes`](../../../cryptography/interfaces/SignatureWithBytes.md)\> + +Signs provided transaction by calling `signWithIntent()` with a `TransactionData` provided as intent scope + +#### Parameters + +• **bytes**: `Uint8Array` + +#### Returns + +`Promise`\<[`SignatureWithBytes`](../../../cryptography/interfaces/SignatureWithBytes.md)\> + +#### Inherited from + +[`Keypair`](../../../cryptography/classes/Keypair.md).[`signTransaction`](../../../cryptography/classes/Keypair.md#signtransaction) + +--- + +### signPersonalMessage() + +> **signPersonalMessage**(`bytes`): `Promise`\<`object`\> + +Signs provided personal message by calling `signWithIntent()` with a `PersonalMessage` provided as intent scope + +#### Parameters + +• **bytes**: `Uint8Array` + +#### Returns + +`Promise`\<`object`\> + +##### bytes + +> **bytes**: `string` + +##### signature + +> **signature**: `string` + +#### Inherited from + +[`Keypair`](../../../cryptography/classes/Keypair.md).[`signPersonalMessage`](../../../cryptography/classes/Keypair.md#signpersonalmessage) + +--- + +### toIotaAddress() + +> **toIotaAddress**(): `string` + +#### Returns + +`string` + +#### Inherited from + +[`Keypair`](../../../cryptography/classes/Keypair.md).[`toIotaAddress`](../../../cryptography/classes/Keypair.md#toiotaaddress) + +--- + +### getKeyScheme() + +> **getKeyScheme**(): [`SignatureScheme`](../../../cryptography/type-aliases/SignatureScheme.md) + +Get the key scheme of the keypair ED25519 + +#### Returns + +[`SignatureScheme`](../../../cryptography/type-aliases/SignatureScheme.md) + +#### Overrides + +[`Keypair`](../../../cryptography/classes/Keypair.md).[`getKeyScheme`](../../../cryptography/classes/Keypair.md#getkeyscheme) + +--- + +### generate() + +> `static` **generate**(): [`Ed25519Keypair`](Ed25519Keypair.md) + +Generate a new random Ed25519 keypair + +#### Returns + +[`Ed25519Keypair`](Ed25519Keypair.md) + +--- + +### fromSecretKey() + +> `static` **fromSecretKey**(`secretKey`, `options`?): [`Ed25519Keypair`](Ed25519Keypair.md) + +Create a Ed25519 keypair from a raw secret key byte array, also known as seed. +This is NOT the private scalar which is result of hashing and bit clamping of +the raw secret key. + +#### Parameters + +• **secretKey**: `Uint8Array` + +secret key byte array + +• **options?** + +• **options.skipValidation?**: `boolean` + +#### Returns + +[`Ed25519Keypair`](Ed25519Keypair.md) + +#### Throws + +error if the provided secret key is invalid and validation is not skipped. + +--- + +### getPublicKey() + +> **getPublicKey**(): [`Ed25519PublicKey`](Ed25519PublicKey.md) + +The public key for this Ed25519 keypair + +#### Returns + +[`Ed25519PublicKey`](Ed25519PublicKey.md) + +#### Overrides + +[`Keypair`](../../../cryptography/classes/Keypair.md).[`getPublicKey`](../../../cryptography/classes/Keypair.md#getpublickey) + +--- + +### getSecretKey() + +> **getSecretKey**(): `string` + +The Bech32 secret key string for this Ed25519 keypair + +#### Returns + +`string` + +#### Overrides + +[`Keypair`](../../../cryptography/classes/Keypair.md).[`getSecretKey`](../../../cryptography/classes/Keypair.md#getsecretkey) + +--- + +### sign() + +> **sign**(`data`): `Promise`\<`Uint8Array`\> + +Return the signature for the provided data using Ed25519. + +#### Parameters + +• **data**: `Uint8Array` + +#### Returns + +`Promise`\<`Uint8Array`\> + +#### Overrides + +[`Keypair`](../../../cryptography/classes/Keypair.md).[`sign`](../../../cryptography/classes/Keypair.md#sign) + +--- + +### deriveKeypair() + +> `static` **deriveKeypair**(`mnemonics`, `path`?): [`Ed25519Keypair`](Ed25519Keypair.md) + +Derive Ed25519 keypair from mnemonics and path. The mnemonics must be normalized +and validated against the english wordlist. + +If path is none, it will default to m/44'/4218'/0'/0'/0', otherwise the path must +be compliant to SLIP-0010 in form m/44'/4218'/{account_index}'/{change_index}'/{address_index}'. + +#### Parameters + +• **mnemonics**: `string` + +• **path?**: `string` + +#### Returns + +[`Ed25519Keypair`](Ed25519Keypair.md) + +--- + +### deriveKeypairFromSeed() + +> `static` **deriveKeypairFromSeed**(`seedHex`, `path`?): [`Ed25519Keypair`](Ed25519Keypair.md) + +Derive Ed25519 keypair from mnemonicSeed and path. + +If path is none, it will default to m/44'/4218'/0'/0'/0', otherwise the path must +be compliant to SLIP-0010 in form m/44'/4218'/{account_index}'/{change_index}'/{address_index}'. + +#### Parameters + +• **seedHex**: `string` + +• **path?**: `string` + +#### Returns + +[`Ed25519Keypair`](Ed25519Keypair.md) diff --git a/docs/content/ts-sdk/api/keypairs/ed25519/classes/Ed25519PublicKey.md b/docs/content/ts-sdk/api/keypairs/ed25519/classes/Ed25519PublicKey.md new file mode 100644 index 00000000000..1762dc9142e --- /dev/null +++ b/docs/content/ts-sdk/api/keypairs/ed25519/classes/Ed25519PublicKey.md @@ -0,0 +1,274 @@ +# Class: Ed25519PublicKey + +An Ed25519 public key + +## Extends + +- [`PublicKey`](../../../cryptography/classes/PublicKey.md) + +## Constructors + +### new Ed25519PublicKey() + +> **new Ed25519PublicKey**(`value`): [`Ed25519PublicKey`](Ed25519PublicKey.md) + +Create a new Ed25519PublicKey object + +#### Parameters + +• **value**: `PublicKeyInitData` + +ed25519 public key as buffer or base-64 encoded string + +#### Returns + +[`Ed25519PublicKey`](Ed25519PublicKey.md) + +#### Overrides + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`constructor`](../../../cryptography/classes/PublicKey.md#constructors) + +## Properties + +### SIZE + +> `static` **SIZE**: `number` = `PUBLIC_KEY_SIZE` + +## Methods + +### toBase64() + +> **toBase64**(): `string` + +Return the base-64 representation of the public key + +#### Returns + +`string` + +#### Inherited from + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`toBase64`](../../../cryptography/classes/PublicKey.md#tobase64) + +--- + +### toString() + +> **toString**(): `never` + +#### Returns + +`never` + +#### Inherited from + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`toString`](../../../cryptography/classes/PublicKey.md#tostring) + +--- + +### toIotaPublicKey() + +> **toIotaPublicKey**(): `string` + +Return the IOTA representation of the public key encoded in +base-64. A IOTA public key is formed by the concatenation +of the scheme flag with the raw bytes of the public key + +#### Returns + +`string` + +#### Inherited from + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`toIotaPublicKey`](../../../cryptography/classes/PublicKey.md#toiotapublickey) + +--- + +### verifyWithIntent() + +> **verifyWithIntent**(`bytes`, `signature`, `intent`): `Promise`\<`boolean`\> + +#### Parameters + +• **bytes**: `Uint8Array` + +• **signature**: `string` \| `Uint8Array` + +• **intent**: [`IntentScope`](../../../cryptography/type-aliases/IntentScope.md) + +#### Returns + +`Promise`\<`boolean`\> + +#### Inherited from + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`verifyWithIntent`](../../../cryptography/classes/PublicKey.md#verifywithintent) + +--- + +### verifyPersonalMessage() + +> **verifyPersonalMessage**(`message`, `signature`): `Promise`\<`boolean`\> + +Verifies that the signature is valid for for the provided PersonalMessage + +#### Parameters + +• **message**: `Uint8Array` + +• **signature**: `string` \| `Uint8Array` + +#### Returns + +`Promise`\<`boolean`\> + +#### Inherited from + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`verifyPersonalMessage`](../../../cryptography/classes/PublicKey.md#verifypersonalmessage) + +--- + +### verifyTransaction() + +> **verifyTransaction**(`transaction`, `signature`): `Promise`\<`boolean`\> + +Verifies that the signature is valid for for the provided Transaction + +#### Parameters + +• **transaction**: `Uint8Array` + +• **signature**: `string` \| `Uint8Array` + +#### Returns + +`Promise`\<`boolean`\> + +#### Inherited from + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`verifyTransaction`](../../../cryptography/classes/PublicKey.md#verifytransaction) + +--- + +### toIotaBytes() + +> **toIotaBytes**(): `Uint8Array` + +Returns the bytes representation of the public key +prefixed with the signature scheme flag + +#### Returns + +`Uint8Array` + +#### Inherited from + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`toIotaBytes`](../../../cryptography/classes/PublicKey.md#toiotabytes) + +--- + +### toIotaBytesForAddress() + +> **toIotaBytesForAddress**(): `Uint8Array` + +Returns the bytes representation of the public key +prefixed with the signature scheme flag. If the +signature scheme is ED25519, no prefix is set. + +#### Returns + +`Uint8Array` + +#### Inherited from + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`toIotaBytesForAddress`](../../../cryptography/classes/PublicKey.md#toiotabytesforaddress) + +--- + +### toIotaAddress() + +> **toIotaAddress**(): `string` + +Return the IOTA address associated with this Ed25519 public key + +#### Returns + +`string` + +#### Inherited from + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`toIotaAddress`](../../../cryptography/classes/PublicKey.md#toiotaaddress) + +--- + +### equals() + +> **equals**(`publicKey`): `boolean` + +Checks if two Ed25519 public keys are equal + +#### Parameters + +• **publicKey**: [`Ed25519PublicKey`](Ed25519PublicKey.md) + +#### Returns + +`boolean` + +#### Overrides + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`equals`](../../../cryptography/classes/PublicKey.md#equals) + +--- + +### toRawBytes() + +> **toRawBytes**(): `Uint8Array` + +Return the byte array representation of the Ed25519 public key + +#### Returns + +`Uint8Array` + +#### Overrides + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`toRawBytes`](../../../cryptography/classes/PublicKey.md#torawbytes) + +--- + +### flag() + +> **flag**(): `number` + +Return the IOTA address associated with this Ed25519 public key + +#### Returns + +`number` + +#### Overrides + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`flag`](../../../cryptography/classes/PublicKey.md#flag) + +--- + +### verify() + +> **verify**(`message`, `signature`): `Promise`\<`boolean`\> + +Verifies that the signature is valid for for the provided message + +#### Parameters + +• **message**: `Uint8Array` + +• **signature**: `string` \| `Uint8Array` + +#### Returns + +`Promise`\<`boolean`\> + +#### Overrides + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`verify`](../../../cryptography/classes/PublicKey.md#verify) diff --git a/docs/content/ts-sdk/api/keypairs/ed25519/index.md b/docs/content/ts-sdk/api/keypairs/ed25519/index.md new file mode 100644 index 00000000000..0f255541112 --- /dev/null +++ b/docs/content/ts-sdk/api/keypairs/ed25519/index.md @@ -0,0 +1,16 @@ +# keypairs/ed25519 + +## Index + +### Classes + +- [Ed25519Keypair](classes/Ed25519Keypair.md) +- [Ed25519PublicKey](classes/Ed25519PublicKey.md) + +### Interfaces + +- [Ed25519KeypairData](interfaces/Ed25519KeypairData.md) + +### Variables + +- [DEFAULT\_ED25519\_DERIVATION\_PATH](variables/DEFAULT_ED25519_DERIVATION_PATH.md) diff --git a/docs/content/ts-sdk/api/keypairs/ed25519/interfaces/Ed25519KeypairData.md b/docs/content/ts-sdk/api/keypairs/ed25519/interfaces/Ed25519KeypairData.md new file mode 100644 index 00000000000..8a91d7a4c6a --- /dev/null +++ b/docs/content/ts-sdk/api/keypairs/ed25519/interfaces/Ed25519KeypairData.md @@ -0,0 +1,17 @@ +# Interface: Ed25519KeypairData + +Ed25519 Keypair data. The publickey is the 32-byte public key and +the secretkey is 64-byte, where the first 32 bytes is the secret +key and the last 32 bytes is the public key. + +## Properties + +### publicKey + +> **publicKey**: `Uint8Array` + +--- + +### secretKey + +> **secretKey**: `Uint8Array` diff --git a/docs/content/ts-sdk/api/keypairs/ed25519/variables/DEFAULT_ED25519_DERIVATION_PATH.md b/docs/content/ts-sdk/api/keypairs/ed25519/variables/DEFAULT_ED25519_DERIVATION_PATH.md new file mode 100644 index 00000000000..73eccc6b64f --- /dev/null +++ b/docs/content/ts-sdk/api/keypairs/ed25519/variables/DEFAULT_ED25519_DERIVATION_PATH.md @@ -0,0 +1,3 @@ +# Variable: DEFAULT\_ED25519\_DERIVATION\_PATH + +> `const` **DEFAULT\_ED25519\_DERIVATION\_PATH**: `"m/44'/4218'/0'/0'/0'"` = `"m/44'/4218'/0'/0'/0'"` diff --git a/docs/content/ts-sdk/api/keypairs/secp256k1/classes/Secp256k1Keypair.md b/docs/content/ts-sdk/api/keypairs/secp256k1/classes/Secp256k1Keypair.md new file mode 100644 index 00000000000..ebf396ad00e --- /dev/null +++ b/docs/content/ts-sdk/api/keypairs/secp256k1/classes/Secp256k1Keypair.md @@ -0,0 +1,265 @@ +# Class: Secp256k1Keypair + +An Secp256k1 Keypair used for signing transactions. + +## Extends + +- [`Keypair`](../../../cryptography/classes/Keypair.md) + +## Constructors + +### new Secp256k1Keypair() + +> **new Secp256k1Keypair**(`keypair`?): [`Secp256k1Keypair`](Secp256k1Keypair.md) + +Create a new keypair instance. +Generate random keypair if no [Secp256k1Keypair](Secp256k1Keypair.md) is provided. + +#### Parameters + +• **keypair?**: [`Secp256k1KeypairData`](../interfaces/Secp256k1KeypairData.md) + +secp256k1 keypair + +#### Returns + +[`Secp256k1Keypair`](Secp256k1Keypair.md) + +#### Overrides + +[`Keypair`](../../../cryptography/classes/Keypair.md).[`constructor`](../../../cryptography/classes/Keypair.md#constructors) + +## Methods + +### signWithIntent() + +> **signWithIntent**(`bytes`, `intent`): `Promise`\<[`SignatureWithBytes`](../../../cryptography/interfaces/SignatureWithBytes.md)\> + +Sign messages with a specific intent. By combining the message bytes with the intent before hashing and signing, +it ensures that a signed message is tied to a specific purpose and domain separator is provided + +#### Parameters + +• **bytes**: `Uint8Array` + +• **intent**: [`IntentScope`](../../../cryptography/type-aliases/IntentScope.md) + +#### Returns + +`Promise`\<[`SignatureWithBytes`](../../../cryptography/interfaces/SignatureWithBytes.md)\> + +#### Inherited from + +[`Keypair`](../../../cryptography/classes/Keypair.md).[`signWithIntent`](../../../cryptography/classes/Keypair.md#signwithintent) + +--- + +### signTransaction() + +> **signTransaction**(`bytes`): `Promise`\<[`SignatureWithBytes`](../../../cryptography/interfaces/SignatureWithBytes.md)\> + +Signs provided transaction by calling `signWithIntent()` with a `TransactionData` provided as intent scope + +#### Parameters + +• **bytes**: `Uint8Array` + +#### Returns + +`Promise`\<[`SignatureWithBytes`](../../../cryptography/interfaces/SignatureWithBytes.md)\> + +#### Inherited from + +[`Keypair`](../../../cryptography/classes/Keypair.md).[`signTransaction`](../../../cryptography/classes/Keypair.md#signtransaction) + +--- + +### signPersonalMessage() + +> **signPersonalMessage**(`bytes`): `Promise`\<`object`\> + +Signs provided personal message by calling `signWithIntent()` with a `PersonalMessage` provided as intent scope + +#### Parameters + +• **bytes**: `Uint8Array` + +#### Returns + +`Promise`\<`object`\> + +##### bytes + +> **bytes**: `string` + +##### signature + +> **signature**: `string` + +#### Inherited from + +[`Keypair`](../../../cryptography/classes/Keypair.md).[`signPersonalMessage`](../../../cryptography/classes/Keypair.md#signpersonalmessage) + +--- + +### toIotaAddress() + +> **toIotaAddress**(): `string` + +#### Returns + +`string` + +#### Inherited from + +[`Keypair`](../../../cryptography/classes/Keypair.md).[`toIotaAddress`](../../../cryptography/classes/Keypair.md#toiotaaddress) + +--- + +### getKeyScheme() + +> **getKeyScheme**(): [`SignatureScheme`](../../../cryptography/type-aliases/SignatureScheme.md) + +Get the key scheme of the keypair Secp256k1 + +#### Returns + +[`SignatureScheme`](../../../cryptography/type-aliases/SignatureScheme.md) + +#### Overrides + +[`Keypair`](../../../cryptography/classes/Keypair.md).[`getKeyScheme`](../../../cryptography/classes/Keypair.md#getkeyscheme) + +--- + +### generate() + +> `static` **generate**(): [`Secp256k1Keypair`](Secp256k1Keypair.md) + +Generate a new random keypair + +#### Returns + +[`Secp256k1Keypair`](Secp256k1Keypair.md) + +--- + +### fromSecretKey() + +> `static` **fromSecretKey**(`secretKey`, `options`?): [`Secp256k1Keypair`](Secp256k1Keypair.md) + +Create a keypair from a raw secret key byte array. + +This method should only be used to recreate a keypair from a previously +generated secret key. Generating keypairs from a random seed should be done +with the Keypair.fromSeed method. + +#### Parameters + +• **secretKey**: `Uint8Array` + +secret key byte array + +• **options?** + +• **options.skipValidation?**: `boolean` + +#### Returns + +[`Secp256k1Keypair`](Secp256k1Keypair.md) + +#### Throws + +error if the provided secret key is invalid and validation is not skipped. + +--- + +### fromSeed() + +> `static` **fromSeed**(`seed`): [`Secp256k1Keypair`](Secp256k1Keypair.md) + +Generate a keypair from a 32 byte seed. + +#### Parameters + +• **seed**: `Uint8Array` + +seed byte array + +#### Returns + +[`Secp256k1Keypair`](Secp256k1Keypair.md) + +--- + +### getPublicKey() + +> **getPublicKey**(): [`PublicKey`](../../../cryptography/classes/PublicKey.md) + +The public key for this keypair + +#### Returns + +[`PublicKey`](../../../cryptography/classes/PublicKey.md) + +#### Overrides + +[`Keypair`](../../../cryptography/classes/Keypair.md).[`getPublicKey`](../../../cryptography/classes/Keypair.md#getpublickey) + +--- + +### getSecretKey() + +> **getSecretKey**(): `string` + +The Bech32 secret key string for this Secp256k1 keypair + +#### Returns + +`string` + +#### Overrides + +[`Keypair`](../../../cryptography/classes/Keypair.md).[`getSecretKey`](../../../cryptography/classes/Keypair.md#getsecretkey) + +--- + +### sign() + +> **sign**(`data`): `Promise`\<`Uint8Array`\> + +Return the signature for the provided data. + +#### Parameters + +• **data**: `Uint8Array` + +#### Returns + +`Promise`\<`Uint8Array`\> + +#### Overrides + +[`Keypair`](../../../cryptography/classes/Keypair.md).[`sign`](../../../cryptography/classes/Keypair.md#sign) + +--- + +### deriveKeypair() + +> `static` **deriveKeypair**(`mnemonics`, `path`?): [`Secp256k1Keypair`](Secp256k1Keypair.md) + +Derive Secp256k1 keypair from mnemonics and path. The mnemonics must be normalized +and validated against the english wordlist. + +If path is none, it will default to m/54'/4218'/0'/0/0, otherwise the path must +be compliant to BIP-32 in form m/54'/4218'/{account_index}'/{change_index}/{address_index}. + +#### Parameters + +• **mnemonics**: `string` + +• **path?**: `string` + +#### Returns + +[`Secp256k1Keypair`](Secp256k1Keypair.md) diff --git a/docs/content/ts-sdk/api/keypairs/secp256k1/classes/Secp256k1PublicKey.md b/docs/content/ts-sdk/api/keypairs/secp256k1/classes/Secp256k1PublicKey.md new file mode 100644 index 00000000000..d7ee0719526 --- /dev/null +++ b/docs/content/ts-sdk/api/keypairs/secp256k1/classes/Secp256k1PublicKey.md @@ -0,0 +1,274 @@ +# Class: Secp256k1PublicKey + +A Secp256k1 public key + +## Extends + +- [`PublicKey`](../../../cryptography/classes/PublicKey.md) + +## Constructors + +### new Secp256k1PublicKey() + +> **new Secp256k1PublicKey**(`value`): [`Secp256k1PublicKey`](Secp256k1PublicKey.md) + +Create a new Secp256k1PublicKey object + +#### Parameters + +• **value**: `PublicKeyInitData` + +secp256k1 public key as buffer or base-64 encoded string + +#### Returns + +[`Secp256k1PublicKey`](Secp256k1PublicKey.md) + +#### Overrides + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`constructor`](../../../cryptography/classes/PublicKey.md#constructors) + +## Properties + +### SIZE + +> `static` **SIZE**: `number` = `SECP256K1_PUBLIC_KEY_SIZE` + +## Methods + +### toBase64() + +> **toBase64**(): `string` + +Return the base-64 representation of the public key + +#### Returns + +`string` + +#### Inherited from + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`toBase64`](../../../cryptography/classes/PublicKey.md#tobase64) + +--- + +### toString() + +> **toString**(): `never` + +#### Returns + +`never` + +#### Inherited from + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`toString`](../../../cryptography/classes/PublicKey.md#tostring) + +--- + +### toIotaPublicKey() + +> **toIotaPublicKey**(): `string` + +Return the IOTA representation of the public key encoded in +base-64. A IOTA public key is formed by the concatenation +of the scheme flag with the raw bytes of the public key + +#### Returns + +`string` + +#### Inherited from + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`toIotaPublicKey`](../../../cryptography/classes/PublicKey.md#toiotapublickey) + +--- + +### verifyWithIntent() + +> **verifyWithIntent**(`bytes`, `signature`, `intent`): `Promise`\<`boolean`\> + +#### Parameters + +• **bytes**: `Uint8Array` + +• **signature**: `string` \| `Uint8Array` + +• **intent**: [`IntentScope`](../../../cryptography/type-aliases/IntentScope.md) + +#### Returns + +`Promise`\<`boolean`\> + +#### Inherited from + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`verifyWithIntent`](../../../cryptography/classes/PublicKey.md#verifywithintent) + +--- + +### verifyPersonalMessage() + +> **verifyPersonalMessage**(`message`, `signature`): `Promise`\<`boolean`\> + +Verifies that the signature is valid for for the provided PersonalMessage + +#### Parameters + +• **message**: `Uint8Array` + +• **signature**: `string` \| `Uint8Array` + +#### Returns + +`Promise`\<`boolean`\> + +#### Inherited from + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`verifyPersonalMessage`](../../../cryptography/classes/PublicKey.md#verifypersonalmessage) + +--- + +### verifyTransaction() + +> **verifyTransaction**(`transaction`, `signature`): `Promise`\<`boolean`\> + +Verifies that the signature is valid for for the provided Transaction + +#### Parameters + +• **transaction**: `Uint8Array` + +• **signature**: `string` \| `Uint8Array` + +#### Returns + +`Promise`\<`boolean`\> + +#### Inherited from + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`verifyTransaction`](../../../cryptography/classes/PublicKey.md#verifytransaction) + +--- + +### toIotaBytes() + +> **toIotaBytes**(): `Uint8Array` + +Returns the bytes representation of the public key +prefixed with the signature scheme flag + +#### Returns + +`Uint8Array` + +#### Inherited from + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`toIotaBytes`](../../../cryptography/classes/PublicKey.md#toiotabytes) + +--- + +### toIotaBytesForAddress() + +> **toIotaBytesForAddress**(): `Uint8Array` + +Returns the bytes representation of the public key +prefixed with the signature scheme flag. If the +signature scheme is ED25519, no prefix is set. + +#### Returns + +`Uint8Array` + +#### Inherited from + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`toIotaBytesForAddress`](../../../cryptography/classes/PublicKey.md#toiotabytesforaddress) + +--- + +### toIotaAddress() + +> **toIotaAddress**(): `string` + +Return the IOTA address associated with this Ed25519 public key + +#### Returns + +`string` + +#### Inherited from + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`toIotaAddress`](../../../cryptography/classes/PublicKey.md#toiotaaddress) + +--- + +### equals() + +> **equals**(`publicKey`): `boolean` + +Checks if two Secp256k1 public keys are equal + +#### Parameters + +• **publicKey**: [`Secp256k1PublicKey`](Secp256k1PublicKey.md) + +#### Returns + +`boolean` + +#### Overrides + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`equals`](../../../cryptography/classes/PublicKey.md#equals) + +--- + +### toRawBytes() + +> **toRawBytes**(): `Uint8Array` + +Return the byte array representation of the Secp256k1 public key + +#### Returns + +`Uint8Array` + +#### Overrides + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`toRawBytes`](../../../cryptography/classes/PublicKey.md#torawbytes) + +--- + +### flag() + +> **flag**(): `number` + +Return the IOTA address associated with this Secp256k1 public key + +#### Returns + +`number` + +#### Overrides + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`flag`](../../../cryptography/classes/PublicKey.md#flag) + +--- + +### verify() + +> **verify**(`message`, `signature`): `Promise`\<`boolean`\> + +Verifies that the signature is valid for for the provided message + +#### Parameters + +• **message**: `Uint8Array` + +• **signature**: `string` \| `Uint8Array` + +#### Returns + +`Promise`\<`boolean`\> + +#### Overrides + +[`PublicKey`](../../../cryptography/classes/PublicKey.md).[`verify`](../../../cryptography/classes/PublicKey.md#verify) diff --git a/docs/content/ts-sdk/api/keypairs/secp256k1/index.md b/docs/content/ts-sdk/api/keypairs/secp256k1/index.md new file mode 100644 index 00000000000..128c2524bf9 --- /dev/null +++ b/docs/content/ts-sdk/api/keypairs/secp256k1/index.md @@ -0,0 +1,25 @@ +# keypairs/secp256k1 + +## References + +### DEFAULT\_SECP256K1\_DERIVATION\_PATH + +Re-exports [DEFAULT_SECP256K1_DERIVATION_PATH](variables/DEFAULT_SECP256K1_DERIVATION_PATH.md) + +--- + +### Secp256k1Keypair + +Re-exports [Secp256k1Keypair](classes/Secp256k1Keypair.md) + +--- + +### Secp256k1KeypairData + +Re-exports [Secp256k1KeypairData](interfaces/Secp256k1KeypairData.md) + +--- + +### Secp256k1PublicKey + +Re-exports [Secp256k1PublicKey](classes/Secp256k1PublicKey.md) diff --git a/docs/content/ts-sdk/api/keypairs/secp256k1/interfaces/Secp256k1KeypairData.md b/docs/content/ts-sdk/api/keypairs/secp256k1/interfaces/Secp256k1KeypairData.md new file mode 100644 index 00000000000..15128be2f2a --- /dev/null +++ b/docs/content/ts-sdk/api/keypairs/secp256k1/interfaces/Secp256k1KeypairData.md @@ -0,0 +1,15 @@ +# Interface: Secp256k1KeypairData + +Secp256k1 Keypair data + +## Properties + +### publicKey + +> **publicKey**: `Uint8Array` + +--- + +### secretKey + +> **secretKey**: `Uint8Array` diff --git a/docs/content/ts-sdk/api/keypairs/secp256k1/variables/DEFAULT_SECP256K1_DERIVATION_PATH.md b/docs/content/ts-sdk/api/keypairs/secp256k1/variables/DEFAULT_SECP256K1_DERIVATION_PATH.md new file mode 100644 index 00000000000..27f35eea3ab --- /dev/null +++ b/docs/content/ts-sdk/api/keypairs/secp256k1/variables/DEFAULT_SECP256K1_DERIVATION_PATH.md @@ -0,0 +1,3 @@ +# Variable: DEFAULT\_SECP256K1\_DERIVATION\_PATH + +> `const` **DEFAULT\_SECP256K1\_DERIVATION\_PATH**: `"m/54'/4218'/0'/0/0"` = `"m/54'/4218'/0'/0/0"` diff --git a/docs/content/ts-sdk/api/multisig/classes/MultiSigPublicKey.md b/docs/content/ts-sdk/api/multisig/classes/MultiSigPublicKey.md new file mode 100644 index 00000000000..2a2439369c5 --- /dev/null +++ b/docs/content/ts-sdk/api/multisig/classes/MultiSigPublicKey.md @@ -0,0 +1,339 @@ +# Class: MultiSigPublicKey + +A MultiSig public key + +## Extends + +- [`PublicKey`](../../cryptography/classes/PublicKey.md) + +## Constructors + +### new MultiSigPublicKey() + +> **new MultiSigPublicKey**(`value`): [`MultiSigPublicKey`](MultiSigPublicKey.md) + +Create a new MultiSigPublicKey object + +#### Parameters + +• **value**: `string` \| `Uint8Array` \| `MultiSigPublicKeyStruct` + +MultiSig public key as buffer or base-64 encoded string + +#### Returns + +[`MultiSigPublicKey`](MultiSigPublicKey.md) + +#### Overrides + +[`PublicKey`](../../cryptography/classes/PublicKey.md).[`constructor`](../../cryptography/classes/PublicKey.md#constructors) + +## Methods + +### toBase64() + +> **toBase64**(): `string` + +Return the base-64 representation of the public key + +#### Returns + +`string` + +#### Inherited from + +[`PublicKey`](../../cryptography/classes/PublicKey.md).[`toBase64`](../../cryptography/classes/PublicKey.md#tobase64) + +--- + +### toString() + +> **toString**(): `never` + +#### Returns + +`never` + +#### Inherited from + +[`PublicKey`](../../cryptography/classes/PublicKey.md).[`toString`](../../cryptography/classes/PublicKey.md#tostring) + +--- + +### toIotaPublicKey() + +> **toIotaPublicKey**(): `string` + +Return the IOTA representation of the public key encoded in +base-64. A IOTA public key is formed by the concatenation +of the scheme flag with the raw bytes of the public key + +#### Returns + +`string` + +#### Inherited from + +[`PublicKey`](../../cryptography/classes/PublicKey.md).[`toIotaPublicKey`](../../cryptography/classes/PublicKey.md#toiotapublickey) + +--- + +### verifyWithIntent() + +> **verifyWithIntent**(`bytes`, `signature`, `intent`): `Promise`\<`boolean`\> + +#### Parameters + +• **bytes**: `Uint8Array` + +• **signature**: `string` \| `Uint8Array` + +• **intent**: [`IntentScope`](../../cryptography/type-aliases/IntentScope.md) + +#### Returns + +`Promise`\<`boolean`\> + +#### Inherited from + +[`PublicKey`](../../cryptography/classes/PublicKey.md).[`verifyWithIntent`](../../cryptography/classes/PublicKey.md#verifywithintent) + +--- + +### verifyPersonalMessage() + +> **verifyPersonalMessage**(`message`, `signature`): `Promise`\<`boolean`\> + +Verifies that the signature is valid for for the provided PersonalMessage + +#### Parameters + +• **message**: `Uint8Array` + +• **signature**: `string` \| `Uint8Array` + +#### Returns + +`Promise`\<`boolean`\> + +#### Inherited from + +[`PublicKey`](../../cryptography/classes/PublicKey.md).[`verifyPersonalMessage`](../../cryptography/classes/PublicKey.md#verifypersonalmessage) + +--- + +### verifyTransaction() + +> **verifyTransaction**(`transaction`, `signature`): `Promise`\<`boolean`\> + +Verifies that the signature is valid for for the provided Transaction + +#### Parameters + +• **transaction**: `Uint8Array` + +• **signature**: `string` \| `Uint8Array` + +#### Returns + +`Promise`\<`boolean`\> + +#### Inherited from + +[`PublicKey`](../../cryptography/classes/PublicKey.md).[`verifyTransaction`](../../cryptography/classes/PublicKey.md#verifytransaction) + +--- + +### toIotaBytes() + +> **toIotaBytes**(): `Uint8Array` + +Returns the bytes representation of the public key +prefixed with the signature scheme flag + +#### Returns + +`Uint8Array` + +#### Inherited from + +[`PublicKey`](../../cryptography/classes/PublicKey.md).[`toIotaBytes`](../../cryptography/classes/PublicKey.md#toiotabytes) + +--- + +### toIotaBytesForAddress() + +> **toIotaBytesForAddress**(): `Uint8Array` + +Returns the bytes representation of the public key +prefixed with the signature scheme flag. If the +signature scheme is ED25519, no prefix is set. + +#### Returns + +`Uint8Array` + +#### Inherited from + +[`PublicKey`](../../cryptography/classes/PublicKey.md).[`toIotaBytesForAddress`](../../cryptography/classes/PublicKey.md#toiotabytesforaddress) + +--- + +### fromPublicKeys() + +> `static` **fromPublicKeys**(`__namedParameters`): [`MultiSigPublicKey`](MultiSigPublicKey.md) + +A static method to create a new MultiSig publickey instance from a set of public keys and their associated weights pairs and threshold. + +#### Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.threshold**: `number` + +• **\_\_namedParameters.publicKeys**: `object`[] + +#### Returns + +[`MultiSigPublicKey`](MultiSigPublicKey.md) + +--- + +### equals() + +> **equals**(`publicKey`): `boolean` + +Checks if two MultiSig public keys are equal + +#### Parameters + +• **publicKey**: [`MultiSigPublicKey`](MultiSigPublicKey.md) + +#### Returns + +`boolean` + +#### Overrides + +[`PublicKey`](../../cryptography/classes/PublicKey.md).[`equals`](../../cryptography/classes/PublicKey.md#equals) + +--- + +### toRawBytes() + +> **toRawBytes**(): `Uint8Array` + +Return the byte array representation of the MultiSig public key + +#### Returns + +`Uint8Array` + +#### Overrides + +[`PublicKey`](../../cryptography/classes/PublicKey.md).[`toRawBytes`](../../cryptography/classes/PublicKey.md#torawbytes) + +--- + +### getPublicKeys() + +> **getPublicKeys**(): `object`[] + +#### Returns + +`object`[] + +--- + +### getThreshold() + +> **getThreshold**(): `number` + +#### Returns + +`number` + +--- + +### getSigner() + +> **getSigner**(...`signers`): [`MultiSigSigner`](MultiSigSigner.md) + +#### Parameters + +• ...**signers**: [[`Signer`](../../cryptography/classes/Signer.md)] + +#### Returns + +[`MultiSigSigner`](MultiSigSigner.md) + +--- + +### toIotaAddress() + +> **toIotaAddress**(): `string` + +Return the IOTA address associated with this MultiSig public key + +#### Returns + +`string` + +#### Overrides + +[`PublicKey`](../../cryptography/classes/PublicKey.md).[`toIotaAddress`](../../cryptography/classes/PublicKey.md#toiotaaddress) + +--- + +### flag() + +> **flag**(): `number` + +Return the IOTA address associated with this MultiSig public key + +#### Returns + +`number` + +#### Overrides + +[`PublicKey`](../../cryptography/classes/PublicKey.md).[`flag`](../../cryptography/classes/PublicKey.md#flag) + +--- + +### verify() + +> **verify**(`message`, `multisigSignature`): `Promise`\<`boolean`\> + +Verifies that the signature is valid for for the provided message + +#### Parameters + +• **message**: `Uint8Array` + +• **multisigSignature**: `string` + +#### Returns + +`Promise`\<`boolean`\> + +#### Overrides + +[`PublicKey`](../../cryptography/classes/PublicKey.md).[`verify`](../../cryptography/classes/PublicKey.md#verify) + +--- + +### combinePartialSignatures() + +> **combinePartialSignatures**(`signatures`): `string` + +Combines multiple partial signatures into a single multisig, ensuring that each public key signs only once +and that all the public keys involved are known and valid, and then serializes multisig into the standard format + +#### Parameters + +• **signatures**: `string`[] + +#### Returns + +`string` diff --git a/docs/content/ts-sdk/api/multisig/classes/MultiSigSigner.md b/docs/content/ts-sdk/api/multisig/classes/MultiSigSigner.md new file mode 100644 index 00000000000..fa42201acbd --- /dev/null +++ b/docs/content/ts-sdk/api/multisig/classes/MultiSigSigner.md @@ -0,0 +1,184 @@ +# Class: MultiSigSigner + +TODO: Document + +## Extends + +- [`Signer`](../../cryptography/classes/Signer.md) + +## Constructors + +### new MultiSigSigner() + +> **new MultiSigSigner**(`pubkey`, `signers`): [`MultiSigSigner`](MultiSigSigner.md) + +#### Parameters + +• **pubkey**: [`MultiSigPublicKey`](MultiSigPublicKey.md) + +• **signers**: [`Signer`](../../cryptography/classes/Signer.md)[] = `[]` + +#### Returns + +[`MultiSigSigner`](MultiSigSigner.md) + +#### Overrides + +[`Signer`](../../cryptography/classes/Signer.md).[`constructor`](../../cryptography/classes/Signer.md#constructors) + +## Methods + +### signWithIntent() + +> **signWithIntent**(`bytes`, `intent`): `Promise`\<[`SignatureWithBytes`](../../cryptography/interfaces/SignatureWithBytes.md)\> + +Sign messages with a specific intent. By combining the message bytes with the intent before hashing and signing, +it ensures that a signed message is tied to a specific purpose and domain separator is provided + +#### Parameters + +• **bytes**: `Uint8Array` + +• **intent**: [`IntentScope`](../../cryptography/type-aliases/IntentScope.md) + +#### Returns + +`Promise`\<[`SignatureWithBytes`](../../cryptography/interfaces/SignatureWithBytes.md)\> + +#### Inherited from + +[`Signer`](../../cryptography/classes/Signer.md).[`signWithIntent`](../../cryptography/classes/Signer.md#signwithintent) + +--- + +### toIotaAddress() + +> **toIotaAddress**(): `string` + +#### Returns + +`string` + +#### Inherited from + +[`Signer`](../../cryptography/classes/Signer.md).[`toIotaAddress`](../../cryptography/classes/Signer.md#toiotaaddress) + +--- + +### getKeyScheme() + +> **getKeyScheme**(): [`SignatureScheme`](../../cryptography/type-aliases/SignatureScheme.md) + +Get the key scheme of the keypair: Secp256k1 or ED25519 + +#### Returns + +[`SignatureScheme`](../../cryptography/type-aliases/SignatureScheme.md) + +#### Overrides + +[`Signer`](../../cryptography/classes/Signer.md).[`getKeyScheme`](../../cryptography/classes/Signer.md#getkeyscheme) + +--- + +### getPublicKey() + +> **getPublicKey**(): [`MultiSigPublicKey`](MultiSigPublicKey.md) + +The public key for this keypair + +#### Returns + +[`MultiSigPublicKey`](MultiSigPublicKey.md) + +#### Overrides + +[`Signer`](../../cryptography/classes/Signer.md).[`getPublicKey`](../../cryptography/classes/Signer.md#getpublickey) + +--- + +### sign() + +> **sign**(`_data`): `never` + +#### Parameters + +• **\_data**: `Uint8Array` + +#### Returns + +`never` + +#### Overrides + +[`Signer`](../../cryptography/classes/Signer.md).[`sign`](../../cryptography/classes/Signer.md#sign) + +--- + +### signData() + +> **signData**(`_data`): `never` + +#### Parameters + +• **\_data**: `Uint8Array` + +#### Returns + +`never` + +--- + +### signTransaction() + +> **signTransaction**(`bytes`): `Promise`\<`object`\> + +Signs provided transaction by calling `signWithIntent()` with a `TransactionData` provided as intent scope + +#### Parameters + +• **bytes**: `Uint8Array` + +#### Returns + +`Promise`\<`object`\> + +##### signature + +> **signature**: `string` + +##### bytes + +> **bytes**: `string` + +#### Overrides + +[`Signer`](../../cryptography/classes/Signer.md).[`signTransaction`](../../cryptography/classes/Signer.md#signtransaction) + +--- + +### signPersonalMessage() + +> **signPersonalMessage**(`bytes`): `Promise`\<`object`\> + +Signs provided personal message by calling `signWithIntent()` with a `PersonalMessage` provided as intent scope + +#### Parameters + +• **bytes**: `Uint8Array` + +#### Returns + +`Promise`\<`object`\> + +##### signature + +> **signature**: `string` + +##### bytes + +> **bytes**: `string` + +#### Overrides + +[`Signer`](../../cryptography/classes/Signer.md).[`signPersonalMessage`](../../cryptography/classes/Signer.md#signpersonalmessage) diff --git a/docs/content/ts-sdk/api/multisig/functions/parsePartialSignatures.md b/docs/content/ts-sdk/api/multisig/functions/parsePartialSignatures.md new file mode 100644 index 00000000000..c8da186fa70 --- /dev/null +++ b/docs/content/ts-sdk/api/multisig/functions/parsePartialSignatures.md @@ -0,0 +1,13 @@ +# Function: parsePartialSignatures() + +> **parsePartialSignatures**(`multisig`): `ParsedPartialMultiSigSignature`[] + +Parse multisig structure into an array of individual signatures: signature scheme, the actual individual signature, public key and its weight. + +## Parameters + +• **multisig**: [`MultiSigStruct`](../type-aliases/MultiSigStruct.md) + +## Returns + +`ParsedPartialMultiSigSignature`[] diff --git a/docs/content/ts-sdk/api/multisig/index.md b/docs/content/ts-sdk/api/multisig/index.md new file mode 100644 index 00000000000..2d1327238f1 --- /dev/null +++ b/docs/content/ts-sdk/api/multisig/index.md @@ -0,0 +1,16 @@ +# multisig + +## Index + +### Classes + +- [MultiSigPublicKey](classes/MultiSigPublicKey.md) +- [MultiSigSigner](classes/MultiSigSigner.md) + +### Type Aliases + +- [MultiSigStruct](type-aliases/MultiSigStruct.md) + +### Functions + +- [parsePartialSignatures](functions/parsePartialSignatures.md) diff --git a/docs/content/ts-sdk/api/multisig/type-aliases/MultiSigStruct.md b/docs/content/ts-sdk/api/multisig/type-aliases/MultiSigStruct.md new file mode 100644 index 00000000000..0f9e0237dd2 --- /dev/null +++ b/docs/content/ts-sdk/api/multisig/type-aliases/MultiSigStruct.md @@ -0,0 +1,17 @@ +# Type Alias: MultiSigStruct + +> **MultiSigStruct**: `object` + +## Type declaration + +### sigs + +> **sigs**: `CompressedSignature`[] + +### bitmap + +> **bitmap**: `number` + +### multisig\_pk + +> **multisig\_pk**: `MultiSigPublicKeyStruct` diff --git a/docs/content/ts-sdk/api/transactions/classes/AsyncCache.md b/docs/content/ts-sdk/api/transactions/classes/AsyncCache.md new file mode 100644 index 00000000000..36be0086784 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/classes/AsyncCache.md @@ -0,0 +1,297 @@ +# Class: `abstract` AsyncCache + +## Constructors + +### new AsyncCache() + +> **new AsyncCache**(): [`AsyncCache`](AsyncCache.md) + +#### Returns + +[`AsyncCache`](AsyncCache.md) + +## Methods + +### get() + +> `abstract` `protected` **get**\<`T`\>(`type`, `key`): `Promise`\<`null` \| `CacheEntryTypes`\[`T`\]\> + +#### Type Parameters + +• **T** _extends_ keyof `CacheEntryTypes` + +#### Parameters + +• **type**: `T` + +• **key**: `string` + +#### Returns + +`Promise`\<`null` \| `CacheEntryTypes`\[`T`\]\> + +--- + +### set() + +> `abstract` `protected` **set**\<`T`\>(`type`, `key`, `value`): `Promise`\<`void`\> + +#### Type Parameters + +• **T** _extends_ keyof `CacheEntryTypes` + +#### Parameters + +• **type**: `T` + +• **key**: `string` + +• **value**: `CacheEntryTypes`\[`T`\] + +#### Returns + +`Promise`\<`void`\> + +--- + +### delete() + +> `abstract` `protected` **delete**\<`T`\>(`type`, `key`): `Promise`\<`void`\> + +#### Type Parameters + +• **T** _extends_ keyof `CacheEntryTypes` + +#### Parameters + +• **type**: `T` + +• **key**: `string` + +#### Returns + +`Promise`\<`void`\> + +--- + +### clear() + +> `abstract` **clear**\<`T`\>(`type`?): `Promise`\<`void`\> + +#### Type Parameters + +• **T** _extends_ keyof `CacheEntryTypes` + +#### Parameters + +• **type?**: `T` + +#### Returns + +`Promise`\<`void`\> + +--- + +### getObject() + +> **getObject**(`id`): `Promise`\<`null` \| `ObjectCacheEntry`\> + +#### Parameters + +• **id**: `string` + +#### Returns + +`Promise`\<`null` \| `ObjectCacheEntry`\> + +--- + +### getObjects() + +> **getObjects**(`ids`): `Promise`\<(`null` \| `ObjectCacheEntry`)[]\> + +#### Parameters + +• **ids**: `string`[] + +#### Returns + +`Promise`\<(`null` \| `ObjectCacheEntry`)[]\> + +--- + +### addObject() + +> **addObject**(`object`): `Promise`\<`ObjectCacheEntry`\> + +#### Parameters + +• **object**: `ObjectCacheEntry` + +#### Returns + +`Promise`\<`ObjectCacheEntry`\> + +--- + +### addObjects() + +> **addObjects**(`objects`): `Promise`\<`void`\> + +#### Parameters + +• **objects**: `ObjectCacheEntry`[] + +#### Returns + +`Promise`\<`void`\> + +--- + +### deleteObject() + +> **deleteObject**(`id`): `Promise`\<`void`\> + +#### Parameters + +• **id**: `string` + +#### Returns + +`Promise`\<`void`\> + +--- + +### deleteObjects() + +> **deleteObjects**(`ids`): `Promise`\<`void`\> + +#### Parameters + +• **ids**: `string`[] + +#### Returns + +`Promise`\<`void`\> + +--- + +### getMoveFunctionDefinition() + +> **getMoveFunctionDefinition**(`ref`): `Promise`\<`null` \| `MoveFunctionCacheEntry`\> + +#### Parameters + +• **ref** + +• **ref.package**: `string` + +• **ref.module**: `string` + +• **ref.function**: `string` + +#### Returns + +`Promise`\<`null` \| `MoveFunctionCacheEntry`\> + +--- + +### addMoveFunctionDefinition() + +> **addMoveFunctionDefinition**(`functionEntry`): `Promise`\<`object`\> + +#### Parameters + +• **functionEntry**: `MoveFunctionCacheEntry` + +#### Returns + +`Promise`\<`object`\> + +##### module + +> **module**: `string` + +##### function + +> **function**: `string` + +##### parameters + +> **parameters**: `object`[] + +##### package + +> **package**: `string` = `pkg` + +--- + +### deleteMoveFunctionDefinition() + +> **deleteMoveFunctionDefinition**(`ref`): `Promise`\<`void`\> + +#### Parameters + +• **ref** + +• **ref.package**: `string` + +• **ref.module**: `string` + +• **ref.function**: `string` + +#### Returns + +`Promise`\<`void`\> + +--- + +### getCustom() + +> **getCustom**\<`T`\>(`key`): `Promise`\<`null` \| `T`\> + +#### Type Parameters + +• **T** + +#### Parameters + +• **key**: `string` + +#### Returns + +`Promise`\<`null` \| `T`\> + +--- + +### setCustom() + +> **setCustom**\<`T`\>(`key`, `value`): `Promise`\<`void`\> + +#### Type Parameters + +• **T** + +#### Parameters + +• **key**: `string` + +• **value**: `T` + +#### Returns + +`Promise`\<`void`\> + +--- + +### deleteCustom() + +> **deleteCustom**(`key`): `Promise`\<`void`\> + +#### Parameters + +• **key**: `string` + +#### Returns + +`Promise`\<`void`\> diff --git a/docs/content/ts-sdk/api/transactions/classes/ObjectCache.md b/docs/content/ts-sdk/api/transactions/classes/ObjectCache.md new file mode 100644 index 00000000000..9cad0a8a823 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/classes/ObjectCache.md @@ -0,0 +1,205 @@ +# Class: ObjectCache + +## Constructors + +### new ObjectCache() + +> **new ObjectCache**(`__namedParameters`): [`ObjectCache`](ObjectCache.md) + +#### Parameters + +• **\_\_namedParameters**: `ObjectCacheOptions` + +#### Returns + +[`ObjectCache`](ObjectCache.md) + +## Methods + +### asPlugin() + +> **asPlugin**(): [`TransactionPlugin`](../type-aliases/TransactionPlugin.md) + +#### Returns + +[`TransactionPlugin`](../type-aliases/TransactionPlugin.md) + +--- + +### clear() + +> **clear**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +--- + +### getMoveFunctionDefinition() + +> **getMoveFunctionDefinition**(`ref`): `Promise`\<`null` \| `MoveFunctionCacheEntry`\> + +#### Parameters + +• **ref** + +• **ref.package**: `string` + +• **ref.module**: `string` + +• **ref.function**: `string` + +#### Returns + +`Promise`\<`null` \| `MoveFunctionCacheEntry`\> + +--- + +### getObjects() + +> **getObjects**(`ids`): `Promise`\<(`null` \| `ObjectCacheEntry`)[]\> + +#### Parameters + +• **ids**: `string`[] + +#### Returns + +`Promise`\<(`null` \| `ObjectCacheEntry`)[]\> + +--- + +### deleteObjects() + +> **deleteObjects**(`ids`): `Promise`\<`void`\> + +#### Parameters + +• **ids**: `string`[] + +#### Returns + +`Promise`\<`void`\> + +--- + +### clearOwnedObjects() + +> **clearOwnedObjects**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +--- + +### clearCustom() + +> **clearCustom**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +--- + +### getCustom() + +> **getCustom**\<`T`\>(`key`): `Promise`\<`null` \| `T`\> + +#### Type Parameters + +• **T** + +#### Parameters + +• **key**: `string` + +#### Returns + +`Promise`\<`null` \| `T`\> + +--- + +### setCustom() + +> **setCustom**\<`T`\>(`key`, `value`): `Promise`\<`void`\> + +#### Type Parameters + +• **T** + +#### Parameters + +• **key**: `string` + +• **value**: `T` + +#### Returns + +`Promise`\<`void`\> + +--- + +### deleteCustom() + +> **deleteCustom**(`key`): `Promise`\<`void`\> + +#### Parameters + +• **key**: `string` + +#### Returns + +`Promise`\<`void`\> + +--- + +### applyEffects() + +> **applyEffects**(`effects`): `Promise`\<`void`\> + +#### Parameters + +• **effects** + +• **effects.$kind**: `"V1"` + +• **effects.V1** = `TransactionEffectsV1` + +• **effects.V1.status**: `EnumOutputShapeWithKeys`\<`object`, `"Success"` \| `"Failed"`\> = `ExecutionStatus` + +• **effects.V1.executedEpoch**: `string` = `...` + +• **effects.V1.gasUsed** = `GasCostSummary` + +• **effects.V1.gasUsed.computationCost**: `string` = `...` + +• **effects.V1.gasUsed.computationCostBurned**: `string` = `...` + +• **effects.V1.gasUsed.storageCost**: `string` = `...` + +• **effects.V1.gasUsed.storageRebate**: `string` = `...` + +• **effects.V1.gasUsed.nonRefundableStorageFee**: `string` = `...` + +• **effects.V1.transactionDigest**: `string` = `ObjectDigest` + +• **effects.V1.gasObjectIndex**: `null` \| `number` = `...` + +• **effects.V1.eventsDigest**: `null` \| `string` = `...` + +• **effects.V1.dependencies**: `string`[] = `...` + +• **effects.V1.lamportVersion**: `string` = `...` + +• **effects.V1.changedObjects**: [`string`, `object`][] = `...` + +• **effects.V1.unchangedSharedObjects**: [`string`, `EnumOutputShapeWithKeys`\<`object`, `"ReadOnlyRoot"` \| `"MutateDeleted"` \| `"ReadDeleted"` \| `"Cancelled"` \| `"PerEpochConfig"`\>][] = `...` + +• **effects.V1.auxDataDigest**: `null` \| `string` = `...` + +#### Returns + +`Promise`\<`void`\> diff --git a/docs/content/ts-sdk/api/transactions/classes/ParallelTransactionExecutor.md b/docs/content/ts-sdk/api/transactions/classes/ParallelTransactionExecutor.md new file mode 100644 index 00000000000..40be6ca8364 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/classes/ParallelTransactionExecutor.md @@ -0,0 +1,59 @@ +# Class: ParallelTransactionExecutor + +## Constructors + +### new ParallelTransactionExecutor() + +> **new ParallelTransactionExecutor**(`options`): [`ParallelTransactionExecutor`](ParallelTransactionExecutor.md) + +#### Parameters + +• **options**: [`ParallelTransactionExecutorOptions`](../interfaces/ParallelTransactionExecutorOptions.md) + +#### Returns + +[`ParallelTransactionExecutor`](ParallelTransactionExecutor.md) + +## Methods + +### resetCache() + +> **resetCache**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +--- + +### waitForLastTransaction() + +> **waitForLastTransaction**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +--- + +### executeTransaction() + +> **executeTransaction**(`transaction`, `options`?): `Promise`\<`object`\> + +#### Parameters + +• **transaction**: [`Transaction`](Transaction.md) + +• **options?**: [`IotaTransactionBlockResponseOptions`](../../client/interfaces/IotaTransactionBlockResponseOptions.md) + +#### Returns + +`Promise`\<`object`\> + +##### digest + +> **digest**: `string` + +##### effects + +> **effects**: `string` diff --git a/docs/content/ts-sdk/api/transactions/classes/SerialTransactionExecutor.md b/docs/content/ts-sdk/api/transactions/classes/SerialTransactionExecutor.md new file mode 100644 index 00000000000..c1c7bff91c5 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/classes/SerialTransactionExecutor.md @@ -0,0 +1,123 @@ +# Class: SerialTransactionExecutor + +## Constructors + +### new SerialTransactionExecutor() + +> **new SerialTransactionExecutor**(`__namedParameters`): [`SerialTransactionExecutor`](SerialTransactionExecutor.md) + +#### Parameters + +• **\_\_namedParameters**: `Omit`\<`ObjectCacheOptions`, `"address"`\> & `object` + +#### Returns + +[`SerialTransactionExecutor`](SerialTransactionExecutor.md) + +## Methods + +### applyEffects() + +> **applyEffects**(`effects`): `Promise`\<[`void`, `void`]\> + +#### Parameters + +• **effects** + +• **effects.$kind**: `"V1"` + +• **effects.V1** = `TransactionEffectsV1` + +• **effects.V1.status**: `EnumOutputShapeWithKeys`\<`object`, `"Success"` \| `"Failed"`\> = `ExecutionStatus` + +• **effects.V1.executedEpoch**: `string` = `...` + +• **effects.V1.gasUsed** = `GasCostSummary` + +• **effects.V1.gasUsed.computationCost**: `string` = `...` + +• **effects.V1.gasUsed.computationCostBurned**: `string` = `...` + +• **effects.V1.gasUsed.storageCost**: `string` = `...` + +• **effects.V1.gasUsed.storageRebate**: `string` = `...` + +• **effects.V1.gasUsed.nonRefundableStorageFee**: `string` = `...` + +• **effects.V1.transactionDigest**: `string` = `ObjectDigest` + +• **effects.V1.gasObjectIndex**: `null` \| `number` = `...` + +• **effects.V1.eventsDigest**: `null` \| `string` = `...` + +• **effects.V1.dependencies**: `string`[] = `...` + +• **effects.V1.lamportVersion**: `string` = `...` + +• **effects.V1.changedObjects**: [`string`, `object`][] = `...` + +• **effects.V1.unchangedSharedObjects**: [`string`, `EnumOutputShapeWithKeys`\<`object`, `"ReadOnlyRoot"` \| `"MutateDeleted"` \| `"ReadDeleted"` \| `"Cancelled"` \| `"PerEpochConfig"`\>][] = `...` + +• **effects.V1.auxDataDigest**: `null` \| `string` = `...` + +#### Returns + +`Promise`\<[`void`, `void`]\> + +--- + +### buildTransaction() + +> **buildTransaction**(`transaction`): `Promise`\<`Uint8Array`\> + +#### Parameters + +• **transaction**: [`Transaction`](Transaction.md) + +#### Returns + +`Promise`\<`Uint8Array`\> + +--- + +### resetCache() + +> **resetCache**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +--- + +### waitForLastTransaction() + +> **waitForLastTransaction**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +--- + +### executeTransaction() + +> **executeTransaction**(`transaction`, `options`?): `Promise`\<`object`\> + +#### Parameters + +• **transaction**: `Uint8Array` \| [`Transaction`](Transaction.md) + +• **options?**: [`IotaTransactionBlockResponseOptions`](../../client/interfaces/IotaTransactionBlockResponseOptions.md) + +#### Returns + +`Promise`\<`object`\> + +##### digest + +> **digest**: `string` = `results.digest` + +##### effects + +> **effects**: `string` diff --git a/docs/content/ts-sdk/api/transactions/classes/Transaction.md b/docs/content/ts-sdk/api/transactions/classes/Transaction.md new file mode 100644 index 00000000000..6ab53963495 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/classes/Transaction.md @@ -0,0 +1,958 @@ +# Class: Transaction + +Transaction Builder + +## Constructors + +### new Transaction() + +> **new Transaction**(): [`Transaction`](Transaction.md) + +#### Returns + +[`Transaction`](Transaction.md) + +## Properties + +### object() + +> **object**: (`value`) => `object` + +Add a new object input to the transaction. + +#### Parameters + +• **value**: [`TransactionObjectInput`](../type-aliases/TransactionObjectInput.md) + +#### Returns + +`object` + +##### $kind + +> **$kind**: `"Input"` + +##### Input + +> **Input**: `number` + +##### type? + +> `optional` **type**: `"object"` + +#### system() + +##### Returns + +`object` + +###### $kind + +> **$kind**: `"Input"` + +###### Input + +> **Input**: `number` + +###### type? + +> `optional` **type**: `"object"` + +#### clock() + +##### Returns + +`object` + +###### $kind + +> **$kind**: `"Input"` + +###### Input + +> **Input**: `number` + +###### type? + +> `optional` **type**: `"object"` + +#### random() + +##### Returns + +`object` + +###### $kind + +> **$kind**: `"Input"` + +###### Input + +> **Input**: `number` + +###### type? + +> `optional` **type**: `"object"` + +#### denyList() + +##### Returns + +`object` + +###### $kind + +> **$kind**: `"Input"` + +###### Input + +> **Input**: `number` + +###### type? + +> `optional` **type**: `"object"` + +## Accessors + +### blockData + +#### Get Signature + +> **get** **blockData**(): `object` + +##### Deprecated + +Use `getData()` instead. + +##### Returns + +`object` + +###### ~~version~~ + +> **version**: `1` + +###### ~~sender?~~ + +> `optional` **sender**: `string` + +###### ~~expiration?~~ + +> `optional` **expiration**: `null` \| `object` \| `object` + +###### ~~gasConfig~~ + +> **gasConfig**: `object` = `GasConfig` + +###### gasConfig.budget? + +> `optional` **budget**: `string` \| `number` \| `bigint` + +###### gasConfig.price? + +> `optional` **price**: `string` \| `number` \| `bigint` + +###### gasConfig.payment? + +> `optional` **payment**: `object`[] + +###### gasConfig.owner? + +> `optional` **owner**: `string` + +###### ~~inputs~~ + +> **inputs**: (`object` \| `object`)[] + +###### ~~transactions~~ + +> **transactions**: (`object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object`)[] + +--- + +### pure + +#### Get Signature + +> **get** **pure**(): \<`T`\>(`type`, `value`) => `T`(`value`) => `T` + +##### Returns + +`Function` + +###### Type Parameters + +• **T** _extends_ `PureTypeName` + +###### Parameters + +• **type**: `T` _extends_ `PureTypeName` ? `ValidPureTypeName`\<`T`\<`T`\>\> : `T` + +• **value**: `ShapeFromPureTypeName`\<`T`\> + +###### Returns + +`T` + +###### Parameters + +• **value**: `Uint8Array` \| `SerializedBcs`\<`any`, `any`\> + +The pure value, serialized to BCS. If this is a Uint8Array, then the value +is assumed to be raw bytes, and will be used directly. + +###### Returns + +`T` + +###### u8() + +###### Parameters + +• **value**: `number` + +###### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +###### u16() + +###### Parameters + +• **value**: `number` + +###### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +###### u32() + +###### Parameters + +• **value**: `number` + +###### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +###### u64() + +###### Parameters + +• **value**: `string` \| `number` \| `bigint` + +###### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +###### u128() + +###### Parameters + +• **value**: `string` \| `number` \| `bigint` + +###### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +###### u256() + +###### Parameters + +• **value**: `string` \| `number` \| `bigint` + +###### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +###### bool() + +###### Parameters + +• **value**: `boolean` + +###### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +###### string() + +###### Parameters + +• **value**: `string` + +###### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +###### address() + +###### Parameters + +• **value**: `string` + +###### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +###### id() + +> **id**: (`value`) => `object` \| `object` \| `object` \| `object` \| `object` + +###### Parameters + +• **value**: `string` + +###### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +###### vector() + +###### Type Parameters + +• **Type** _extends_ `PureTypeName` + +###### Parameters + +• **type**: `Type` + +• **value**: `Iterable`\<`ShapeFromPureTypeName`\<`Type`\>, `any`, `any`\> & `object` + +###### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +###### option() + +###### Type Parameters + +• **Type** _extends_ `PureTypeName` + +###### Parameters + +• **type**: `Type` + +• **value**: `undefined` \| `null` \| `ShapeFromPureTypeName`\<`Type`\> + +###### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +--- + +### gas + +#### Get Signature + +> **get** **gas**(): `object` + +Returns an argument for the gas coin, to be used in a transaction. + +##### Returns + +`object` + +###### $kind + +> **$kind**: `"GasCoin"` + +###### GasCoin + +> **GasCoin**: `true` + +## Methods + +### fromKind() + +> `static` **fromKind**(`serialized`): [`Transaction`](Transaction.md) + +Converts from a serialize transaction kind (built with `build({ onlyTransactionKind: true })`) to a `Transaction` class. +Supports either a byte array, or base64-encoded bytes. + +#### Parameters + +• **serialized**: `string` \| `Uint8Array` + +#### Returns + +[`Transaction`](Transaction.md) + +--- + +### from() + +> `static` **from**(`transaction`): [`Transaction`](Transaction.md) + +Converts from a serialized transaction format to a `Transaction` class. +There are two supported serialized formats: + +- A string returned from `Transaction#serialize`. The serialized format must be compatible, or it will throw an error. +- A byte array (or base64-encoded bytes) containing BCS transaction data. + +#### Parameters + +• **transaction**: `string` \| `Uint8Array` \| [`Transaction`](Transaction.md) + +#### Returns + +[`Transaction`](Transaction.md) + +--- + +### registerGlobalSerializationPlugin() + +> `static` **registerGlobalSerializationPlugin**(`step`): `void` + +#### Parameters + +• **step**: [`TransactionPlugin`](../type-aliases/TransactionPlugin.md) + +#### Returns + +`void` + +--- + +### registerGlobalBuildPlugin() + +> `static` **registerGlobalBuildPlugin**(`step`): `void` + +#### Parameters + +• **step**: [`TransactionPlugin`](../type-aliases/TransactionPlugin.md) + +#### Returns + +`void` + +--- + +### addSerializationPlugin() + +> **addSerializationPlugin**(`step`): `void` + +#### Parameters + +• **step**: [`TransactionPlugin`](../type-aliases/TransactionPlugin.md) + +#### Returns + +`void` + +--- + +### addBuildPlugin() + +> **addBuildPlugin**(`step`): `void` + +#### Parameters + +• **step**: [`TransactionPlugin`](../type-aliases/TransactionPlugin.md) + +#### Returns + +`void` + +--- + +### addIntentResolver() + +> **addIntentResolver**(`intent`, `resolver`): `void` + +#### Parameters + +• **intent**: `string` + +• **resolver**: [`TransactionPlugin`](../type-aliases/TransactionPlugin.md) + +#### Returns + +`void` + +--- + +### setSender() + +> **setSender**(`sender`): `void` + +#### Parameters + +• **sender**: `string` + +#### Returns + +`void` + +--- + +### setSenderIfNotSet() + +> **setSenderIfNotSet**(`sender`): `void` + +Sets the sender only if it has not already been set. +This is useful for sponsored transaction flows where the sender may not be the same as the signer address. + +#### Parameters + +• **sender**: `string` + +#### Returns + +`void` + +--- + +### setExpiration() + +> **setExpiration**(`expiration`?): `void` + +#### Parameters + +• **expiration?**: `null` \| `EnumInputShape`\<`object`\> + +#### Returns + +`void` + +--- + +### setGasPrice() + +> **setGasPrice**(`price`): `void` + +#### Parameters + +• **price**: `number` \| `bigint` + +#### Returns + +`void` + +--- + +### setGasBudget() + +> **setGasBudget**(`budget`): `void` + +#### Parameters + +• **budget**: `number` \| `bigint` + +#### Returns + +`void` + +--- + +### setGasBudgetIfNotSet() + +> **setGasBudgetIfNotSet**(`budget`): `void` + +#### Parameters + +• **budget**: `number` \| `bigint` + +#### Returns + +`void` + +--- + +### setGasOwner() + +> **setGasOwner**(`owner`): `void` + +#### Parameters + +• **owner**: `string` + +#### Returns + +`void` + +--- + +### setGasPayment() + +> **setGasPayment**(`payments`): `void` + +#### Parameters + +• **payments**: `object`[] + +#### Returns + +`void` + +--- + +### getData() + +> **getData**(): `object` + +Get a snapshot of the transaction data, in JSON form: + +#### Returns + +`object` + +##### version + +> **version**: `2` + +##### sender? + +> `optional` **sender**: `null` \| `string` + +##### expiration? + +> `optional` **expiration**: `null` \| `EnumOutputShapeWithKeys`\<`object`, `"None"` \| `"Epoch"`\> + +##### gasData + +> **gasData**: `object` = `GasData` + +##### gasData.budget + +> **budget**: `null` \| `string` \| `number` + +##### gasData.price + +> **price**: `null` \| `string` \| `number` + +##### gasData.owner + +> **owner**: `null` \| `string` + +##### gasData.payment + +> **payment**: `null` \| `object`[] + +##### inputs + +> **inputs**: `EnumOutputShapeWithKeys`\<`object`, `"Pure"` \| `"Object"` \| `"UnresolvedPure"` \| `"UnresolvedObject"`\>[] + +##### commands + +> **commands**: `EnumOutputShapeWithKeys`\<`object`, `"MoveCall"` \| `"TransferObjects"` \| `"SplitCoins"` \| `"MergeCoins"` \| `"Publish"` \| `"MakeMoveVec"` \| `"Upgrade"` \| `"$Intent"`\>[] + +--- + +### objectRef() + +> **objectRef**(...`args`): `object` + +Add a new object input to the transaction using the fully-resolved object reference. +If you only have an object ID, use `builder.object(id)` instead. + +#### Parameters + +• ...**args**: [`object`] + +#### Returns + +`object` + +##### $kind + +> **$kind**: `"Input"` + +##### Input + +> **Input**: `number` + +##### type? + +> `optional` **type**: `"object"` + +--- + +### receivingRef() + +> **receivingRef**(...`args`): `object` + +Add a new receiving input to the transaction using the fully-resolved object reference. +If you only have an object ID, use `builder.object(id)` instead. + +#### Parameters + +• ...**args**: [`object`] + +#### Returns + +`object` + +##### $kind + +> **$kind**: `"Input"` + +##### Input + +> **Input**: `number` + +##### type? + +> `optional` **type**: `"object"` + +--- + +### sharedObjectRef() + +> **sharedObjectRef**(...`args`): `object` + +Add a new shared object input to the transaction using the fully-resolved shared object reference. +If you only have an object ID, use `builder.object(id)` instead. + +#### Parameters + +• ...**args**: [`object`] + +#### Returns + +`object` + +##### $kind + +> **$kind**: `"Input"` + +##### Input + +> **Input**: `number` + +##### type? + +> `optional` **type**: `"object"` + +--- + +### add() + +> **add**\<`T`\>(`command`): `T` + +Add a transaction to the transaction + +#### Type Parameters + +• **T** = [`TransactionResult`](../type-aliases/TransactionResult.md) + +#### Parameters + +• **command**: [`Command`](../type-aliases/Command.md) \| (`tx`) => `T` + +#### Returns + +`T` + +--- + +### splitCoins() + +> **splitCoins**(`coin`, `amounts`): [`TransactionResult`](../type-aliases/TransactionResult.md) + +#### Parameters + +• **coin**: `string` \| [`TransactionObjectArgument`](../type-aliases/TransactionObjectArgument.md) + +• **amounts**: (`string` \| `number` \| `bigint` \| `SerializedBcs`\<`any`, `any`\> \| [`TransactionArgument`](../type-aliases/TransactionArgument.md))[] + +#### Returns + +[`TransactionResult`](../type-aliases/TransactionResult.md) + +--- + +### mergeCoins() + +> **mergeCoins**(`destination`, `sources`): [`TransactionResult`](../type-aliases/TransactionResult.md) + +#### Parameters + +• **destination**: `string` \| [`TransactionObjectArgument`](../type-aliases/TransactionObjectArgument.md) + +• **sources**: (`string` \| [`TransactionObjectArgument`](../type-aliases/TransactionObjectArgument.md))[] + +#### Returns + +[`TransactionResult`](../type-aliases/TransactionResult.md) + +--- + +### publish() + +> **publish**(`__namedParameters`): [`TransactionResult`](../type-aliases/TransactionResult.md) + +#### Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.modules**: `string`[] \| `number`[][] + +• **\_\_namedParameters.dependencies**: `string`[] + +#### Returns + +[`TransactionResult`](../type-aliases/TransactionResult.md) + +--- + +### upgrade() + +> **upgrade**(`__namedParameters`): [`TransactionResult`](../type-aliases/TransactionResult.md) + +#### Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.modules**: `string`[] \| `number`[][] + +• **\_\_namedParameters.dependencies**: `string`[] + +• **\_\_namedParameters.package**: `string` + +• **\_\_namedParameters.ticket**: `string` \| [`TransactionObjectArgument`](../type-aliases/TransactionObjectArgument.md) + +#### Returns + +[`TransactionResult`](../type-aliases/TransactionResult.md) + +--- + +### moveCall() + +> **moveCall**(`__namedParameters`): [`TransactionResult`](../type-aliases/TransactionResult.md) + +#### Parameters + +• **\_\_namedParameters**: `object` \| `object` + +#### Returns + +[`TransactionResult`](../type-aliases/TransactionResult.md) + +--- + +### transferObjects() + +> **transferObjects**(`objects`, `address`): [`TransactionResult`](../type-aliases/TransactionResult.md) + +#### Parameters + +• **objects**: (`string` \| [`TransactionObjectArgument`](../type-aliases/TransactionObjectArgument.md))[] + +• **address**: `string` \| `SerializedBcs`\<`any`, `any`\> \| [`TransactionArgument`](../type-aliases/TransactionArgument.md) + +#### Returns + +[`TransactionResult`](../type-aliases/TransactionResult.md) + +--- + +### makeMoveVec() + +> **makeMoveVec**(`__namedParameters`): [`TransactionResult`](../type-aliases/TransactionResult.md) + +#### Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.elements**: (`string` \| [`TransactionObjectArgument`](../type-aliases/TransactionObjectArgument.md))[] + +• **\_\_namedParameters.type?**: `string` + +#### Returns + +[`TransactionResult`](../type-aliases/TransactionResult.md) + +--- + +### ~~serialize()~~ + +> **serialize**(): `string` + +#### Returns + +`string` + +#### Deprecated + +Use toJSON instead. +For synchronous serialization, you can use `getData()` + +--- + +### toJSON() + +> **toJSON**(`options`): `Promise`\<`string`\> + +#### Parameters + +• **options**: [`SerializeTransactionOptions`](../interfaces/SerializeTransactionOptions.md) = `{}` + +#### Returns + +`Promise`\<`string`\> + +--- + +### sign() + +> **sign**(`options`): `Promise`\<[`SignatureWithBytes`](../../cryptography/interfaces/SignatureWithBytes.md)\> + +Build the transaction to BCS bytes, and sign it with the provided keypair. + +#### Parameters + +• **options**: `SignOptions` + +#### Returns + +`Promise`\<[`SignatureWithBytes`](../../cryptography/interfaces/SignatureWithBytes.md)\> + +--- + +### build() + +> **build**(`options`): `Promise`\<`Uint8Array`\> + +Build the transaction to BCS bytes. + +#### Parameters + +• **options**: [`BuildTransactionOptions`](../interfaces/BuildTransactionOptions.md) = `{}` + +#### Returns + +`Promise`\<`Uint8Array`\> + +--- + +### getDigest() + +> **getDigest**(`options`): `Promise`\<`string`\> + +Derive transaction digest + +#### Parameters + +• **options** = `{}` + +• **options.client?**: [`IotaClient`](../../client/classes/IotaClient.md) + +#### Returns + +`Promise`\<`string`\> + +--- + +### prepareForSerialization() + +> **prepareForSerialization**(`options`): `Promise`\<`void`\> + +#### Parameters + +• **options**: [`SerializeTransactionOptions`](../interfaces/SerializeTransactionOptions.md) + +#### Returns + +`Promise`\<`void`\> diff --git a/docs/content/ts-sdk/api/transactions/classes/TransactionDataBuilder.md b/docs/content/ts-sdk/api/transactions/classes/TransactionDataBuilder.md new file mode 100644 index 00000000000..69f97d0aa15 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/classes/TransactionDataBuilder.md @@ -0,0 +1,391 @@ +# Class: TransactionDataBuilder + +## Implements + +- [`TransactionData`](../type-aliases/TransactionData.md) + +## Constructors + +### new TransactionDataBuilder() + +> **new TransactionDataBuilder**(`clone`?): [`TransactionDataBuilder`](TransactionDataBuilder.md) + +#### Parameters + +• **clone?** + +• **clone.version?**: `2` = `...` + +• **clone.sender?**: `null` \| `string` = `...` + +• **clone.expiration?**: `null` \| `EnumOutputShapeWithKeys`\<`object`, `"None"` \| `"Epoch"`\> = `...` + +• **clone.gasData?** = `GasData` + +• **clone.gasData.budget?**: `null` \| `string` \| `number` = `...` + +• **clone.gasData.price?**: `null` \| `string` \| `number` = `...` + +• **clone.gasData.owner?**: `null` \| `string` = `...` + +• **clone.gasData.payment?**: `null` \| `object`[] = `...` + +• **clone.inputs?**: `EnumOutputShapeWithKeys`\<`object`, `"Pure"` \| `"Object"` \| `"UnresolvedPure"` \| `"UnresolvedObject"`\>[] = `...` + +• **clone.commands?**: `EnumOutputShapeWithKeys`\<`object`, `"MoveCall"` \| `"TransferObjects"` \| `"SplitCoins"` \| `"MergeCoins"` \| `"Publish"` \| `"MakeMoveVec"` \| `"Upgrade"` \| `"$Intent"`\>[] = `...` + +#### Returns + +[`TransactionDataBuilder`](TransactionDataBuilder.md) + +## Properties + +### version + +> **version**: `2` + +#### Implementation of + +`TransactionData.version` + +--- + +### sender + +> **sender**: `null` \| `string` + +#### Implementation of + +`TransactionData.sender` + +--- + +### expiration + +> **expiration**: `null` \| `EnumOutputShapeWithKeys`\<`object`, `"None"` \| `"Epoch"`\> + +#### Implementation of + +`TransactionData.expiration` + +--- + +### gasData + +> **gasData**: `object` + +#### budget + +> **budget**: `null` \| `string` \| `number` + +#### price + +> **price**: `null` \| `string` \| `number` + +#### owner + +> **owner**: `null` \| `string` + +#### payment + +> **payment**: `null` \| `object`[] + +#### Implementation of + +`TransactionData.gasData` + +--- + +### inputs + +> **inputs**: `EnumOutputShapeWithKeys`\<`object`, `"Pure"` \| `"Object"` \| `"UnresolvedPure"` \| `"UnresolvedObject"`\>[] + +#### Implementation of + +`TransactionData.inputs` + +--- + +### commands + +> **commands**: [`Command`](../type-aliases/Command.md)[] + +#### Implementation of + +`TransactionData.commands` + +## Accessors + +### gasConfig + +#### Get Signature + +> **get** **gasConfig**(): `object` + +##### Returns + +`object` + +###### budget + +> **budget**: `null` \| `string` \| `number` + +###### price + +> **price**: `null` \| `string` \| `number` + +###### owner + +> **owner**: `null` \| `string` + +###### payment + +> **payment**: `null` \| `object`[] + +#### Set Signature + +> **set** **gasConfig**(`value`): `void` + +##### Parameters + +• **value** + +• **value.budget**: `null` \| `string` \| `number` = `...` + +• **value.price**: `null` \| `string` \| `number` = `...` + +• **value.owner**: `null` \| `string` = `...` + +• **value.payment**: `null` \| `object`[] = `...` + +##### Returns + +`void` + +## Methods + +### fromKindBytes() + +> `static` **fromKindBytes**(`bytes`): [`TransactionDataBuilder`](TransactionDataBuilder.md) + +#### Parameters + +• **bytes**: `Uint8Array` + +#### Returns + +[`TransactionDataBuilder`](TransactionDataBuilder.md) + +--- + +### fromBytes() + +> `static` **fromBytes**(`bytes`): [`TransactionDataBuilder`](TransactionDataBuilder.md) + +#### Parameters + +• **bytes**: `Uint8Array` + +#### Returns + +[`TransactionDataBuilder`](TransactionDataBuilder.md) + +--- + +### restore() + +> `static` **restore**(`data`): [`TransactionDataBuilder`](TransactionDataBuilder.md) + +#### Parameters + +• **data**: `object` \| `object` + +#### Returns + +[`TransactionDataBuilder`](TransactionDataBuilder.md) + +--- + +### getDigestFromBytes() + +> `static` **getDigestFromBytes**(`bytes`): `string` + +Generate transaction digest. + +#### Parameters + +• **bytes**: `Uint8Array` + +BCS serialized transaction data + +#### Returns + +`string` + +transaction digest. + +--- + +### build() + +> **build**(`__namedParameters`): `Uint8Array` + +#### Parameters + +• **\_\_namedParameters** = `{}` + +• **\_\_namedParameters.maxSizeBytes?**: `number` = `Infinity` + +• **\_\_namedParameters.overrides?** + +• **\_\_namedParameters.overrides.expiration?**: `EnumOutputShapeWithKeys`\<`object`, `"None"` \| `"Epoch"`\> + +• **\_\_namedParameters.overrides.sender?**: `string` + +• **\_\_namedParameters.overrides.gasConfig?**: `Partial`\<`object`\> + +• **\_\_namedParameters.overrides.gasData?**: `Partial`\<`object`\> + +• **\_\_namedParameters.onlyTransactionKind?**: `boolean` + +#### Returns + +`Uint8Array` + +--- + +### addInput() + +> **addInput**\<`T`\>(`type`, `arg`): `object` + +#### Type Parameters + +• **T** _extends_ `"object"` \| `"pure"` + +#### Parameters + +• **type**: `T` + +• **arg**: `EnumOutputShapeWithKeys`\<`object`, `"Pure"` \| `"Object"` \| `"UnresolvedPure"` \| `"UnresolvedObject"`\> + +#### Returns + +`object` + +##### Input + +> **Input**: `number` = `index` + +##### type + +> **type**: `T` + +##### $kind + +> **$kind**: `"Input"` + +--- + +### getInputUses() + +> **getInputUses**(`index`, `fn`): `void` + +#### Parameters + +• **index**: `number` + +• **fn** + +#### Returns + +`void` + +--- + +### mapArguments() + +> **mapArguments**(`fn`): `void` + +#### Parameters + +• **fn** + +#### Returns + +`void` + +--- + +### replaceCommand() + +> **replaceCommand**(`index`, `replacement`): `void` + +#### Parameters + +• **index**: `number` + +• **replacement**: [`Command`](../type-aliases/Command.md) \| [`Command`](../type-aliases/Command.md)[] + +#### Returns + +`void` + +--- + +### getDigest() + +> **getDigest**(): `string` + +#### Returns + +`string` + +--- + +### snapshot() + +> **snapshot**(): `object` + +#### Returns + +`object` + +##### version + +> **version**: `2` + +##### sender? + +> `optional` **sender**: `null` \| `string` + +##### expiration? + +> `optional` **expiration**: `null` \| `EnumOutputShapeWithKeys`\<`object`, `"None"` \| `"Epoch"`\> + +##### gasData + +> **gasData**: `object` = `GasData` + +##### gasData.budget + +> **budget**: `null` \| `string` \| `number` + +##### gasData.price + +> **price**: `null` \| `string` \| `number` + +##### gasData.owner + +> **owner**: `null` \| `string` + +##### gasData.payment + +> **payment**: `null` \| `object`[] + +##### inputs + +> **inputs**: `EnumOutputShapeWithKeys`\<`object`, `"Pure"` \| `"Object"` \| `"UnresolvedPure"` \| `"UnresolvedObject"`\>[] + +##### commands + +> **commands**: `EnumOutputShapeWithKeys`\<`object`, `"MoveCall"` \| `"TransferObjects"` \| `"SplitCoins"` \| `"MergeCoins"` \| `"Publish"` \| `"MakeMoveVec"` \| `"Upgrade"` \| `"$Intent"`\>[] diff --git a/docs/content/ts-sdk/api/transactions/enumerations/UpgradePolicy.md b/docs/content/ts-sdk/api/transactions/enumerations/UpgradePolicy.md new file mode 100644 index 00000000000..0c256285a35 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/enumerations/UpgradePolicy.md @@ -0,0 +1,19 @@ +# Enumeration: UpgradePolicy + +## Enumeration Members + +### COMPATIBLE + +> **COMPATIBLE**: `0` + +--- + +### ADDITIVE + +> **ADDITIVE**: `128` + +--- + +### DEP\_ONLY + +> **DEP\_ONLY**: `192` diff --git a/docs/content/ts-sdk/api/transactions/functions/coinWithBalance.md b/docs/content/ts-sdk/api/transactions/functions/coinWithBalance.md new file mode 100644 index 00000000000..432850432b2 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/functions/coinWithBalance.md @@ -0,0 +1,25 @@ +# Function: coinWithBalance() + +> **coinWithBalance**(`__namedParameters`): (`tx`) => [`TransactionResult`](../type-aliases/TransactionResult.md) + +## Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.balance**: `number` \| `bigint` + +• **\_\_namedParameters.type?**: `string` = `IOTA_TYPE` + +• **\_\_namedParameters.useGasCoin?**: `boolean` = `true` + +## Returns + +`Function` + +### Parameters + +• **tx**: [`Transaction`](../classes/Transaction.md) + +### Returns + +[`TransactionResult`](../type-aliases/TransactionResult.md) diff --git a/docs/content/ts-sdk/api/transactions/functions/getPureBcsSchema.md b/docs/content/ts-sdk/api/transactions/functions/getPureBcsSchema.md new file mode 100644 index 00000000000..765629b98b5 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/functions/getPureBcsSchema.md @@ -0,0 +1,11 @@ +# Function: getPureBcsSchema() + +> **getPureBcsSchema**(`typeSignature`): [`BcsType`](../../bcs/classes/BcsType.md)\<`any`\> \| `null` + +## Parameters + +• **typeSignature**: [`OpenMoveTypeSignatureBody`](../type-aliases/OpenMoveTypeSignatureBody.md) + +## Returns + +[`BcsType`](../../bcs/classes/BcsType.md)\<`any`\> \| `null` diff --git a/docs/content/ts-sdk/api/transactions/functions/isTransaction.md b/docs/content/ts-sdk/api/transactions/functions/isTransaction.md new file mode 100644 index 00000000000..18208ac88c9 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/functions/isTransaction.md @@ -0,0 +1,11 @@ +# Function: isTransaction() + +> **isTransaction**(`obj`): `obj is Transaction` + +## Parameters + +• **obj**: `unknown` + +## Returns + +`obj is Transaction` diff --git a/docs/content/ts-sdk/api/transactions/functions/normalizedTypeToMoveTypeSignature.md b/docs/content/ts-sdk/api/transactions/functions/normalizedTypeToMoveTypeSignature.md new file mode 100644 index 00000000000..bafdc45d357 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/functions/normalizedTypeToMoveTypeSignature.md @@ -0,0 +1,11 @@ +# Function: normalizedTypeToMoveTypeSignature() + +> **normalizedTypeToMoveTypeSignature**(`type`): [`OpenMoveTypeSignature`](../type-aliases/OpenMoveTypeSignature.md) + +## Parameters + +• **type**: [`IotaMoveNormalizedType`](../../client/type-aliases/IotaMoveNormalizedType.md) + +## Returns + +[`OpenMoveTypeSignature`](../type-aliases/OpenMoveTypeSignature.md) diff --git a/docs/content/ts-sdk/api/transactions/index.md b/docs/content/ts-sdk/api/transactions/index.md new file mode 100644 index 00000000000..c2e79210d77 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/index.md @@ -0,0 +1,63 @@ +# transactions + +## Index + +### Enumerations + +- [UpgradePolicy](enumerations/UpgradePolicy.md) + +### Classes + +- [AsyncCache](classes/AsyncCache.md) +- [ObjectCache](classes/ObjectCache.md) +- [Transaction](classes/Transaction.md) +- [TransactionDataBuilder](classes/TransactionDataBuilder.md) +- [ParallelTransactionExecutor](classes/ParallelTransactionExecutor.md) +- [SerialTransactionExecutor](classes/SerialTransactionExecutor.md) + +### Interfaces + +- [ParallelTransactionExecutorOptions](interfaces/ParallelTransactionExecutorOptions.md) +- [BuildTransactionOptions](interfaces/BuildTransactionOptions.md) +- [SerializeTransactionOptions](interfaces/SerializeTransactionOptions.md) + +### Type Aliases + +- [TransactionArgument](type-aliases/TransactionArgument.md) +- [TransactionInput](type-aliases/TransactionInput.md) +- [TransactionObjectArgument](type-aliases/TransactionObjectArgument.md) +- [TransactionResult](type-aliases/TransactionResult.md) +- [TransactionObjectInput](type-aliases/TransactionObjectInput.md) +- [ObjectRef](type-aliases/ObjectRef.md) +- [Argument](type-aliases/Argument.md) +- [GasData](type-aliases/GasData.md) +- [OpenMoveTypeSignatureBody](type-aliases/OpenMoveTypeSignatureBody.md) +- [OpenMoveTypeSignature](type-aliases/OpenMoveTypeSignature.md) +- [Command](type-aliases/Command.md) +- [CallArg](type-aliases/CallArg.md) +- [TransactionData](type-aliases/TransactionData.md) +- [SerializedTransactionDataV1](type-aliases/SerializedTransactionDataV1.md) +- [SerializedTransactionDataV2](type-aliases/SerializedTransactionDataV2.md) +- [TransactionPlugin](type-aliases/TransactionPlugin.md) + +### Variables + +- [Arguments](variables/Arguments.md) +- [Commands](variables/Commands.md) +- [Inputs](variables/Inputs.md) +- [ObjectRef](variables/ObjectRef.md) +- [Argument](variables/Argument.md) +- [GasData](variables/GasData.md) +- [OpenMoveTypeSignatureBody](variables/OpenMoveTypeSignatureBody.md) +- [OpenMoveTypeSignature](variables/OpenMoveTypeSignature.md) +- [Command](variables/Command.md) +- [TransactionData](variables/TransactionData.md) +- [SerializedTransactionDataV1](variables/SerializedTransactionDataV1.md) +- [SerializedTransactionDataV2](variables/SerializedTransactionDataV2.md) + +### Functions + +- [isTransaction](functions/isTransaction.md) +- [coinWithBalance](functions/coinWithBalance.md) +- [getPureBcsSchema](functions/getPureBcsSchema.md) +- [normalizedTypeToMoveTypeSignature](functions/normalizedTypeToMoveTypeSignature.md) diff --git a/docs/content/ts-sdk/api/transactions/interfaces/BuildTransactionOptions.md b/docs/content/ts-sdk/api/transactions/interfaces/BuildTransactionOptions.md new file mode 100644 index 00000000000..b3595d8c682 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/interfaces/BuildTransactionOptions.md @@ -0,0 +1,17 @@ +# Interface: BuildTransactionOptions + +## Extended by + +- [`SerializeTransactionOptions`](SerializeTransactionOptions.md) + +## Properties + +### client? + +> `optional` **client**: [`IotaClient`](../../client/classes/IotaClient.md) + +--- + +### onlyTransactionKind? + +> `optional` **onlyTransactionKind**: `boolean` diff --git a/docs/content/ts-sdk/api/transactions/interfaces/ParallelTransactionExecutorOptions.md b/docs/content/ts-sdk/api/transactions/interfaces/ParallelTransactionExecutorOptions.md new file mode 100644 index 00000000000..a2a896fcdf1 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/interfaces/ParallelTransactionExecutorOptions.md @@ -0,0 +1,85 @@ +# Interface: ParallelTransactionExecutorOptions + +## Extends + +- `Omit`\<`ObjectCacheOptions`, `"address"`\> + +## Properties + +### cache? + +> `optional` **cache**: [`AsyncCache`](../classes/AsyncCache.md) + +#### Inherited from + +`Omit.cache` + +--- + +### client + +> **client**: [`IotaClient`](../../client/classes/IotaClient.md) + +--- + +### signer + +> **signer**: [`Signer`](../../cryptography/classes/Signer.md) + +--- + +### coinBatchSize? + +> `optional` **coinBatchSize**: `number` + +The number of coins to create in a batch when refilling the gas pool + +--- + +### initialCoinBalance? + +> `optional` **initialCoinBalance**: `bigint` + +The initial balance of each coin created for the gas pool + +--- + +### minimumCoinBalance? + +> `optional` **minimumCoinBalance**: `bigint` + +The minimum balance of a coin that can be reused for future transactions. If the gasCoin is below this value, it will be used when refilling the gasPool + +--- + +### defaultGasBudget? + +> `optional` **defaultGasBudget**: `bigint` + +The gasBudget to use if the transaction has not defined it's own gasBudget, defaults to `minimumCoinBalance` + +--- + +### epochBoundaryWindow? + +> `optional` **epochBoundaryWindow**: `number` + +Time to wait before/after the expected epoch boundary before re-fetching the gas pool (in milliseconds). +Building transactions will be paused for up to 2x this duration around each epoch boundary to ensure the +gas price is up-to-date for the next epoch. + +--- + +### maxPoolSize? + +> `optional` **maxPoolSize**: `number` + +The maximum number of transactions that can be execute in parallel, this also determines the maximum number of gas coins that will be created + +--- + +### sourceCoins? + +> `optional` **sourceCoins**: `string`[] + +An initial list of coins used to fund the gas pool, uses all owned IOTA coins by default diff --git a/docs/content/ts-sdk/api/transactions/interfaces/SerializeTransactionOptions.md b/docs/content/ts-sdk/api/transactions/interfaces/SerializeTransactionOptions.md new file mode 100644 index 00000000000..f49846b7d96 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/interfaces/SerializeTransactionOptions.md @@ -0,0 +1,31 @@ +# Interface: SerializeTransactionOptions + +## Extends + +- [`BuildTransactionOptions`](BuildTransactionOptions.md) + +## Properties + +### client? + +> `optional` **client**: [`IotaClient`](../../client/classes/IotaClient.md) + +#### Inherited from + +[`BuildTransactionOptions`](BuildTransactionOptions.md).[`client`](BuildTransactionOptions.md#client) + +--- + +### onlyTransactionKind? + +> `optional` **onlyTransactionKind**: `boolean` + +#### Inherited from + +[`BuildTransactionOptions`](BuildTransactionOptions.md).[`onlyTransactionKind`](BuildTransactionOptions.md#onlytransactionkind) + +--- + +### supportedIntents? + +> `optional` **supportedIntents**: `string`[] diff --git a/docs/content/ts-sdk/api/transactions/type-aliases/Argument.md b/docs/content/ts-sdk/api/transactions/type-aliases/Argument.md new file mode 100644 index 00000000000..c85eb152efd --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/type-aliases/Argument.md @@ -0,0 +1,3 @@ +# Type Alias: Argument + +> **Argument**: `InferOutput`\<_typeof_ [`Argument`](../variables/Argument.md)\> diff --git a/docs/content/ts-sdk/api/transactions/type-aliases/CallArg.md b/docs/content/ts-sdk/api/transactions/type-aliases/CallArg.md new file mode 100644 index 00000000000..4465aae5475 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/type-aliases/CallArg.md @@ -0,0 +1,3 @@ +# Type Alias: CallArg + +> **CallArg**: `InferOutput`\<_typeof_ `CallArg`\> diff --git a/docs/content/ts-sdk/api/transactions/type-aliases/Command.md b/docs/content/ts-sdk/api/transactions/type-aliases/Command.md new file mode 100644 index 00000000000..852dc1f4d1c --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/type-aliases/Command.md @@ -0,0 +1,133 @@ +# Type Alias: Command\<Arg\> + +> **Command**\<`Arg`\>: `EnumOutputShape`\<`object`\> + +## Type declaration + +### MoveCall + +> **MoveCall**: `object` + +### MoveCall.package + +> **package**: `string` + +### MoveCall.module + +> **module**: `string` + +### MoveCall.function + +> **function**: `string` + +### MoveCall.typeArguments + +> **typeArguments**: `string`[] + +### MoveCall.arguments + +> **arguments**: `Arg`[] + +### MoveCall.\_argumentTypes? + +> `optional` **\_argumentTypes**: [`OpenMoveTypeSignature`](OpenMoveTypeSignature.md)[] \| `null` + +### TransferObjects + +> **TransferObjects**: `object` + +### TransferObjects.objects + +> **objects**: `Arg`[] + +### TransferObjects.address + +> **address**: `Arg` + +### SplitCoins + +> **SplitCoins**: `object` + +### SplitCoins.coin + +> **coin**: `Arg` + +### SplitCoins.amounts + +> **amounts**: `Arg`[] + +### MergeCoins + +> **MergeCoins**: `object` + +### MergeCoins.destination + +> **destination**: `Arg` + +### MergeCoins.sources + +> **sources**: `Arg`[] + +### Publish + +> **Publish**: `object` + +### Publish.modules + +> **modules**: `string`[] + +### Publish.dependencies + +> **dependencies**: `string`[] + +### MakeMoveVec + +> **MakeMoveVec**: `object` + +### MakeMoveVec.type + +> **type**: `string` \| `null` + +### MakeMoveVec.elements + +> **elements**: `Arg`[] + +### Upgrade + +> **Upgrade**: `object` + +### Upgrade.modules + +> **modules**: `string`[] + +### Upgrade.dependencies + +> **dependencies**: `string`[] + +### Upgrade.package + +> **package**: `string` + +### Upgrade.ticket + +> **ticket**: `Arg` + +### $Intent + +> **$Intent**: `object` + +### $Intent.name + +> **name**: `string` + +### $Intent.inputs + +> **inputs**: `Record`\<`string`, [`Argument`](Argument.md) \| [`Argument`](Argument.md)[]\> + +### $Intent.data + +> **data**: `Record`\<`string`, `unknown`\> + +## Type Parameters + +• **Arg** = [`Argument`](Argument.md) diff --git a/docs/content/ts-sdk/api/transactions/type-aliases/GasData.md b/docs/content/ts-sdk/api/transactions/type-aliases/GasData.md new file mode 100644 index 00000000000..b6305390618 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/type-aliases/GasData.md @@ -0,0 +1,3 @@ +# Type Alias: GasData + +> **GasData**: `InferOutput`\<_typeof_ [`GasData`](../variables/GasData.md)\> diff --git a/docs/content/ts-sdk/api/transactions/type-aliases/ObjectRef.md b/docs/content/ts-sdk/api/transactions/type-aliases/ObjectRef.md new file mode 100644 index 00000000000..8d46548255d --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/type-aliases/ObjectRef.md @@ -0,0 +1,3 @@ +# Type Alias: ObjectRef + +> **ObjectRef**: `InferOutput`\<_typeof_ [`ObjectRef`](../variables/ObjectRef.md)\> diff --git a/docs/content/ts-sdk/api/transactions/type-aliases/OpenMoveTypeSignature.md b/docs/content/ts-sdk/api/transactions/type-aliases/OpenMoveTypeSignature.md new file mode 100644 index 00000000000..3b7474bf7bc --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/type-aliases/OpenMoveTypeSignature.md @@ -0,0 +1,3 @@ +# Type Alias: OpenMoveTypeSignature + +> **OpenMoveTypeSignature**: `InferOutput`\<_typeof_ [`OpenMoveTypeSignature`](../variables/OpenMoveTypeSignature.md)\> diff --git a/docs/content/ts-sdk/api/transactions/type-aliases/OpenMoveTypeSignatureBody.md b/docs/content/ts-sdk/api/transactions/type-aliases/OpenMoveTypeSignatureBody.md new file mode 100644 index 00000000000..8f8ce94cace --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/type-aliases/OpenMoveTypeSignatureBody.md @@ -0,0 +1,3 @@ +# Type Alias: OpenMoveTypeSignatureBody + +> **OpenMoveTypeSignatureBody**: `"address"` \| `"bool"` \| `"u8"` \| `"u16"` \| `"u32"` \| `"u64"` \| `"u128"` \| `"u256"` \| `object` \| `object` \| `object` diff --git a/docs/content/ts-sdk/api/transactions/type-aliases/SerializedTransactionDataV1.md b/docs/content/ts-sdk/api/transactions/type-aliases/SerializedTransactionDataV1.md new file mode 100644 index 00000000000..19084da2839 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/type-aliases/SerializedTransactionDataV1.md @@ -0,0 +1,3 @@ +# Type Alias: SerializedTransactionDataV1 + +> **SerializedTransactionDataV1**: `InferOutput`\<_typeof_ [`SerializedTransactionDataV1`](../variables/SerializedTransactionDataV1.md)\> diff --git a/docs/content/ts-sdk/api/transactions/type-aliases/SerializedTransactionDataV2.md b/docs/content/ts-sdk/api/transactions/type-aliases/SerializedTransactionDataV2.md new file mode 100644 index 00000000000..38f7ed0e41e --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/type-aliases/SerializedTransactionDataV2.md @@ -0,0 +1,3 @@ +# Type Alias: SerializedTransactionDataV2 + +> **SerializedTransactionDataV2**: `InferOutput`\<_typeof_ [`SerializedTransactionDataV2`](../variables/SerializedTransactionDataV2.md)\> diff --git a/docs/content/ts-sdk/api/transactions/type-aliases/TransactionArgument.md b/docs/content/ts-sdk/api/transactions/type-aliases/TransactionArgument.md new file mode 100644 index 00000000000..836b8760ba0 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/type-aliases/TransactionArgument.md @@ -0,0 +1,3 @@ +# Type Alias: TransactionArgument + +> **TransactionArgument**: `InferInput`\<_typeof_ [`Argument`](../variables/Argument.md)\> \| (`tx`) => `InferInput`\<_typeof_ [`Argument`](../variables/Argument.md)\> diff --git a/docs/content/ts-sdk/api/transactions/type-aliases/TransactionData.md b/docs/content/ts-sdk/api/transactions/type-aliases/TransactionData.md new file mode 100644 index 00000000000..fd3405985e4 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/type-aliases/TransactionData.md @@ -0,0 +1,3 @@ +# Type Alias: TransactionData + +> **TransactionData**: `InferOutput`\<_typeof_ [`TransactionData`](../variables/TransactionData.md)\> diff --git a/docs/content/ts-sdk/api/transactions/type-aliases/TransactionInput.md b/docs/content/ts-sdk/api/transactions/type-aliases/TransactionInput.md new file mode 100644 index 00000000000..229d8a89ec7 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/type-aliases/TransactionInput.md @@ -0,0 +1,3 @@ +# Type Alias: TransactionInput + +> **TransactionInput**: [`CallArg`](CallArg.md) diff --git a/docs/content/ts-sdk/api/transactions/type-aliases/TransactionObjectArgument.md b/docs/content/ts-sdk/api/transactions/type-aliases/TransactionObjectArgument.md new file mode 100644 index 00000000000..de01e6e364e --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/type-aliases/TransactionObjectArgument.md @@ -0,0 +1,3 @@ +# Type Alias: TransactionObjectArgument + +> **TransactionObjectArgument**: `Exclude`\<`InferInput`\<_typeof_ [`Argument`](../variables/Argument.md)\>, `object`\> \| (`tx`) => `Exclude`\<`InferInput`\<_typeof_ [`Argument`](../variables/Argument.md)\>, `object`\> diff --git a/docs/content/ts-sdk/api/transactions/type-aliases/TransactionObjectInput.md b/docs/content/ts-sdk/api/transactions/type-aliases/TransactionObjectInput.md new file mode 100644 index 00000000000..52bf593828f --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/type-aliases/TransactionObjectInput.md @@ -0,0 +1,3 @@ +# Type Alias: TransactionObjectInput + +> **TransactionObjectInput**: `string` \| [`CallArg`](CallArg.md) \| [`TransactionObjectArgument`](TransactionObjectArgument.md) diff --git a/docs/content/ts-sdk/api/transactions/type-aliases/TransactionPlugin.md b/docs/content/ts-sdk/api/transactions/type-aliases/TransactionPlugin.md new file mode 100644 index 00000000000..f1d2c692900 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/type-aliases/TransactionPlugin.md @@ -0,0 +1,15 @@ +# Type Alias: TransactionPlugin() + +> **TransactionPlugin**: (`transactionData`, `options`, `next`) => `Promise`\<`void`\> + +## Parameters + +• **transactionData**: [`TransactionDataBuilder`](../classes/TransactionDataBuilder.md) + +• **options**: [`BuildTransactionOptions`](../interfaces/BuildTransactionOptions.md) + +• **next** + +## Returns + +`Promise`\<`void`\> diff --git a/docs/content/ts-sdk/api/transactions/type-aliases/TransactionResult.md b/docs/content/ts-sdk/api/transactions/type-aliases/TransactionResult.md new file mode 100644 index 00000000000..15823fd9a1d --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/type-aliases/TransactionResult.md @@ -0,0 +1,3 @@ +# Type Alias: TransactionResult + +> **TransactionResult**: `Extract`\<[`Argument`](Argument.md), `object`\> & `Extract`\<[`Argument`](Argument.md), `object`\>[] diff --git a/docs/content/ts-sdk/api/transactions/variables/Argument.md b/docs/content/ts-sdk/api/transactions/variables/Argument.md new file mode 100644 index 00000000000..3a4f8696679 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/variables/Argument.md @@ -0,0 +1,3 @@ +# Variable: Argument + +> `const` **Argument**: `GenericSchema`\<`object` \| `object` \| `object` \| `object`, `object` \| `object` \| `object` \| `object` \| `object`, `BaseIssue`\<`unknown`\>\> diff --git a/docs/content/ts-sdk/api/transactions/variables/Arguments.md b/docs/content/ts-sdk/api/transactions/variables/Arguments.md new file mode 100644 index 00000000000..b9757be7565 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/variables/Arguments.md @@ -0,0 +1,496 @@ +# Variable: Arguments + +> `const` **Arguments**: `object` + +## Type declaration + +### pure() + +> **pure**: \<`T`\>(`type`, `value`) => `T`(`value`) => `T` + +#### Type Parameters + +• **T** _extends_ `PureTypeName` + +#### Parameters + +• **type**: `T` _extends_ `PureTypeName` ? `ValidPureTypeName`\<`T`\<`T`\>\> : `T` + +• **value**: `ShapeFromPureTypeName`\<`T`\> + +#### Returns + +`T` + +#### Parameters + +• **value**: `Uint8Array` \| `SerializedBcs`\<`any`, `any`\> + +The pure value, serialized to BCS. If this is a Uint8Array, then the value +is assumed to be raw bytes, and will be used directly. + +#### Returns + +`T` + +### pure.u8() + +#### Parameters + +• **value**: `number` + +#### Returns + +`Function` + +##### Parameters + +• **tx**: [`Transaction`](../classes/Transaction.md) + +##### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +### pure.u16() + +#### Parameters + +• **value**: `number` + +#### Returns + +`Function` + +##### Parameters + +• **tx**: [`Transaction`](../classes/Transaction.md) + +##### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +### pure.u32() + +#### Parameters + +• **value**: `number` + +#### Returns + +`Function` + +##### Parameters + +• **tx**: [`Transaction`](../classes/Transaction.md) + +##### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +### pure.u64() + +#### Parameters + +• **value**: `string` \| `number` \| `bigint` + +#### Returns + +`Function` + +##### Parameters + +• **tx**: [`Transaction`](../classes/Transaction.md) + +##### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +### pure.u128() + +#### Parameters + +• **value**: `string` \| `number` \| `bigint` + +#### Returns + +`Function` + +##### Parameters + +• **tx**: [`Transaction`](../classes/Transaction.md) + +##### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +### pure.u256() + +#### Parameters + +• **value**: `string` \| `number` \| `bigint` + +#### Returns + +`Function` + +##### Parameters + +• **tx**: [`Transaction`](../classes/Transaction.md) + +##### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +### pure.bool() + +#### Parameters + +• **value**: `boolean` + +#### Returns + +`Function` + +##### Parameters + +• **tx**: [`Transaction`](../classes/Transaction.md) + +##### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +### pure.string() + +#### Parameters + +• **value**: `string` + +#### Returns + +`Function` + +##### Parameters + +• **tx**: [`Transaction`](../classes/Transaction.md) + +##### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +### pure.address() + +#### Parameters + +• **value**: `string` + +#### Returns + +`Function` + +##### Parameters + +• **tx**: [`Transaction`](../classes/Transaction.md) + +##### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +### pure.id() + +> **id**: (`value`) => (`tx`) => `object` \| `object` \| `object` \| `object` \| `object` + +#### Parameters + +• **value**: `string` + +#### Returns + +`Function` + +##### Parameters + +• **tx**: [`Transaction`](../classes/Transaction.md) + +##### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +### pure.vector() + +#### Type Parameters + +• **Type** _extends_ `PureTypeName` + +#### Parameters + +• **type**: `Type` + +• **value**: `Iterable`\<`ShapeFromPureTypeName`\<`Type`\>, `any`, `any`\> & `object` + +#### Returns + +`Function` + +##### Parameters + +• **tx**: [`Transaction`](../classes/Transaction.md) + +##### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +### pure.option() + +#### Type Parameters + +• **Type** _extends_ `PureTypeName` + +#### Parameters + +• **type**: `Type` + +• **value**: `undefined` \| `null` \| `ShapeFromPureTypeName`\<`Type`\> + +#### Returns + +`Function` + +##### Parameters + +• **tx**: [`Transaction`](../classes/Transaction.md) + +##### Returns + +`object` \| `object` \| `object` \| `object` \| `object` + +### object() + +> **object**: (`value`) => (`tx`) => `object` + +#### Parameters + +• **value**: [`TransactionObjectInput`](../type-aliases/TransactionObjectInput.md) + +#### Returns + +`Function` + +##### Parameters + +• **tx**: [`Transaction`](../classes/Transaction.md) + +##### Returns + +`object` + +###### $kind + +> **$kind**: `"Input"` + +###### Input + +> **Input**: `number` + +###### type? + +> `optional` **type**: `"object"` + +### object.system() + +#### Returns + +`Function` + +##### Parameters + +• **tx**: [`Transaction`](../classes/Transaction.md) + +##### Returns + +`object` + +###### $kind + +> **$kind**: `"Input"` + +###### Input + +> **Input**: `number` + +###### type? + +> `optional` **type**: `"object"` + +### object.clock() + +#### Returns + +`Function` + +##### Parameters + +• **tx**: [`Transaction`](../classes/Transaction.md) + +##### Returns + +`object` + +###### $kind + +> **$kind**: `"Input"` + +###### Input + +> **Input**: `number` + +###### type? + +> `optional` **type**: `"object"` + +### object.random() + +#### Returns + +`Function` + +##### Parameters + +• **tx**: [`Transaction`](../classes/Transaction.md) + +##### Returns + +`object` + +###### $kind + +> **$kind**: `"Input"` + +###### Input + +> **Input**: `number` + +###### type? + +> `optional` **type**: `"object"` + +### object.denyList() + +#### Returns + +`Function` + +##### Parameters + +• **tx**: [`Transaction`](../classes/Transaction.md) + +##### Returns + +`object` + +###### $kind + +> **$kind**: `"Input"` + +###### Input + +> **Input**: `number` + +###### type? + +> `optional` **type**: `"object"` + +### sharedObjectRef() + +> **sharedObjectRef**: (...`args`) => (`tx`) => `object` + +#### Parameters + +• ...**args**: [`object`] + +#### Returns + +`Function` + +##### Parameters + +• **tx**: [`Transaction`](../classes/Transaction.md) + +##### Returns + +`object` + +###### $kind + +> **$kind**: `"Input"` + +###### Input + +> **Input**: `number` + +###### type? + +> `optional` **type**: `"object"` + +### objectRef() + +> **objectRef**: (...`args`) => (`tx`) => `object` + +#### Parameters + +• ...**args**: [`object`] + +#### Returns + +`Function` + +##### Parameters + +• **tx**: [`Transaction`](../classes/Transaction.md) + +##### Returns + +`object` + +###### $kind + +> **$kind**: `"Input"` + +###### Input + +> **Input**: `number` + +###### type? + +> `optional` **type**: `"object"` + +### receivingRef() + +> **receivingRef**: (...`args`) => (`tx`) => `object` + +#### Parameters + +• ...**args**: [`object`] + +#### Returns + +`Function` + +##### Parameters + +• **tx**: [`Transaction`](../classes/Transaction.md) + +##### Returns + +`object` + +###### $kind + +> **$kind**: `"Input"` + +###### Input + +> **Input**: `number` + +###### type? + +> `optional` **type**: `"object"` diff --git a/docs/content/ts-sdk/api/transactions/variables/Command.md b/docs/content/ts-sdk/api/transactions/variables/Command.md new file mode 100644 index 00000000000..ae625f52b55 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/variables/Command.md @@ -0,0 +1,145 @@ +# Variable: Command + +> `const` **Command**: `EnumSchema`\<`object`\> + +## Type declaration + +### MoveCall + +> **MoveCall**: `ObjectSchema`\<`object`, `undefined`\> = `ProgrammableMoveCall` + +#### Type declaration + +##### package + +> `readonly` **package**: `SchemaWithPipe`\<[`StringSchema`\<`undefined`\>, `TransformAction`\<`string`, `string`\>, `CheckAction`\<`string`, `undefined`\>]\> = `ObjectID` + +##### module + +> `readonly` **module**: `StringSchema`\<`undefined`\> + +##### function + +> `readonly` **function**: `StringSchema`\<`undefined`\> + +##### typeArguments + +> `readonly` **typeArguments**: `ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\> + +##### arguments + +> `readonly` **arguments**: `ArraySchema`\<`GenericSchema`\<`object` \| `object` \| `object` \| `object`, `object` \| `object` \| `object` \| `object` \| `object`, `BaseIssue`\<`unknown`\>\>, `undefined`\> + +##### \_argumentTypes + +> `readonly` **\_argumentTypes**: `OptionalSchema`\<`NullableSchema`\<`ArraySchema`\<`ObjectSchema`\<`object`, `undefined`\>, `undefined`\>, `never`\>, `never`\> + +### TransferObjects + +> **TransferObjects**: `ObjectSchema`\<`object`, `undefined`\> + +#### Type declaration + +##### objects + +> `readonly` **objects**: `ArraySchema`\<`GenericSchema`\<`object` \| `object` \| `object` \| `object`, `object` \| `object` \| `object` \| `object` \| `object`, `BaseIssue`\<`unknown`\>\>, `undefined`\> + +##### address + +> `readonly` **address**: `GenericSchema`\<`object` \| `object` \| `object` \| `object`, `object` \| `object` \| `object` \| `object` \| `object`, `BaseIssue`\<`unknown`\>\> = `Argument` + +### SplitCoins + +> **SplitCoins**: `ObjectSchema`\<`object`, `undefined`\> + +#### Type declaration + +##### coin + +> `readonly` **coin**: `GenericSchema`\<`object` \| `object` \| `object` \| `object`, `object` \| `object` \| `object` \| `object` \| `object`, `BaseIssue`\<`unknown`\>\> = `Argument` + +##### amounts + +> `readonly` **amounts**: `ArraySchema`\<`GenericSchema`\<`object` \| `object` \| `object` \| `object`, `object` \| `object` \| `object` \| `object` \| `object`, `BaseIssue`\<`unknown`\>\>, `undefined`\> + +### MergeCoins + +> **MergeCoins**: `ObjectSchema`\<`object`, `undefined`\> + +#### Type declaration + +##### destination + +> `readonly` **destination**: `GenericSchema`\<`object` \| `object` \| `object` \| `object`, `object` \| `object` \| `object` \| `object` \| `object`, `BaseIssue`\<`unknown`\>\> = `Argument` + +##### sources + +> `readonly` **sources**: `ArraySchema`\<`GenericSchema`\<`object` \| `object` \| `object` \| `object`, `object` \| `object` \| `object` \| `object` \| `object`, `BaseIssue`\<`unknown`\>\>, `undefined`\> + +### Publish + +> **Publish**: `ObjectSchema`\<`object`, `undefined`\> + +#### Type declaration + +##### modules + +> `readonly` **modules**: `ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\> + +##### dependencies + +> `readonly` **dependencies**: `ArraySchema`\<`SchemaWithPipe`\<[`StringSchema`\<`undefined`\>, `TransformAction`\<`string`, `string`\>, `CheckAction`\<`string`, `undefined`\>]\>, `undefined`\> + +### MakeMoveVec + +> **MakeMoveVec**: `ObjectSchema`\<`object`, `undefined`\> + +#### Type declaration + +##### type + +> `readonly` **type**: `NullableSchema`\<`StringSchema`\<`undefined`\>, `never`\> + +##### elements + +> `readonly` **elements**: `ArraySchema`\<`GenericSchema`\<`object` \| `object` \| `object` \| `object`, `object` \| `object` \| `object` \| `object` \| `object`, `BaseIssue`\<`unknown`\>\>, `undefined`\> + +### Upgrade + +> **Upgrade**: `ObjectSchema`\<`object`, `undefined`\> + +#### Type declaration + +##### modules + +> `readonly` **modules**: `ArraySchema`\<`StringSchema`\<`undefined`\>, `undefined`\> + +##### dependencies + +> `readonly` **dependencies**: `ArraySchema`\<`SchemaWithPipe`\<[`StringSchema`\<`undefined`\>, `TransformAction`\<`string`, `string`\>, `CheckAction`\<`string`, `undefined`\>]\>, `undefined`\> + +##### package + +> `readonly` **package**: `SchemaWithPipe`\<[`StringSchema`\<`undefined`\>, `TransformAction`\<`string`, `string`\>, `CheckAction`\<`string`, `undefined`\>]\> = `ObjectID` + +##### ticket + +> `readonly` **ticket**: `GenericSchema`\<`object` \| `object` \| `object` \| `object`, `object` \| `object` \| `object` \| `object` \| `object`, `BaseIssue`\<`unknown`\>\> = `Argument` + +### $Intent + +> **$Intent**: `ObjectSchema`\<`object`, `undefined`\> + +#### Type declaration + +##### name + +> `readonly` **name**: `StringSchema`\<`undefined`\> + +##### inputs + +> `readonly` **inputs**: `RecordSchema`\<`StringSchema`\<`undefined`\>, `UnionSchema`\<[`GenericSchema`\<`object` \| `object` \| `object` \| `object`, `object` \| `object` \| `object` \| `object` \| `object`, `BaseIssue`\<`unknown`\>\>, `ArraySchema`\<`GenericSchema`\<`object` \| `object` \| `object` \| `object`, `object` \| `object` \| `object` \| `object` \| `object`, `BaseIssue`\<`unknown`\>\>, `undefined`\>], `undefined`\>, `undefined`\> + +##### data + +> `readonly` **data**: `RecordSchema`\<`StringSchema`\<`undefined`\>, `UnknownSchema`, `undefined`\> diff --git a/docs/content/ts-sdk/api/transactions/variables/Commands.md b/docs/content/ts-sdk/api/transactions/variables/Commands.md new file mode 100644 index 00000000000..1e6564413ac --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/variables/Commands.md @@ -0,0 +1,115 @@ +# Variable: Commands + +> `const` **Commands**: `object` + +Simple helpers used to construct transactions: + +## Type declaration + +### MoveCall() + +#### Parameters + +• **input**: `object` \| `object` + +#### Returns + +`TransactionShape`\<`"MoveCall"`\> + +### TransferObjects() + +#### Parameters + +• **objects**: (`object` \| `object` \| `object` \| `object`)[] + +• **address**: `object` \| `object` \| `object` \| `object` + +#### Returns + +`TransactionShape`\<`"TransferObjects"`\> + +### SplitCoins() + +#### Parameters + +• **coin**: `object` \| `object` \| `object` \| `object` + +• **amounts**: (`object` \| `object` \| `object` \| `object`)[] + +#### Returns + +`TransactionShape`\<`"SplitCoins"`\> + +### MergeCoins() + +#### Parameters + +• **destination**: `object` \| `object` \| `object` \| `object` + +• **sources**: (`object` \| `object` \| `object` \| `object`)[] + +#### Returns + +`TransactionShape`\<`"MergeCoins"`\> + +### Publish() + +#### Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.modules**: `string`[] \| `number`[][] + +• **\_\_namedParameters.dependencies**: `string`[] + +#### Returns + +`TransactionShape`\<`"Publish"`\> + +### Upgrade() + +#### Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.modules**: `string`[] \| `number`[][] + +• **\_\_namedParameters.dependencies**: `string`[] + +• **\_\_namedParameters.package**: `string` + +• **\_\_namedParameters.ticket**: `object` \| `object` \| `object` \| `object` + +#### Returns + +`TransactionShape`\<`"Upgrade"`\> + +### MakeMoveVec() + +#### Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.type?**: `string` + +• **\_\_namedParameters.elements**: (`object` \| `object` \| `object` \| `object`)[] + +#### Returns + +`TransactionShape`\<`"MakeMoveVec"`\> + +### Intent() + +#### Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.name**: `string` + +• **\_\_namedParameters.inputs?**: `Record`\<`string`, `object` \| `object` \| `object` \| `object` \| (`object` \| `object` \| `object` \| `object`)[]\> = `{}` + +• **\_\_namedParameters.data?**: `Record`\<`string`, `unknown`\> = `{}` + +#### Returns + +`TransactionShape`\<`"$Intent"`\> diff --git a/docs/content/ts-sdk/api/transactions/variables/GasData.md b/docs/content/ts-sdk/api/transactions/variables/GasData.md new file mode 100644 index 00000000000..da28ef91032 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/variables/GasData.md @@ -0,0 +1,21 @@ +# Variable: GasData + +> `const` **GasData**: `ObjectSchema`\<`object`, `undefined`\> + +## Type declaration + +### budget + +> `readonly` **budget**: `NullableSchema`\<`SchemaWithPipe`\<[`UnionSchema`\<[`StringSchema`\<`undefined`\>, `SchemaWithPipe`\<[`NumberSchema`\<`undefined`\>, `IntegerAction`\<`number`, `undefined`\>]\>], `undefined`\>, `CheckAction`\<`string` \| `number`, `"Invalid u64"`\>]\>, `never`\> + +### price + +> `readonly` **price**: `NullableSchema`\<`SchemaWithPipe`\<[`UnionSchema`\<[`StringSchema`\<`undefined`\>, `SchemaWithPipe`\<[`NumberSchema`\<`undefined`\>, `IntegerAction`\<`number`, `undefined`\>]\>], `undefined`\>, `CheckAction`\<`string` \| `number`, `"Invalid u64"`\>]\>, `never`\> + +### owner + +> `readonly` **owner**: `NullableSchema`\<`SchemaWithPipe`\<[`StringSchema`\<`undefined`\>, `TransformAction`\<`string`, `string`\>, `CheckAction`\<`string`, `undefined`\>]\>, `never`\> + +### payment + +> `readonly` **payment**: `NullableSchema`\<`ArraySchema`\<`ObjectSchema`\<`object`, `undefined`\>, `undefined`\>, `never`\> diff --git a/docs/content/ts-sdk/api/transactions/variables/Inputs.md b/docs/content/ts-sdk/api/transactions/variables/Inputs.md new file mode 100644 index 00000000000..57163e5994b --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/variables/Inputs.md @@ -0,0 +1,275 @@ +# Variable: Inputs + +> `const` **Inputs**: `object` + +## Type declaration + +### Pure() + +> **Pure**: (`data`) => `Extract`\<[`CallArg`](../type-aliases/CallArg.md), `object`\> + +#### Parameters + +• **data**: `Uint8Array` \| `SerializedBcs`\<`any`, `any`\> + +#### Returns + +`Extract`\<[`CallArg`](../type-aliases/CallArg.md), `object`\> + +### ObjectRef() + +#### Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.objectId**: `string` + +• **\_\_namedParameters.version**: `string` \| `number` + +• **\_\_namedParameters.digest**: `string` + +#### Returns + +`object` + +##### Pure + +> **Pure**: `undefined` + +##### UnresolvedPure + +> **UnresolvedPure**: `undefined` + +##### UnresolvedObject + +> **UnresolvedObject**: `undefined` + +##### $kind + +> **$kind**: `"Object"` + +##### Object + +> **Object**: `EnumOutputShapeWithKeys`\<`object`, `"ImmOrOwnedObject"` \| `"SharedObject"` \| `"Receiving"`\> = `ObjectArg` + +###### Type declaration + +###### ImmOrOwnedObject + +> **ImmOrOwnedObject**: `object` = `ObjectRef` + +###### ImmOrOwnedObject.objectId + +> **objectId**: `string` = `IotaAddress` + +###### ImmOrOwnedObject.version + +> **version**: `string` \| `number` = `JsonU64` + +###### ImmOrOwnedObject.digest + +> **digest**: `string` + +###### SharedObject + +> **SharedObject**: `object` + +###### SharedObject.objectId + +> **objectId**: `string` = `ObjectID` + +###### SharedObject.initialSharedVersion + +> **initialSharedVersion**: `string` \| `number` = `JsonU64` + +###### SharedObject.mutable + +> **mutable**: `boolean` + +###### Receiving + +> **Receiving**: `object` = `ObjectRef` + +###### Receiving.objectId + +> **objectId**: `string` = `IotaAddress` + +###### Receiving.version + +> **version**: `string` \| `number` = `JsonU64` + +###### Receiving.digest + +> **digest**: `string` + +### SharedObjectRef() + +#### Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.objectId**: `string` + +• **\_\_namedParameters.mutable**: `boolean` + +• **\_\_namedParameters.initialSharedVersion**: `string` \| `number` + +#### Returns + +`object` + +##### Pure + +> **Pure**: `undefined` + +##### UnresolvedPure + +> **UnresolvedPure**: `undefined` + +##### UnresolvedObject + +> **UnresolvedObject**: `undefined` + +##### $kind + +> **$kind**: `"Object"` + +##### Object + +> **Object**: `EnumOutputShapeWithKeys`\<`object`, `"ImmOrOwnedObject"` \| `"SharedObject"` \| `"Receiving"`\> = `ObjectArg` + +###### Type declaration + +###### ImmOrOwnedObject + +> **ImmOrOwnedObject**: `object` = `ObjectRef` + +###### ImmOrOwnedObject.objectId + +> **objectId**: `string` = `IotaAddress` + +###### ImmOrOwnedObject.version + +> **version**: `string` \| `number` = `JsonU64` + +###### ImmOrOwnedObject.digest + +> **digest**: `string` + +###### SharedObject + +> **SharedObject**: `object` + +###### SharedObject.objectId + +> **objectId**: `string` = `ObjectID` + +###### SharedObject.initialSharedVersion + +> **initialSharedVersion**: `string` \| `number` = `JsonU64` + +###### SharedObject.mutable + +> **mutable**: `boolean` + +###### Receiving + +> **Receiving**: `object` = `ObjectRef` + +###### Receiving.objectId + +> **objectId**: `string` = `IotaAddress` + +###### Receiving.version + +> **version**: `string` \| `number` = `JsonU64` + +###### Receiving.digest + +> **digest**: `string` + +### ReceivingRef() + +#### Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.objectId**: `string` + +• **\_\_namedParameters.version**: `string` \| `number` + +• **\_\_namedParameters.digest**: `string` + +#### Returns + +`object` + +##### Pure + +> **Pure**: `undefined` + +##### UnresolvedPure + +> **UnresolvedPure**: `undefined` + +##### UnresolvedObject + +> **UnresolvedObject**: `undefined` + +##### $kind + +> **$kind**: `"Object"` + +##### Object + +> **Object**: `EnumOutputShapeWithKeys`\<`object`, `"ImmOrOwnedObject"` \| `"SharedObject"` \| `"Receiving"`\> = `ObjectArg` + +###### Type declaration + +###### ImmOrOwnedObject + +> **ImmOrOwnedObject**: `object` = `ObjectRef` + +###### ImmOrOwnedObject.objectId + +> **objectId**: `string` = `IotaAddress` + +###### ImmOrOwnedObject.version + +> **version**: `string` \| `number` = `JsonU64` + +###### ImmOrOwnedObject.digest + +> **digest**: `string` + +###### SharedObject + +> **SharedObject**: `object` + +###### SharedObject.objectId + +> **objectId**: `string` = `ObjectID` + +###### SharedObject.initialSharedVersion + +> **initialSharedVersion**: `string` \| `number` = `JsonU64` + +###### SharedObject.mutable + +> **mutable**: `boolean` + +###### Receiving + +> **Receiving**: `object` = `ObjectRef` + +###### Receiving.objectId + +> **objectId**: `string` = `IotaAddress` + +###### Receiving.version + +> **version**: `string` \| `number` = `JsonU64` + +###### Receiving.digest + +> **digest**: `string` diff --git a/docs/content/ts-sdk/api/transactions/variables/ObjectRef.md b/docs/content/ts-sdk/api/transactions/variables/ObjectRef.md new file mode 100644 index 00000000000..faaf4bcb02e --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/variables/ObjectRef.md @@ -0,0 +1,17 @@ +# Variable: ObjectRef + +> `const` **ObjectRef**: `ObjectSchema`\<`object`, `undefined`\> + +## Type declaration + +### objectId + +> `readonly` **objectId**: `SchemaWithPipe`\<[`StringSchema`\<`undefined`\>, `TransformAction`\<`string`, `string`\>, `CheckAction`\<`string`, `undefined`\>]\> = `IotaAddress` + +### version + +> `readonly` **version**: `SchemaWithPipe`\<[`UnionSchema`\<[`StringSchema`\<`undefined`\>, `SchemaWithPipe`\<[`NumberSchema`\<`undefined`\>, `IntegerAction`\<`number`, `undefined`\>]\>], `undefined`\>, `CheckAction`\<`string` \| `number`, `"Invalid u64"`\>]\> = `JsonU64` + +### digest + +> `readonly` **digest**: `StringSchema`\<`undefined`\> diff --git a/docs/content/ts-sdk/api/transactions/variables/OpenMoveTypeSignature.md b/docs/content/ts-sdk/api/transactions/variables/OpenMoveTypeSignature.md new file mode 100644 index 00000000000..4f23fe77bc8 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/variables/OpenMoveTypeSignature.md @@ -0,0 +1,13 @@ +# Variable: OpenMoveTypeSignature + +> `const` **OpenMoveTypeSignature**: `ObjectSchema`\<`object`, `undefined`\> + +## Type declaration + +### ref + +> `readonly` **ref**: `NullableSchema`\<`UnionSchema`\<[`LiteralSchema`\<`"&"`, `undefined`\>, `LiteralSchema`\<`"&mut"`, `undefined`\>], `undefined`\>, `never`\> + +### body + +> `readonly` **body**: `GenericSchema`\<[`OpenMoveTypeSignatureBody`](../type-aliases/OpenMoveTypeSignatureBody.md), [`OpenMoveTypeSignatureBody`](../type-aliases/OpenMoveTypeSignatureBody.md), `BaseIssue`\<`unknown`\>\> = `OpenMoveTypeSignatureBody` diff --git a/docs/content/ts-sdk/api/transactions/variables/OpenMoveTypeSignatureBody.md b/docs/content/ts-sdk/api/transactions/variables/OpenMoveTypeSignatureBody.md new file mode 100644 index 00000000000..1ddca2645fd --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/variables/OpenMoveTypeSignatureBody.md @@ -0,0 +1,3 @@ +# Variable: OpenMoveTypeSignatureBody + +> **OpenMoveTypeSignatureBody**: `GenericSchema`\<[`OpenMoveTypeSignatureBody`](../type-aliases/OpenMoveTypeSignatureBody.md), [`OpenMoveTypeSignatureBody`](../type-aliases/OpenMoveTypeSignatureBody.md), `BaseIssue`\<`unknown`\>\> diff --git a/docs/content/ts-sdk/api/transactions/variables/SerializedTransactionDataV1.md b/docs/content/ts-sdk/api/transactions/variables/SerializedTransactionDataV1.md new file mode 100644 index 00000000000..6a27477a35a --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/variables/SerializedTransactionDataV1.md @@ -0,0 +1,47 @@ +# Variable: SerializedTransactionDataV1 + +> `const` **SerializedTransactionDataV1**: `ObjectSchema`\<`object`, `undefined`\> + +## Type declaration + +### version + +> `readonly` **version**: `LiteralSchema`\<`1`, `undefined`\> + +### sender + +> `readonly` **sender**: `OptionalSchema`\<`StringSchema`\<`undefined`\>, `never`\> + +### expiration + +> `readonly` **expiration**: `NullishSchema`\<`UnionSchema`\<[`ObjectSchema`\<`object`, `undefined`\>, `ObjectSchema`\<`object`, `undefined`\>], `undefined`\>, `never`\> + +### gasConfig + +> `readonly` **gasConfig**: `ObjectSchema`\<`object`, `undefined`\> = `GasConfig` + +#### Type declaration + +##### budget + +> `readonly` **budget**: `OptionalSchema`\<`SchemaWithPipe`\<[`UnionSchema`\<[`NumberSchema`\<`undefined`\>, `StringSchema`\<`undefined`\>, `BigintSchema`\<`undefined`\>], `undefined`\>, `CheckAction`\<`string` \| `number` \| `bigint`, `undefined`\>]\>, `never`\> + +##### price + +> `readonly` **price**: `OptionalSchema`\<`SchemaWithPipe`\<[`UnionSchema`\<[`NumberSchema`\<`undefined`\>, `StringSchema`\<`undefined`\>, `BigintSchema`\<`undefined`\>], `undefined`\>, `CheckAction`\<`string` \| `number` \| `bigint`, `undefined`\>]\>, `never`\> + +##### payment + +> `readonly` **payment**: `OptionalSchema`\<`ArraySchema`\<`ObjectSchema`\<`object`, `undefined`\>, `undefined`\>, `never`\> + +##### owner + +> `readonly` **owner**: `OptionalSchema`\<`StringSchema`\<`undefined`\>, `never`\> + +### inputs + +> `readonly` **inputs**: `ArraySchema`\<`UnionSchema`\<[`ObjectSchema`\<`object`, `undefined`\>, `ObjectSchema`\<`object`, `undefined`\>], `undefined`\>, `undefined`\> + +### transactions + +> `readonly` **transactions**: `ArraySchema`\<`UnionSchema`\<[`ObjectSchema`\<`object`, `undefined`\>, `ObjectSchema`\<`object`, `undefined`\>, `ObjectSchema`\<`object`, `undefined`\>], `undefined`\>, `undefined`\> diff --git a/docs/content/ts-sdk/api/transactions/variables/SerializedTransactionDataV2.md b/docs/content/ts-sdk/api/transactions/variables/SerializedTransactionDataV2.md new file mode 100644 index 00000000000..a84362cbe02 --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/variables/SerializedTransactionDataV2.md @@ -0,0 +1,47 @@ +# Variable: SerializedTransactionDataV2 + +> `const` **SerializedTransactionDataV2**: `ObjectSchema`\<`object`, `undefined`\> + +## Type declaration + +### version + +> `readonly` **version**: `LiteralSchema`\<`2`, `undefined`\> + +### sender + +> `readonly` **sender**: `NullishSchema`\<`SchemaWithPipe`\<[`StringSchema`\<`undefined`\>, `TransformAction`\<`string`, `string`\>, `CheckAction`\<`string`, `undefined`\>]\>, `never`\> + +### expiration + +> `readonly` **expiration**: `NullishSchema`\<`GenericSchema`\<`EnumInputShape`\<`object`\>, `EnumInputShape`\<`object`\>, `BaseIssue`\<`unknown`\>\>, `never`\> + +### gasData + +> `readonly` **gasData**: `ObjectSchema`\<`object`, `undefined`\> = `GasData` + +#### Type declaration + +##### budget + +> `readonly` **budget**: `NullableSchema`\<`SchemaWithPipe`\<[`UnionSchema`\<[`StringSchema`\<`undefined`\>, `SchemaWithPipe`\<[..., ...]\>], `undefined`\>, `CheckAction`\<`string` \| `number`, `"Invalid u64"`\>]\>, `never`\> + +##### price + +> `readonly` **price**: `NullableSchema`\<`SchemaWithPipe`\<[`UnionSchema`\<[`StringSchema`\<`undefined`\>, `SchemaWithPipe`\<[..., ...]\>], `undefined`\>, `CheckAction`\<`string` \| `number`, `"Invalid u64"`\>]\>, `never`\> + +##### owner + +> `readonly` **owner**: `NullableSchema`\<`SchemaWithPipe`\<[`StringSchema`\<`undefined`\>, `TransformAction`\<`string`, `string`\>, `CheckAction`\<`string`, `undefined`\>]\>, `never`\> + +##### payment + +> `readonly` **payment**: `NullableSchema`\<`ArraySchema`\<`ObjectSchema`\<`object`, `undefined`\>, `undefined`\>, `never`\> + +### inputs + +> `readonly` **inputs**: `ArraySchema`\<`GenericSchema`\<`EnumInputShape`\<`object`\>, `EnumInputShape`\<`object`\>, `BaseIssue`\<`unknown`\>\>, `undefined`\> + +### commands + +> `readonly` **commands**: `ArraySchema`\<`GenericSchema`\<`EnumInputShape`\<`object`\>, `EnumInputShape`\<`object`\>, `BaseIssue`\<`unknown`\>\>, `undefined`\> diff --git a/docs/content/ts-sdk/api/transactions/variables/TransactionData.md b/docs/content/ts-sdk/api/transactions/variables/TransactionData.md new file mode 100644 index 00000000000..c200a513e2c --- /dev/null +++ b/docs/content/ts-sdk/api/transactions/variables/TransactionData.md @@ -0,0 +1,47 @@ +# Variable: TransactionData + +> `const` **TransactionData**: `ObjectSchema`\<`object`, `undefined`\> + +## Type declaration + +### version + +> `readonly` **version**: `LiteralSchema`\<`2`, `undefined`\> + +### sender + +> `readonly` **sender**: `NullishSchema`\<`SchemaWithPipe`\<[`StringSchema`\<`undefined`\>, `TransformAction`\<`string`, `string`\>, `CheckAction`\<`string`, `undefined`\>]\>, `never`\> + +### expiration + +> `readonly` **expiration**: `NullishSchema`\<`EnumSchema`\<`object`\>, `never`\> + +### gasData + +> `readonly` **gasData**: `ObjectSchema`\<`object`, `undefined`\> = `GasData` + +#### Type declaration + +##### budget + +> `readonly` **budget**: `NullableSchema`\<`SchemaWithPipe`\<[`UnionSchema`\<[`StringSchema`\<`undefined`\>, `SchemaWithPipe`\<[..., ...]\>], `undefined`\>, `CheckAction`\<`string` \| `number`, `"Invalid u64"`\>]\>, `never`\> + +##### price + +> `readonly` **price**: `NullableSchema`\<`SchemaWithPipe`\<[`UnionSchema`\<[`StringSchema`\<`undefined`\>, `SchemaWithPipe`\<[..., ...]\>], `undefined`\>, `CheckAction`\<`string` \| `number`, `"Invalid u64"`\>]\>, `never`\> + +##### owner + +> `readonly` **owner**: `NullableSchema`\<`SchemaWithPipe`\<[`StringSchema`\<`undefined`\>, `TransformAction`\<`string`, `string`\>, `CheckAction`\<`string`, `undefined`\>]\>, `never`\> + +##### payment + +> `readonly` **payment**: `NullableSchema`\<`ArraySchema`\<`ObjectSchema`\<`object`, `undefined`\>, `undefined`\>, `never`\> + +### inputs + +> `readonly` **inputs**: `ArraySchema`\<`EnumSchema`\<`object`\>, `undefined`\> + +### commands + +> `readonly` **commands**: `ArraySchema`\<`EnumSchema`\<`object`\>, `undefined`\> diff --git a/docs/content/ts-sdk/api/typedoc-sidebar.cjs b/docs/content/ts-sdk/api/typedoc-sidebar.cjs new file mode 100644 index 00000000000..d25f7121036 --- /dev/null +++ b/docs/content/ts-sdk/api/typedoc-sidebar.cjs @@ -0,0 +1,4 @@ +// @ts-check +/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ +const typedocSidebar = { items: [{"type":"category","label":"bcs","items":[{"type":"category","label":"Classes","items":[{"type":"doc","id":"references/ts-sdk/api/bcs/classes/BcsType","label":"BcsType"},{"type":"doc","id":"references/ts-sdk/api/bcs/classes/TypeTagSerializer","label":"TypeTagSerializer"}]},{"type":"category","label":"Interfaces","items":[{"type":"doc","id":"references/ts-sdk/api/bcs/interfaces/BcsTypeOptions","label":"BcsTypeOptions"}]},{"type":"category","label":"Type Aliases","items":[{"type":"doc","id":"references/ts-sdk/api/bcs/type-aliases/TypeTag","label":"TypeTag"}]},{"type":"category","label":"Variables","items":[{"type":"doc","id":"references/ts-sdk/api/bcs/variables/bcs","label":"bcs"}]}],"link":{"type":"doc","id":"references/ts-sdk/api/bcs/index"}},{"type":"category","label":"client","items":[{"type":"category","label":"Enumerations","items":[{"type":"doc","id":"references/ts-sdk/api/client/enumerations/Network","label":"Network"}]},{"type":"category","label":"Classes","items":[{"type":"doc","id":"references/ts-sdk/api/client/classes/IotaClient","label":"IotaClient"},{"type":"doc","id":"references/ts-sdk/api/client/classes/IotaHTTPTransportError","label":"IotaHTTPTransportError"},{"type":"doc","id":"references/ts-sdk/api/client/classes/JsonRpcError","label":"JsonRpcError"},{"type":"doc","id":"references/ts-sdk/api/client/classes/IotaHTTPStatusError","label":"IotaHTTPStatusError"},{"type":"doc","id":"references/ts-sdk/api/client/classes/IotaHTTPTransport","label":"IotaHTTPTransport"}]},{"type":"category","label":"Interfaces","items":[{"type":"doc","id":"references/ts-sdk/api/client/interfaces/PaginationArguments","label":"PaginationArguments"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/OrderArguments","label":"OrderArguments"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaHTTPTransportOptions","label":"IotaHTTPTransportOptions"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaTransportRequestOptions","label":"IotaTransportRequestOptions"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaTransportSubscribeOptions","label":"IotaTransportSubscribeOptions"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaTransport","label":"IotaTransport"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/NetworkConfiguration","label":"NetworkConfiguration"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/KioskConfiguration","label":"KioskConfiguration"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/AddressMetrics","label":"AddressMetrics"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/Balance","label":"Balance"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/BalanceChange","label":"BalanceChange"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/Checkpoint","label":"Checkpoint"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/Claim","label":"Claim"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/CoinStruct","label":"CoinStruct"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/CommitteeInfo","label":"CommitteeInfo"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/DelegatedStake","label":"DelegatedStake"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/DelegatedTimelockedStake","label":"DelegatedTimelockedStake"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/DevInspectArgs","label":"DevInspectArgs"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/DevInspectResults","label":"DevInspectResults"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/DisplayFieldsResponse","label":"DisplayFieldsResponse"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/DryRunTransactionBlockResponse","label":"DryRunTransactionBlockResponse"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/DynamicFieldInfo","label":"DynamicFieldInfo"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/DynamicFieldName","label":"DynamicFieldName"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/ECMHLiveObjectSetDigest","label":"ECMHLiveObjectSetDigest"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/EndOfEpochData","label":"EndOfEpochData"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/EndOfEpochInfo","label":"EndOfEpochInfo"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/EpochInfo","label":"EpochInfo"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/EpochMetrics","label":"EpochMetrics"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaEvent","label":"IotaEvent"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/EventId","label":"EventId"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GasCostSummary","label":"GasCostSummary"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaGasData","label":"IotaGasData"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetPastObjectRequest","label":"GetPastObjectRequest"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaActiveJwk","label":"IotaActiveJwk"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaAuthenticatorStateExpire","label":"IotaAuthenticatorStateExpire"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaChangeEpoch","label":"IotaChangeEpoch"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/CoinMetadata","label":"CoinMetadata"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaExecutionResult","label":"IotaExecutionResult"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaJWK","label":"IotaJWK"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaJwkId","label":"IotaJwkId"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaMoveAbilitySet","label":"IotaMoveAbilitySet"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaMoveModuleId","label":"IotaMoveModuleId"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaMoveNormalizedField","label":"IotaMoveNormalizedField"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaMoveNormalizedFunction","label":"IotaMoveNormalizedFunction"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaMoveNormalizedModule","label":"IotaMoveNormalizedModule"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaMoveNormalizedStruct","label":"IotaMoveNormalizedStruct"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaMoveStructTypeParameter","label":"IotaMoveStructTypeParameter"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaObjectResponse","label":"IotaObjectResponse"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/MoveCallIotaTransaction","label":"MoveCallIotaTransaction"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaSystemStateSummary","label":"IotaSystemStateSummary"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaValidatorSummary","label":"IotaValidatorSummary"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/MoveCallMetrics","label":"MoveCallMetrics"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/MoveCallParams","label":"MoveCallParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/MoveFunctionName","label":"MoveFunctionName"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/MoveVariant","label":"MoveVariant"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/MultiSig","label":"MultiSig"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/MultiSigPublicKey","label":"MultiSigPublicKey"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/NetworkMetrics","label":"NetworkMetrics"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaObjectData","label":"IotaObjectData"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaObjectDataOptions","label":"IotaObjectDataOptions"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaObjectRef","label":"IotaObjectRef"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaObjectResponseQuery","label":"IotaObjectResponseQuery"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/OwnedObjectRef","label":"OwnedObjectRef"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/PaginatedCheckpoints","label":"PaginatedCheckpoints"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/PaginatedCoins","label":"PaginatedCoins"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/PaginatedDynamicFieldInfos","label":"PaginatedDynamicFieldInfos"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/PaginatedEpochInfos","label":"PaginatedEpochInfos"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/PaginatedEpochMetricss","label":"PaginatedEpochMetricss"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/PaginatedEvents","label":"PaginatedEvents"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/PaginatedObjectsResponse","label":"PaginatedObjectsResponse"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/PaginatedTransactionResponse","label":"PaginatedTransactionResponse"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/PasskeyAuthenticator","label":"PasskeyAuthenticator"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/ProtocolConfig","label":"ProtocolConfig"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/CoinSupply","label":"CoinSupply"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaTransactionBlock","label":"IotaTransactionBlock"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/TransactionBlockBytes","label":"TransactionBlockBytes"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/TransactionBlockEffectsModifiedAtVersions","label":"TransactionBlockEffectsModifiedAtVersions"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaTransactionBlockResponse","label":"IotaTransactionBlockResponse"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaTransactionBlockResponseOptions","label":"IotaTransactionBlockResponseOptions"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/IotaTransactionBlockResponseQuery","label":"IotaTransactionBlockResponseQuery"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/TransferObjectParams","label":"TransferObjectParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/TypeOrigin","label":"TypeOrigin"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/UpgradeInfo","label":"UpgradeInfo"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/ValidatorApy","label":"ValidatorApy"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/ValidatorsApy","label":"ValidatorsApy"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/ZkLoginAuthenticator","label":"ZkLoginAuthenticator"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/ZkLoginInputs","label":"ZkLoginInputs"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/ZkLoginProof","label":"ZkLoginProof"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/DevInspectTransactionBlockParams","label":"DevInspectTransactionBlockParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/DryRunTransactionBlockParams","label":"DryRunTransactionBlockParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/ExecuteTransactionBlockParams","label":"ExecuteTransactionBlockParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetChainIdentifierParams","label":"GetChainIdentifierParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetCheckpointParams","label":"GetCheckpointParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetCheckpointsParams","label":"GetCheckpointsParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetEventsParams","label":"GetEventsParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetLatestCheckpointSequenceNumberParams","label":"GetLatestCheckpointSequenceNumberParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetMoveFunctionArgTypesParams","label":"GetMoveFunctionArgTypesParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetNormalizedMoveFunctionParams","label":"GetNormalizedMoveFunctionParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetNormalizedMoveModuleParams","label":"GetNormalizedMoveModuleParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetNormalizedMoveModulesByPackageParams","label":"GetNormalizedMoveModulesByPackageParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetNormalizedMoveStructParams","label":"GetNormalizedMoveStructParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetObjectParams","label":"GetObjectParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetProtocolConfigParams","label":"GetProtocolConfigParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetTotalTransactionBlocksParams","label":"GetTotalTransactionBlocksParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetTransactionBlockParams","label":"GetTransactionBlockParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/MultiGetObjectsParams","label":"MultiGetObjectsParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/MultiGetTransactionBlocksParams","label":"MultiGetTransactionBlocksParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/TryGetPastObjectParams","label":"TryGetPastObjectParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/TryMultiGetPastObjectsParams","label":"TryMultiGetPastObjectsParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetAllBalancesParams","label":"GetAllBalancesParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetAllCoinsParams","label":"GetAllCoinsParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetAllEpochAddressMetricsParams","label":"GetAllEpochAddressMetricsParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetBalanceParams","label":"GetBalanceParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetCheckpointAddressMetricsParams","label":"GetCheckpointAddressMetricsParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetCoinMetadataParams","label":"GetCoinMetadataParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetCoinsParams","label":"GetCoinsParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetCommitteeInfoParams","label":"GetCommitteeInfoParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetCurrentEpochParams","label":"GetCurrentEpochParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetDynamicFieldObjectParams","label":"GetDynamicFieldObjectParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetDynamicFieldsParams","label":"GetDynamicFieldsParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetEpochMetricsParams","label":"GetEpochMetricsParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetEpochsParams","label":"GetEpochsParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetLatestAddressMetricsParams","label":"GetLatestAddressMetricsParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetLatestIotaSystemStateParams","label":"GetLatestIotaSystemStateParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetMoveCallMetricsParams","label":"GetMoveCallMetricsParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetNetworkMetricsParams","label":"GetNetworkMetricsParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetReferenceGasPriceParams","label":"GetReferenceGasPriceParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetStakesParams","label":"GetStakesParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetStakesByIdsParams","label":"GetStakesByIdsParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetTimelockedStakesParams","label":"GetTimelockedStakesParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetTimelockedStakesByIdsParams","label":"GetTimelockedStakesByIdsParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetTotalSupplyParams","label":"GetTotalSupplyParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetTotalTransactionsParams","label":"GetTotalTransactionsParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/GetValidatorsApyParams","label":"GetValidatorsApyParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/QueryEventsParams","label":"QueryEventsParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/SubscribeEventParams","label":"SubscribeEventParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/SubscribeTransactionParams","label":"SubscribeTransactionParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/UnsafeBatchTransactionParams","label":"UnsafeBatchTransactionParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/UnsafeMergeCoinsParams","label":"UnsafeMergeCoinsParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/UnsafeMoveCallParams","label":"UnsafeMoveCallParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/UnsafePayParams","label":"UnsafePayParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/UnsafePayAllIotaParams","label":"UnsafePayAllIotaParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/UnsafePayIotaParams","label":"UnsafePayIotaParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/UnsafePublishParams","label":"UnsafePublishParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/UnsafeRequestAddStakeParams","label":"UnsafeRequestAddStakeParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/UnsafeRequestAddTimelockedStakeParams","label":"UnsafeRequestAddTimelockedStakeParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/UnsafeRequestWithdrawStakeParams","label":"UnsafeRequestWithdrawStakeParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/UnsafeRequestWithdrawTimelockedStakeParams","label":"UnsafeRequestWithdrawTimelockedStakeParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/UnsafeSplitCoinParams","label":"UnsafeSplitCoinParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/UnsafeSplitCoinEqualParams","label":"UnsafeSplitCoinEqualParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/UnsafeTransferIotaParams","label":"UnsafeTransferIotaParams"},{"type":"doc","id":"references/ts-sdk/api/client/interfaces/UnsafeTransferObjectParams","label":"UnsafeTransferObjectParams"}]},{"type":"category","label":"Type Aliases","items":[{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaClientOptions","label":"IotaClientOptions"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/HttpHeaders","label":"HttpHeaders"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/NetworkId","label":"NetworkId"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/ChainType","label":"ChainType"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/EpochPage","label":"EpochPage"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/EpochMetricsPage","label":"EpochMetricsPage"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/CheckpointPage","label":"CheckpointPage"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/AllEpochsAddressMetrics","label":"AllEpochsAddressMetrics"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/MoveCallMetric","label":"MoveCallMetric"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/DynamicFieldPage","label":"DynamicFieldPage"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaMoveNormalizedModules","label":"IotaMoveNormalizedModules"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaMoveObject","label":"IotaMoveObject"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaMovePackage","label":"IotaMovePackage"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/ProgrammableTransaction","label":"ProgrammableTransaction"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaObjectChangePublished","label":"IotaObjectChangePublished"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaObjectChangeTransferred","label":"IotaObjectChangeTransferred"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaObjectChangeMutated","label":"IotaObjectChangeMutated"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaObjectChangeDeleted","label":"IotaObjectChangeDeleted"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaObjectChangeWrapped","label":"IotaObjectChangeWrapped"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaObjectChangeCreated","label":"IotaObjectChangeCreated"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/CoinBalance","label":"CoinBalance"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/Order","label":"Order"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/Unsubscribe","label":"Unsubscribe"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/CheckpointCommitment","label":"CheckpointCommitment"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/CheckpointId","label":"CheckpointId"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/CompressedSignature","label":"CompressedSignature"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/ConsensusDeterminedVersionAssignments","label":"ConsensusDeterminedVersionAssignments"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaParsedData","label":"IotaParsedData"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/DynamicFieldType","label":"DynamicFieldType"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaEventFilter","label":"IotaEventFilter"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/ExecuteTransactionRequestType","label":"ExecuteTransactionRequestType"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/ExecutionStatus","label":"ExecutionStatus"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/InputObjectKind","label":"InputObjectKind"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaArgument","label":"IotaArgument"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaCallArg","label":"IotaCallArg"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaEndOfEpochTransactionKind","label":"IotaEndOfEpochTransactionKind"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaMoveAbility","label":"IotaMoveAbility"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaMoveNormalizedType","label":"IotaMoveNormalizedType"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaMoveVisibility","label":"IotaMoveVisibility"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaObjectDataFilter","label":"IotaObjectDataFilter"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaTransaction","label":"IotaTransaction"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaTransactionBlockBuilderMode","label":"IotaTransactionBlockBuilderMode"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaMoveFunctionArgType","label":"IotaMoveFunctionArgType"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/MoveStruct","label":"MoveStruct"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/MoveValue","label":"MoveValue"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaObjectChange","label":"IotaObjectChange"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/ObjectRead","label":"ObjectRead"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/ObjectResponseError","label":"ObjectResponseError"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/ObjectValueKind","label":"ObjectValueKind"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/ObjectOwner","label":"ObjectOwner"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/ProtocolConfigValue","label":"ProtocolConfigValue"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/PublicKey","label":"PublicKey"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/RPCTransactionRequestParams","label":"RPCTransactionRequestParams"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/RawData","label":"RawData"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/Signature","label":"Signature"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/StakeObject","label":"StakeObject"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/TimelockedStake","label":"TimelockedStake"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/TransactionBlockData","label":"TransactionBlockData"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/TransactionEffects","label":"TransactionEffects"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/IotaTransactionBlockKind","label":"IotaTransactionBlockKind"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/TransactionFilter","label":"TransactionFilter"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/GetOwnedObjectsParams","label":"GetOwnedObjectsParams"},{"type":"doc","id":"references/ts-sdk/api/client/type-aliases/QueryTransactionBlocksParams","label":"QueryTransactionBlocksParams"}]},{"type":"category","label":"Functions","items":[{"type":"doc","id":"references/ts-sdk/api/client/functions/getAppsBackend","label":"getAppsBackend"},{"type":"doc","id":"references/ts-sdk/api/client/functions/isIotaClient","label":"isIotaClient"},{"type":"doc","id":"references/ts-sdk/api/client/functions/getAllNetworks","label":"getAllNetworks"},{"type":"doc","id":"references/ts-sdk/api/client/functions/getNetwork","label":"getNetwork"},{"type":"doc","id":"references/ts-sdk/api/client/functions/getDefaultNetwork","label":"getDefaultNetwork"},{"type":"doc","id":"references/ts-sdk/api/client/functions/getFullnodeUrl","label":"getFullnodeUrl"}]}],"link":{"type":"doc","id":"references/ts-sdk/api/client/index"}},{"type":"category","label":"cryptography","items":[{"type":"category","label":"Classes","items":[{"type":"doc","id":"references/ts-sdk/api/cryptography/classes/Signer","label":"Signer"},{"type":"doc","id":"references/ts-sdk/api/cryptography/classes/Keypair","label":"Keypair"},{"type":"doc","id":"references/ts-sdk/api/cryptography/classes/PublicKey","label":"PublicKey"}]},{"type":"category","label":"Interfaces","items":[{"type":"doc","id":"references/ts-sdk/api/cryptography/interfaces/SignatureWithBytes","label":"SignatureWithBytes"}]},{"type":"category","label":"Type Aliases","items":[{"type":"doc","id":"references/ts-sdk/api/cryptography/type-aliases/IntentScope","label":"IntentScope"},{"type":"doc","id":"references/ts-sdk/api/cryptography/type-aliases/ParsedKeypair","label":"ParsedKeypair"},{"type":"doc","id":"references/ts-sdk/api/cryptography/type-aliases/SignatureScheme","label":"SignatureScheme"},{"type":"doc","id":"references/ts-sdk/api/cryptography/type-aliases/SignatureFlag","label":"SignatureFlag"},{"type":"doc","id":"references/ts-sdk/api/cryptography/type-aliases/SerializeSignatureInput","label":"SerializeSignatureInput"}]},{"type":"category","label":"Variables","items":[{"type":"doc","id":"references/ts-sdk/api/cryptography/variables/PRIVATE_KEY_SIZE","label":"PRIVATE_KEY_SIZE"},{"type":"doc","id":"references/ts-sdk/api/cryptography/variables/LEGACY_PRIVATE_KEY_SIZE","label":"LEGACY_PRIVATE_KEY_SIZE"},{"type":"doc","id":"references/ts-sdk/api/cryptography/variables/IOTA_PRIVATE_KEY_PREFIX","label":"IOTA_PRIVATE_KEY_PREFIX"},{"type":"doc","id":"references/ts-sdk/api/cryptography/variables/SIGNATURE_SCHEME_TO_FLAG","label":"SIGNATURE_SCHEME_TO_FLAG"},{"type":"doc","id":"references/ts-sdk/api/cryptography/variables/SIGNATURE_SCHEME_TO_SIZE","label":"SIGNATURE_SCHEME_TO_SIZE"},{"type":"doc","id":"references/ts-sdk/api/cryptography/variables/SIGNATURE_FLAG_TO_SCHEME","label":"SIGNATURE_FLAG_TO_SCHEME"}]},{"type":"category","label":"Functions","items":[{"type":"doc","id":"references/ts-sdk/api/cryptography/functions/messageWithIntent","label":"messageWithIntent"},{"type":"doc","id":"references/ts-sdk/api/cryptography/functions/decodeIotaPrivateKey","label":"decodeIotaPrivateKey"},{"type":"doc","id":"references/ts-sdk/api/cryptography/functions/encodeIotaPrivateKey","label":"encodeIotaPrivateKey"},{"type":"doc","id":"references/ts-sdk/api/cryptography/functions/isValidHardenedPath","label":"isValidHardenedPath"},{"type":"doc","id":"references/ts-sdk/api/cryptography/functions/isValidBIP32Path","label":"isValidBIP32Path"},{"type":"doc","id":"references/ts-sdk/api/cryptography/functions/mnemonicToSeed","label":"mnemonicToSeed"},{"type":"doc","id":"references/ts-sdk/api/cryptography/functions/mnemonicToSeedHex","label":"mnemonicToSeedHex"},{"type":"doc","id":"references/ts-sdk/api/cryptography/functions/toSerializedSignature","label":"toSerializedSignature"},{"type":"doc","id":"references/ts-sdk/api/cryptography/functions/parseSerializedSignature","label":"parseSerializedSignature"}]}],"link":{"type":"doc","id":"references/ts-sdk/api/cryptography/index"}},{"type":"category","label":"faucet","items":[{"type":"category","label":"Classes","items":[{"type":"doc","id":"references/ts-sdk/api/faucet/classes/FaucetRateLimitError","label":"FaucetRateLimitError"}]},{"type":"category","label":"Functions","items":[{"type":"doc","id":"references/ts-sdk/api/faucet/functions/requestIotaFromFaucetV0","label":"requestIotaFromFaucetV0"},{"type":"doc","id":"references/ts-sdk/api/faucet/functions/requestIotaFromFaucetV1","label":"requestIotaFromFaucetV1"},{"type":"doc","id":"references/ts-sdk/api/faucet/functions/getFaucetRequestStatus","label":"getFaucetRequestStatus"},{"type":"doc","id":"references/ts-sdk/api/faucet/functions/getFaucetHost","label":"getFaucetHost"}]}],"link":{"type":"doc","id":"references/ts-sdk/api/faucet/index"}},{"type":"category","label":"graphql","items":[{"type":"category","label":"Classes","items":[{"type":"doc","id":"references/ts-sdk/api/graphql/classes/IotaGraphQLRequestError","label":"IotaGraphQLRequestError"},{"type":"doc","id":"references/ts-sdk/api/graphql/classes/IotaGraphQLClient","label":"IotaGraphQLClient"}]},{"type":"category","label":"Interfaces","items":[{"type":"doc","id":"references/ts-sdk/api/graphql/interfaces/IotaGraphQLClientOptions","label":"IotaGraphQLClientOptions"}]},{"type":"category","label":"Type Aliases","items":[{"type":"doc","id":"references/ts-sdk/api/graphql/type-aliases/GraphQLDocument","label":"GraphQLDocument"},{"type":"doc","id":"references/ts-sdk/api/graphql/type-aliases/GraphQLQueryOptions","label":"GraphQLQueryOptions"},{"type":"doc","id":"references/ts-sdk/api/graphql/type-aliases/GraphQLQueryResult","label":"GraphQLQueryResult"},{"type":"doc","id":"references/ts-sdk/api/graphql/type-aliases/GraphQLResponseErrors","label":"GraphQLResponseErrors"}]}],"link":{"type":"doc","id":"references/ts-sdk/api/graphql/index"}},{"type":"category","label":"keypairs","items":[{"type":"category","label":"ed25519","items":[{"type":"category","label":"Classes","items":[{"type":"doc","id":"references/ts-sdk/api/keypairs/ed25519/classes/Ed25519Keypair","label":"Ed25519Keypair"},{"type":"doc","id":"references/ts-sdk/api/keypairs/ed25519/classes/Ed25519PublicKey","label":"Ed25519PublicKey"}]},{"type":"category","label":"Interfaces","items":[{"type":"doc","id":"references/ts-sdk/api/keypairs/ed25519/interfaces/Ed25519KeypairData","label":"Ed25519KeypairData"}]},{"type":"category","label":"Variables","items":[{"type":"doc","id":"references/ts-sdk/api/keypairs/ed25519/variables/DEFAULT_ED25519_DERIVATION_PATH","label":"DEFAULT_ED25519_DERIVATION_PATH"}]}],"link":{"type":"doc","id":"references/ts-sdk/api/keypairs/ed25519/index"}},{"type":"category","label":"secp256k1","items":[{"type":"category","label":"Classes","items":[{"type":"doc","id":"references/ts-sdk/api/keypairs/secp256k1/classes/Secp256k1Keypair","label":"Secp256k1Keypair"},{"type":"doc","id":"references/ts-sdk/api/keypairs/secp256k1/classes/Secp256k1PublicKey","label":"Secp256k1PublicKey"}]},{"type":"category","label":"Interfaces","items":[{"type":"doc","id":"references/ts-sdk/api/keypairs/secp256k1/interfaces/Secp256k1KeypairData","label":"Secp256k1KeypairData"}]},{"type":"category","label":"Variables","items":[{"type":"doc","id":"references/ts-sdk/api/keypairs/secp256k1/variables/DEFAULT_SECP256K1_DERIVATION_PATH","label":"DEFAULT_SECP256K1_DERIVATION_PATH"}]}],"link":{"type":"doc","id":"references/ts-sdk/api/keypairs/secp256k1/index"}},{"type":"doc","id":"references/ts-sdk/api/keypairs/secp256k1/index","label":"secp256k1"}]},{"type":"category","label":"multisig","items":[{"type":"category","label":"Classes","items":[{"type":"doc","id":"references/ts-sdk/api/multisig/classes/MultiSigPublicKey","label":"MultiSigPublicKey"},{"type":"doc","id":"references/ts-sdk/api/multisig/classes/MultiSigSigner","label":"MultiSigSigner"}]},{"type":"category","label":"Type Aliases","items":[{"type":"doc","id":"references/ts-sdk/api/multisig/type-aliases/MultiSigStruct","label":"MultiSigStruct"}]},{"type":"category","label":"Functions","items":[{"type":"doc","id":"references/ts-sdk/api/multisig/functions/parsePartialSignatures","label":"parsePartialSignatures"}]}],"link":{"type":"doc","id":"references/ts-sdk/api/multisig/index"}},{"type":"category","label":"transactions","items":[{"type":"category","label":"Enumerations","items":[{"type":"doc","id":"references/ts-sdk/api/transactions/enumerations/UpgradePolicy","label":"UpgradePolicy"}]},{"type":"category","label":"Classes","items":[{"type":"doc","id":"references/ts-sdk/api/transactions/classes/AsyncCache","label":"AsyncCache"},{"type":"doc","id":"references/ts-sdk/api/transactions/classes/ObjectCache","label":"ObjectCache"},{"type":"doc","id":"references/ts-sdk/api/transactions/classes/Transaction","label":"Transaction"},{"type":"doc","id":"references/ts-sdk/api/transactions/classes/TransactionDataBuilder","label":"TransactionDataBuilder"},{"type":"doc","id":"references/ts-sdk/api/transactions/classes/ParallelTransactionExecutor","label":"ParallelTransactionExecutor"},{"type":"doc","id":"references/ts-sdk/api/transactions/classes/SerialTransactionExecutor","label":"SerialTransactionExecutor"}]},{"type":"category","label":"Interfaces","items":[{"type":"doc","id":"references/ts-sdk/api/transactions/interfaces/ParallelTransactionExecutorOptions","label":"ParallelTransactionExecutorOptions"},{"type":"doc","id":"references/ts-sdk/api/transactions/interfaces/BuildTransactionOptions","label":"BuildTransactionOptions"},{"type":"doc","id":"references/ts-sdk/api/transactions/interfaces/SerializeTransactionOptions","label":"SerializeTransactionOptions"}]},{"type":"category","label":"Type Aliases","items":[{"type":"doc","id":"references/ts-sdk/api/transactions/type-aliases/TransactionArgument","label":"TransactionArgument"},{"type":"doc","id":"references/ts-sdk/api/transactions/type-aliases/TransactionInput","label":"TransactionInput"},{"type":"doc","id":"references/ts-sdk/api/transactions/type-aliases/TransactionObjectArgument","label":"TransactionObjectArgument"},{"type":"doc","id":"references/ts-sdk/api/transactions/type-aliases/TransactionResult","label":"TransactionResult"},{"type":"doc","id":"references/ts-sdk/api/transactions/type-aliases/TransactionObjectInput","label":"TransactionObjectInput"},{"type":"doc","id":"references/ts-sdk/api/transactions/type-aliases/ObjectRef","label":"ObjectRef"},{"type":"doc","id":"references/ts-sdk/api/transactions/type-aliases/Argument","label":"Argument"},{"type":"doc","id":"references/ts-sdk/api/transactions/type-aliases/GasData","label":"GasData"},{"type":"doc","id":"references/ts-sdk/api/transactions/type-aliases/OpenMoveTypeSignatureBody","label":"OpenMoveTypeSignatureBody"},{"type":"doc","id":"references/ts-sdk/api/transactions/type-aliases/OpenMoveTypeSignature","label":"OpenMoveTypeSignature"},{"type":"doc","id":"references/ts-sdk/api/transactions/type-aliases/Command","label":"Command"},{"type":"doc","id":"references/ts-sdk/api/transactions/type-aliases/CallArg","label":"CallArg"},{"type":"doc","id":"references/ts-sdk/api/transactions/type-aliases/TransactionData","label":"TransactionData"},{"type":"doc","id":"references/ts-sdk/api/transactions/type-aliases/SerializedTransactionDataV1","label":"SerializedTransactionDataV1"},{"type":"doc","id":"references/ts-sdk/api/transactions/type-aliases/SerializedTransactionDataV2","label":"SerializedTransactionDataV2"},{"type":"doc","id":"references/ts-sdk/api/transactions/type-aliases/TransactionPlugin","label":"TransactionPlugin"}]},{"type":"category","label":"Variables","items":[{"type":"doc","id":"references/ts-sdk/api/transactions/variables/Arguments","label":"Arguments"},{"type":"doc","id":"references/ts-sdk/api/transactions/variables/Commands","label":"Commands"},{"type":"doc","id":"references/ts-sdk/api/transactions/variables/Inputs","label":"Inputs"},{"type":"doc","id":"references/ts-sdk/api/transactions/variables/ObjectRef","label":"ObjectRef"},{"type":"doc","id":"references/ts-sdk/api/transactions/variables/Argument","label":"Argument"},{"type":"doc","id":"references/ts-sdk/api/transactions/variables/GasData","label":"GasData"},{"type":"doc","id":"references/ts-sdk/api/transactions/variables/OpenMoveTypeSignatureBody","label":"OpenMoveTypeSignatureBody"},{"type":"doc","id":"references/ts-sdk/api/transactions/variables/OpenMoveTypeSignature","label":"OpenMoveTypeSignature"},{"type":"doc","id":"references/ts-sdk/api/transactions/variables/Command","label":"Command"},{"type":"doc","id":"references/ts-sdk/api/transactions/variables/TransactionData","label":"TransactionData"},{"type":"doc","id":"references/ts-sdk/api/transactions/variables/SerializedTransactionDataV1","label":"SerializedTransactionDataV1"},{"type":"doc","id":"references/ts-sdk/api/transactions/variables/SerializedTransactionDataV2","label":"SerializedTransactionDataV2"}]},{"type":"category","label":"Functions","items":[{"type":"doc","id":"references/ts-sdk/api/transactions/functions/isTransaction","label":"isTransaction"},{"type":"doc","id":"references/ts-sdk/api/transactions/functions/coinWithBalance","label":"coinWithBalance"},{"type":"doc","id":"references/ts-sdk/api/transactions/functions/getPureBcsSchema","label":"getPureBcsSchema"},{"type":"doc","id":"references/ts-sdk/api/transactions/functions/normalizedTypeToMoveTypeSignature","label":"normalizedTypeToMoveTypeSignature"}]}],"link":{"type":"doc","id":"references/ts-sdk/api/transactions/index"}},{"type":"category","label":"utils","items":[{"type":"category","label":"Variables","items":[{"type":"doc","id":"references/ts-sdk/api/utils/variables/IOTA_DECIMALS","label":"IOTA_DECIMALS"},{"type":"doc","id":"references/ts-sdk/api/utils/variables/NANOS_PER_IOTA","label":"NANOS_PER_IOTA"},{"type":"doc","id":"references/ts-sdk/api/utils/variables/MOVE_STDLIB_ADDRESS","label":"MOVE_STDLIB_ADDRESS"},{"type":"doc","id":"references/ts-sdk/api/utils/variables/IOTA_FRAMEWORK_ADDRESS","label":"IOTA_FRAMEWORK_ADDRESS"},{"type":"doc","id":"references/ts-sdk/api/utils/variables/IOTA_SYSTEM_ADDRESS","label":"IOTA_SYSTEM_ADDRESS"},{"type":"doc","id":"references/ts-sdk/api/utils/variables/IOTA_CLOCK_OBJECT_ID","label":"IOTA_CLOCK_OBJECT_ID"},{"type":"doc","id":"references/ts-sdk/api/utils/variables/IOTA_SYSTEM_MODULE_NAME","label":"IOTA_SYSTEM_MODULE_NAME"},{"type":"doc","id":"references/ts-sdk/api/utils/variables/IOTA_TYPE_ARG","label":"IOTA_TYPE_ARG"},{"type":"doc","id":"references/ts-sdk/api/utils/variables/IOTA_SYSTEM_STATE_OBJECT_ID","label":"IOTA_SYSTEM_STATE_OBJECT_ID"},{"type":"doc","id":"references/ts-sdk/api/utils/variables/IOTA_ADDRESS_LENGTH","label":"IOTA_ADDRESS_LENGTH"}]},{"type":"category","label":"Functions","items":[{"type":"doc","id":"references/ts-sdk/api/utils/functions/fromB64","label":"fromB64"},{"type":"doc","id":"references/ts-sdk/api/utils/functions/toB64","label":"toB64"},{"type":"doc","id":"references/ts-sdk/api/utils/functions/fromHEX","label":"fromHEX"},{"type":"doc","id":"references/ts-sdk/api/utils/functions/toHEX","label":"toHEX"},{"type":"doc","id":"references/ts-sdk/api/utils/functions/formatAddress","label":"formatAddress"},{"type":"doc","id":"references/ts-sdk/api/utils/functions/formatDigest","label":"formatDigest"},{"type":"doc","id":"references/ts-sdk/api/utils/functions/formatType","label":"formatType"},{"type":"doc","id":"references/ts-sdk/api/utils/functions/isValidTransactionDigest","label":"isValidTransactionDigest"},{"type":"doc","id":"references/ts-sdk/api/utils/functions/isValidIotaAddress","label":"isValidIotaAddress"},{"type":"doc","id":"references/ts-sdk/api/utils/functions/isValidIotaObjectId","label":"isValidIotaObjectId"},{"type":"doc","id":"references/ts-sdk/api/utils/functions/parseStructTag","label":"parseStructTag"},{"type":"doc","id":"references/ts-sdk/api/utils/functions/normalizeStructTag","label":"normalizeStructTag"},{"type":"doc","id":"references/ts-sdk/api/utils/functions/normalizeIotaAddress","label":"normalizeIotaAddress"},{"type":"doc","id":"references/ts-sdk/api/utils/functions/normalizeIotaObjectId","label":"normalizeIotaObjectId"}]}],"link":{"type":"doc","id":"references/ts-sdk/api/utils/index"}},{"type":"category","label":"verify","items":[{"type":"category","label":"Functions","items":[{"type":"doc","id":"references/ts-sdk/api/verify/functions/verifySignature","label":"verifySignature"},{"type":"doc","id":"references/ts-sdk/api/verify/functions/verifyPersonalMessageSignature","label":"verifyPersonalMessageSignature"},{"type":"doc","id":"references/ts-sdk/api/verify/functions/verifyTransactionSignature","label":"verifyTransactionSignature"},{"type":"doc","id":"references/ts-sdk/api/verify/functions/publicKeyFromRawBytes","label":"publicKeyFromRawBytes"},{"type":"doc","id":"references/ts-sdk/api/verify/functions/publicKeyFromIotaBytes","label":"publicKeyFromIotaBytes"}]}],"link":{"type":"doc","id":"references/ts-sdk/api/verify/index"}}]}; +module.exports = typedocSidebar.items; \ No newline at end of file diff --git a/docs/content/ts-sdk/api/utils/functions/formatAddress.md b/docs/content/ts-sdk/api/utils/functions/formatAddress.md new file mode 100644 index 00000000000..c3a167f0e9b --- /dev/null +++ b/docs/content/ts-sdk/api/utils/functions/formatAddress.md @@ -0,0 +1,11 @@ +# Function: formatAddress() + +> **formatAddress**(`address`): `string` + +## Parameters + +• **address**: `string` + +## Returns + +`string` diff --git a/docs/content/ts-sdk/api/utils/functions/formatDigest.md b/docs/content/ts-sdk/api/utils/functions/formatDigest.md new file mode 100644 index 00000000000..41a3ba2dd1b --- /dev/null +++ b/docs/content/ts-sdk/api/utils/functions/formatDigest.md @@ -0,0 +1,11 @@ +# Function: formatDigest() + +> **formatDigest**(`digest`): `string` + +## Parameters + +• **digest**: `string` + +## Returns + +`string` diff --git a/docs/content/ts-sdk/api/utils/functions/formatType.md b/docs/content/ts-sdk/api/utils/functions/formatType.md new file mode 100644 index 00000000000..7941bffb537 --- /dev/null +++ b/docs/content/ts-sdk/api/utils/functions/formatType.md @@ -0,0 +1,11 @@ +# Function: formatType() + +> **formatType**(`type`): `string` + +## Parameters + +• **type**: `string` + +## Returns + +`string` diff --git a/docs/content/ts-sdk/api/utils/functions/fromB64.md b/docs/content/ts-sdk/api/utils/functions/fromB64.md new file mode 100644 index 00000000000..9c32aca174a --- /dev/null +++ b/docs/content/ts-sdk/api/utils/functions/fromB64.md @@ -0,0 +1,11 @@ +# Function: fromB64() + +> **fromB64**(`base64String`): `Uint8Array` + +## Parameters + +• **base64String**: `string` + +## Returns + +`Uint8Array` diff --git a/docs/content/ts-sdk/api/utils/functions/fromHEX.md b/docs/content/ts-sdk/api/utils/functions/fromHEX.md new file mode 100644 index 00000000000..2a2e84dd9c7 --- /dev/null +++ b/docs/content/ts-sdk/api/utils/functions/fromHEX.md @@ -0,0 +1,11 @@ +# Function: fromHEX() + +> **fromHEX**(`hexStr`): `Uint8Array` + +## Parameters + +• **hexStr**: `string` + +## Returns + +`Uint8Array` diff --git a/docs/content/ts-sdk/api/utils/functions/isValidIotaAddress.md b/docs/content/ts-sdk/api/utils/functions/isValidIotaAddress.md new file mode 100644 index 00000000000..4d59e4823c4 --- /dev/null +++ b/docs/content/ts-sdk/api/utils/functions/isValidIotaAddress.md @@ -0,0 +1,11 @@ +# Function: isValidIotaAddress() + +> **isValidIotaAddress**(`value`): `value is string` + +## Parameters + +• **value**: `string` + +## Returns + +`value is string` diff --git a/docs/content/ts-sdk/api/utils/functions/isValidIotaObjectId.md b/docs/content/ts-sdk/api/utils/functions/isValidIotaObjectId.md new file mode 100644 index 00000000000..e6a979a5dd0 --- /dev/null +++ b/docs/content/ts-sdk/api/utils/functions/isValidIotaObjectId.md @@ -0,0 +1,11 @@ +# Function: isValidIotaObjectId() + +> **isValidIotaObjectId**(`value`): `boolean` + +## Parameters + +• **value**: `string` + +## Returns + +`boolean` diff --git a/docs/content/ts-sdk/api/utils/functions/isValidTransactionDigest.md b/docs/content/ts-sdk/api/utils/functions/isValidTransactionDigest.md new file mode 100644 index 00000000000..c796a72169a --- /dev/null +++ b/docs/content/ts-sdk/api/utils/functions/isValidTransactionDigest.md @@ -0,0 +1,13 @@ +# Function: isValidTransactionDigest() + +> **isValidTransactionDigest**(`value`): `value is string` + +Returns whether the tx digest is valid based on the serialization format + +## Parameters + +• **value**: `string` + +## Returns + +`value is string` diff --git a/docs/content/ts-sdk/api/utils/functions/normalizeIotaAddress.md b/docs/content/ts-sdk/api/utils/functions/normalizeIotaAddress.md new file mode 100644 index 00000000000..62b6dde0733 --- /dev/null +++ b/docs/content/ts-sdk/api/utils/functions/normalizeIotaAddress.md @@ -0,0 +1,23 @@ +# Function: normalizeIotaAddress() + +> **normalizeIotaAddress**(`value`, `forceAdd0x`): `string` + +Perform the following operations: + +1. Make the address lower case +2. Prepend `0x` if the string does not start with `0x`. +3. Add more zeros if the length of the address(excluding `0x`) is less than `IOTA_ADDRESS_LENGTH` + +WARNING: if the address value itself starts with `0x`, e.g., `0x0x`, the default behavior +is to treat the first `0x` not as part of the address. The default behavior can be overridden by +setting `forceAdd0x` to true + +## Parameters + +• **value**: `string` + +• **forceAdd0x**: `boolean` = `false` + +## Returns + +`string` diff --git a/docs/content/ts-sdk/api/utils/functions/normalizeIotaObjectId.md b/docs/content/ts-sdk/api/utils/functions/normalizeIotaObjectId.md new file mode 100644 index 00000000000..28534bd38e2 --- /dev/null +++ b/docs/content/ts-sdk/api/utils/functions/normalizeIotaObjectId.md @@ -0,0 +1,13 @@ +# Function: normalizeIotaObjectId() + +> **normalizeIotaObjectId**(`value`, `forceAdd0x`): `string` + +## Parameters + +• **value**: `string` + +• **forceAdd0x**: `boolean` = `false` + +## Returns + +`string` diff --git a/docs/content/ts-sdk/api/utils/functions/normalizeStructTag.md b/docs/content/ts-sdk/api/utils/functions/normalizeStructTag.md new file mode 100644 index 00000000000..4dedb10bc34 --- /dev/null +++ b/docs/content/ts-sdk/api/utils/functions/normalizeStructTag.md @@ -0,0 +1,11 @@ +# Function: normalizeStructTag() + +> **normalizeStructTag**(`type`): `string` + +## Parameters + +• **type**: `string` \| `StructTag` + +## Returns + +`string` diff --git a/docs/content/ts-sdk/api/utils/functions/parseStructTag.md b/docs/content/ts-sdk/api/utils/functions/parseStructTag.md new file mode 100644 index 00000000000..6cd9aa7e153 --- /dev/null +++ b/docs/content/ts-sdk/api/utils/functions/parseStructTag.md @@ -0,0 +1,11 @@ +# Function: parseStructTag() + +> **parseStructTag**(`type`): `StructTag` + +## Parameters + +• **type**: `string` + +## Returns + +`StructTag` diff --git a/docs/content/ts-sdk/api/utils/functions/toB64.md b/docs/content/ts-sdk/api/utils/functions/toB64.md new file mode 100644 index 00000000000..b24565ffe87 --- /dev/null +++ b/docs/content/ts-sdk/api/utils/functions/toB64.md @@ -0,0 +1,11 @@ +# Function: toB64() + +> **toB64**(`bytes`): `string` + +## Parameters + +• **bytes**: `Uint8Array` + +## Returns + +`string` diff --git a/docs/content/ts-sdk/api/utils/functions/toHEX.md b/docs/content/ts-sdk/api/utils/functions/toHEX.md new file mode 100644 index 00000000000..a9cd257eca6 --- /dev/null +++ b/docs/content/ts-sdk/api/utils/functions/toHEX.md @@ -0,0 +1,11 @@ +# Function: toHEX() + +> **toHEX**(`bytes`): `string` + +## Parameters + +• **bytes**: `Uint8Array` + +## Returns + +`string` diff --git a/docs/content/ts-sdk/api/utils/index.md b/docs/content/ts-sdk/api/utils/index.md new file mode 100644 index 00000000000..54098ba1a11 --- /dev/null +++ b/docs/content/ts-sdk/api/utils/index.md @@ -0,0 +1,33 @@ +# utils + +## Index + +### Variables + +- [IOTA\_DECIMALS](variables/IOTA_DECIMALS.md) +- [NANOS\_PER\_IOTA](variables/NANOS_PER_IOTA.md) +- [MOVE\_STDLIB\_ADDRESS](variables/MOVE_STDLIB_ADDRESS.md) +- [IOTA\_FRAMEWORK\_ADDRESS](variables/IOTA_FRAMEWORK_ADDRESS.md) +- [IOTA\_SYSTEM\_ADDRESS](variables/IOTA_SYSTEM_ADDRESS.md) +- [IOTA\_CLOCK\_OBJECT\_ID](variables/IOTA_CLOCK_OBJECT_ID.md) +- [IOTA\_SYSTEM\_MODULE\_NAME](variables/IOTA_SYSTEM_MODULE_NAME.md) +- [IOTA\_TYPE\_ARG](variables/IOTA_TYPE_ARG.md) +- [IOTA\_SYSTEM\_STATE\_OBJECT\_ID](variables/IOTA_SYSTEM_STATE_OBJECT_ID.md) +- [IOTA\_ADDRESS\_LENGTH](variables/IOTA_ADDRESS_LENGTH.md) + +### Functions + +- [fromB64](functions/fromB64.md) +- [toB64](functions/toB64.md) +- [fromHEX](functions/fromHEX.md) +- [toHEX](functions/toHEX.md) +- [formatAddress](functions/formatAddress.md) +- [formatDigest](functions/formatDigest.md) +- [formatType](functions/formatType.md) +- [isValidTransactionDigest](functions/isValidTransactionDigest.md) +- [isValidIotaAddress](functions/isValidIotaAddress.md) +- [isValidIotaObjectId](functions/isValidIotaObjectId.md) +- [parseStructTag](functions/parseStructTag.md) +- [normalizeStructTag](functions/normalizeStructTag.md) +- [normalizeIotaAddress](functions/normalizeIotaAddress.md) +- [normalizeIotaObjectId](functions/normalizeIotaObjectId.md) diff --git a/docs/content/ts-sdk/api/utils/variables/IOTA_ADDRESS_LENGTH.md b/docs/content/ts-sdk/api/utils/variables/IOTA_ADDRESS_LENGTH.md new file mode 100644 index 00000000000..1fb9e5b63a4 --- /dev/null +++ b/docs/content/ts-sdk/api/utils/variables/IOTA_ADDRESS_LENGTH.md @@ -0,0 +1,3 @@ +# Variable: IOTA\_ADDRESS\_LENGTH + +> `const` **IOTA\_ADDRESS\_LENGTH**: `32` = `32` diff --git a/docs/content/ts-sdk/api/utils/variables/IOTA_CLOCK_OBJECT_ID.md b/docs/content/ts-sdk/api/utils/variables/IOTA_CLOCK_OBJECT_ID.md new file mode 100644 index 00000000000..fd283f0e8e5 --- /dev/null +++ b/docs/content/ts-sdk/api/utils/variables/IOTA_CLOCK_OBJECT_ID.md @@ -0,0 +1,3 @@ +# Variable: IOTA\_CLOCK\_OBJECT\_ID + +> `const` **IOTA\_CLOCK\_OBJECT\_ID**: `string` diff --git a/docs/content/ts-sdk/api/utils/variables/IOTA_DECIMALS.md b/docs/content/ts-sdk/api/utils/variables/IOTA_DECIMALS.md new file mode 100644 index 00000000000..f1df665dedc --- /dev/null +++ b/docs/content/ts-sdk/api/utils/variables/IOTA_DECIMALS.md @@ -0,0 +1,3 @@ +# Variable: IOTA\_DECIMALS + +> `const` **IOTA\_DECIMALS**: `9` = `9` diff --git a/docs/content/ts-sdk/api/utils/variables/IOTA_FRAMEWORK_ADDRESS.md b/docs/content/ts-sdk/api/utils/variables/IOTA_FRAMEWORK_ADDRESS.md new file mode 100644 index 00000000000..b890559b3dc --- /dev/null +++ b/docs/content/ts-sdk/api/utils/variables/IOTA_FRAMEWORK_ADDRESS.md @@ -0,0 +1,3 @@ +# Variable: IOTA\_FRAMEWORK\_ADDRESS + +> `const` **IOTA\_FRAMEWORK\_ADDRESS**: `"0x2"` = `'0x2'` diff --git a/docs/content/ts-sdk/api/utils/variables/IOTA_SYSTEM_ADDRESS.md b/docs/content/ts-sdk/api/utils/variables/IOTA_SYSTEM_ADDRESS.md new file mode 100644 index 00000000000..7e37bcfa041 --- /dev/null +++ b/docs/content/ts-sdk/api/utils/variables/IOTA_SYSTEM_ADDRESS.md @@ -0,0 +1,3 @@ +# Variable: IOTA\_SYSTEM\_ADDRESS + +> `const` **IOTA\_SYSTEM\_ADDRESS**: `"0x3"` = `'0x3'` diff --git a/docs/content/ts-sdk/api/utils/variables/IOTA_SYSTEM_MODULE_NAME.md b/docs/content/ts-sdk/api/utils/variables/IOTA_SYSTEM_MODULE_NAME.md new file mode 100644 index 00000000000..ca2c521163a --- /dev/null +++ b/docs/content/ts-sdk/api/utils/variables/IOTA_SYSTEM_MODULE_NAME.md @@ -0,0 +1,3 @@ +# Variable: IOTA\_SYSTEM\_MODULE\_NAME + +> `const` **IOTA\_SYSTEM\_MODULE\_NAME**: `"iota_system"` = `'iota_system'` diff --git a/docs/content/ts-sdk/api/utils/variables/IOTA_SYSTEM_STATE_OBJECT_ID.md b/docs/content/ts-sdk/api/utils/variables/IOTA_SYSTEM_STATE_OBJECT_ID.md new file mode 100644 index 00000000000..d76f5c32308 --- /dev/null +++ b/docs/content/ts-sdk/api/utils/variables/IOTA_SYSTEM_STATE_OBJECT_ID.md @@ -0,0 +1,3 @@ +# Variable: IOTA\_SYSTEM\_STATE\_OBJECT\_ID + +> `const` **IOTA\_SYSTEM\_STATE\_OBJECT\_ID**: `string` diff --git a/docs/content/ts-sdk/api/utils/variables/IOTA_TYPE_ARG.md b/docs/content/ts-sdk/api/utils/variables/IOTA_TYPE_ARG.md new file mode 100644 index 00000000000..90c769bb7a7 --- /dev/null +++ b/docs/content/ts-sdk/api/utils/variables/IOTA_TYPE_ARG.md @@ -0,0 +1,3 @@ +# Variable: IOTA\_TYPE\_ARG + +> `const` **IOTA\_TYPE\_ARG**: `"0x2::iota::IOTA"` diff --git a/docs/content/ts-sdk/api/utils/variables/MOVE_STDLIB_ADDRESS.md b/docs/content/ts-sdk/api/utils/variables/MOVE_STDLIB_ADDRESS.md new file mode 100644 index 00000000000..ae4d58a71c1 --- /dev/null +++ b/docs/content/ts-sdk/api/utils/variables/MOVE_STDLIB_ADDRESS.md @@ -0,0 +1,3 @@ +# Variable: MOVE\_STDLIB\_ADDRESS + +> `const` **MOVE\_STDLIB\_ADDRESS**: `"0x1"` = `'0x1'` diff --git a/docs/content/ts-sdk/api/utils/variables/NANOS_PER_IOTA.md b/docs/content/ts-sdk/api/utils/variables/NANOS_PER_IOTA.md new file mode 100644 index 00000000000..19cedc83a26 --- /dev/null +++ b/docs/content/ts-sdk/api/utils/variables/NANOS_PER_IOTA.md @@ -0,0 +1,3 @@ +# Variable: NANOS\_PER\_IOTA + +> `const` **NANOS\_PER\_IOTA**: `bigint` diff --git a/docs/content/ts-sdk/api/verify/functions/publicKeyFromIotaBytes.md b/docs/content/ts-sdk/api/verify/functions/publicKeyFromIotaBytes.md new file mode 100644 index 00000000000..03bd0e8353c --- /dev/null +++ b/docs/content/ts-sdk/api/verify/functions/publicKeyFromIotaBytes.md @@ -0,0 +1,11 @@ +# Function: publicKeyFromIotaBytes() + +> **publicKeyFromIotaBytes**(`publicKey`): [`PublicKey`](../../cryptography/classes/PublicKey.md) + +## Parameters + +• **publicKey**: `string` \| `Uint8Array` + +## Returns + +[`PublicKey`](../../cryptography/classes/PublicKey.md) diff --git a/docs/content/ts-sdk/api/verify/functions/publicKeyFromRawBytes.md b/docs/content/ts-sdk/api/verify/functions/publicKeyFromRawBytes.md new file mode 100644 index 00000000000..1653d84f622 --- /dev/null +++ b/docs/content/ts-sdk/api/verify/functions/publicKeyFromRawBytes.md @@ -0,0 +1,13 @@ +# Function: publicKeyFromRawBytes() + +> **publicKeyFromRawBytes**(`signatureScheme`, `bytes`): [`PublicKey`](../../cryptography/classes/PublicKey.md) + +## Parameters + +• **signatureScheme**: [`SignatureScheme`](../../cryptography/type-aliases/SignatureScheme.md) + +• **bytes**: `Uint8Array` + +## Returns + +[`PublicKey`](../../cryptography/classes/PublicKey.md) diff --git a/docs/content/ts-sdk/api/verify/functions/verifyPersonalMessageSignature.md b/docs/content/ts-sdk/api/verify/functions/verifyPersonalMessageSignature.md new file mode 100644 index 00000000000..f5ffbb44e69 --- /dev/null +++ b/docs/content/ts-sdk/api/verify/functions/verifyPersonalMessageSignature.md @@ -0,0 +1,13 @@ +# Function: verifyPersonalMessageSignature() + +> **verifyPersonalMessageSignature**(`message`, `signature`): `Promise`\<[`PublicKey`](../../cryptography/classes/PublicKey.md)\> + +## Parameters + +• **message**: `Uint8Array` + +• **signature**: `string` + +## Returns + +`Promise`\<[`PublicKey`](../../cryptography/classes/PublicKey.md)\> diff --git a/docs/content/ts-sdk/api/verify/functions/verifySignature.md b/docs/content/ts-sdk/api/verify/functions/verifySignature.md new file mode 100644 index 00000000000..6b15319df4d --- /dev/null +++ b/docs/content/ts-sdk/api/verify/functions/verifySignature.md @@ -0,0 +1,13 @@ +# Function: verifySignature() + +> **verifySignature**(`bytes`, `signature`): `Promise`\<[`PublicKey`](../../cryptography/classes/PublicKey.md)\> + +## Parameters + +• **bytes**: `Uint8Array` + +• **signature**: `string` + +## Returns + +`Promise`\<[`PublicKey`](../../cryptography/classes/PublicKey.md)\> diff --git a/docs/content/ts-sdk/api/verify/functions/verifyTransactionSignature.md b/docs/content/ts-sdk/api/verify/functions/verifyTransactionSignature.md new file mode 100644 index 00000000000..2f4ce54b83c --- /dev/null +++ b/docs/content/ts-sdk/api/verify/functions/verifyTransactionSignature.md @@ -0,0 +1,13 @@ +# Function: verifyTransactionSignature() + +> **verifyTransactionSignature**(`transaction`, `signature`): `Promise`\<[`PublicKey`](../../cryptography/classes/PublicKey.md)\> + +## Parameters + +• **transaction**: `Uint8Array` + +• **signature**: `string` + +## Returns + +`Promise`\<[`PublicKey`](../../cryptography/classes/PublicKey.md)\> diff --git a/docs/content/ts-sdk/api/verify/index.md b/docs/content/ts-sdk/api/verify/index.md new file mode 100644 index 00000000000..b1b20ba8ef8 --- /dev/null +++ b/docs/content/ts-sdk/api/verify/index.md @@ -0,0 +1,11 @@ +# verify + +## Index + +### Functions + +- [verifySignature](functions/verifySignature.md) +- [verifyPersonalMessageSignature](functions/verifyPersonalMessageSignature.md) +- [verifyTransactionSignature](functions/verifyTransactionSignature.md) +- [publicKeyFromRawBytes](functions/publicKeyFromRawBytes.md) +- [publicKeyFromIotaBytes](functions/publicKeyFromIotaBytes.md) diff --git a/docs/content/references/ts-sdk/bcs.mdx b/docs/content/ts-sdk/bcs.mdx similarity index 100% rename from docs/content/references/ts-sdk/bcs.mdx rename to docs/content/ts-sdk/bcs.mdx diff --git a/docs/content/references/ts-sdk/dapp-kit/create-dapp.mdx b/docs/content/ts-sdk/dapp-kit/create-dapp.mdx similarity index 100% rename from docs/content/references/ts-sdk/dapp-kit/create-dapp.mdx rename to docs/content/ts-sdk/dapp-kit/create-dapp.mdx diff --git a/docs/content/references/ts-sdk/dapp-kit/index.mdx b/docs/content/ts-sdk/dapp-kit/index.mdx similarity index 100% rename from docs/content/references/ts-sdk/dapp-kit/index.mdx rename to docs/content/ts-sdk/dapp-kit/index.mdx diff --git a/docs/content/references/ts-sdk/dapp-kit/iota-client-provider.mdx b/docs/content/ts-sdk/dapp-kit/iota-client-provider.mdx similarity index 100% rename from docs/content/references/ts-sdk/dapp-kit/iota-client-provider.mdx rename to docs/content/ts-sdk/dapp-kit/iota-client-provider.mdx diff --git a/docs/content/references/ts-sdk/dapp-kit/rpc-hooks.mdx b/docs/content/ts-sdk/dapp-kit/rpc-hooks.mdx similarity index 100% rename from docs/content/references/ts-sdk/dapp-kit/rpc-hooks.mdx rename to docs/content/ts-sdk/dapp-kit/rpc-hooks.mdx diff --git a/docs/content/references/ts-sdk/dapp-kit/themes.mdx b/docs/content/ts-sdk/dapp-kit/themes.mdx similarity index 100% rename from docs/content/references/ts-sdk/dapp-kit/themes.mdx rename to docs/content/ts-sdk/dapp-kit/themes.mdx diff --git a/docs/content/references/ts-sdk/dapp-kit/wallet-components/ConnectButton.mdx b/docs/content/ts-sdk/dapp-kit/wallet-components/ConnectButton.mdx similarity index 100% rename from docs/content/references/ts-sdk/dapp-kit/wallet-components/ConnectButton.mdx rename to docs/content/ts-sdk/dapp-kit/wallet-components/ConnectButton.mdx diff --git a/docs/content/references/ts-sdk/dapp-kit/wallet-components/ConnectModal.mdx b/docs/content/ts-sdk/dapp-kit/wallet-components/ConnectModal.mdx similarity index 100% rename from docs/content/references/ts-sdk/dapp-kit/wallet-components/ConnectModal.mdx rename to docs/content/ts-sdk/dapp-kit/wallet-components/ConnectModal.mdx diff --git a/docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useAccounts.mdx b/docs/content/ts-sdk/dapp-kit/wallet-hooks/useAccounts.mdx similarity index 100% rename from docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useAccounts.mdx rename to docs/content/ts-sdk/dapp-kit/wallet-hooks/useAccounts.mdx diff --git a/docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useAutoConnectWallet.mdx b/docs/content/ts-sdk/dapp-kit/wallet-hooks/useAutoConnectWallet.mdx similarity index 100% rename from docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useAutoConnectWallet.mdx rename to docs/content/ts-sdk/dapp-kit/wallet-hooks/useAutoConnectWallet.mdx diff --git a/docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useConnectWallet.mdx b/docs/content/ts-sdk/dapp-kit/wallet-hooks/useConnectWallet.mdx similarity index 100% rename from docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useConnectWallet.mdx rename to docs/content/ts-sdk/dapp-kit/wallet-hooks/useConnectWallet.mdx diff --git a/docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useCurrentAccount.mdx b/docs/content/ts-sdk/dapp-kit/wallet-hooks/useCurrentAccount.mdx similarity index 100% rename from docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useCurrentAccount.mdx rename to docs/content/ts-sdk/dapp-kit/wallet-hooks/useCurrentAccount.mdx diff --git a/docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useCurrentWallet.mdx b/docs/content/ts-sdk/dapp-kit/wallet-hooks/useCurrentWallet.mdx similarity index 100% rename from docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useCurrentWallet.mdx rename to docs/content/ts-sdk/dapp-kit/wallet-hooks/useCurrentWallet.mdx diff --git a/docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useDisconnectWallet.mdx b/docs/content/ts-sdk/dapp-kit/wallet-hooks/useDisconnectWallet.mdx similarity index 100% rename from docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useDisconnectWallet.mdx rename to docs/content/ts-sdk/dapp-kit/wallet-hooks/useDisconnectWallet.mdx diff --git a/docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useReportTransactionEffects.mdx b/docs/content/ts-sdk/dapp-kit/wallet-hooks/useReportTransactionEffects.mdx similarity index 100% rename from docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useReportTransactionEffects.mdx rename to docs/content/ts-sdk/dapp-kit/wallet-hooks/useReportTransactionEffects.mdx diff --git a/docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useSignAndExecuteTransaction.mdx b/docs/content/ts-sdk/dapp-kit/wallet-hooks/useSignAndExecuteTransaction.mdx similarity index 100% rename from docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useSignAndExecuteTransaction.mdx rename to docs/content/ts-sdk/dapp-kit/wallet-hooks/useSignAndExecuteTransaction.mdx diff --git a/docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useSignPersonalMessage.mdx b/docs/content/ts-sdk/dapp-kit/wallet-hooks/useSignPersonalMessage.mdx similarity index 100% rename from docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useSignPersonalMessage.mdx rename to docs/content/ts-sdk/dapp-kit/wallet-hooks/useSignPersonalMessage.mdx diff --git a/docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useSignTransaction.mdx b/docs/content/ts-sdk/dapp-kit/wallet-hooks/useSignTransaction.mdx similarity index 100% rename from docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useSignTransaction.mdx rename to docs/content/ts-sdk/dapp-kit/wallet-hooks/useSignTransaction.mdx diff --git a/docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useSwitchAccount.mdx b/docs/content/ts-sdk/dapp-kit/wallet-hooks/useSwitchAccount.mdx similarity index 100% rename from docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useSwitchAccount.mdx rename to docs/content/ts-sdk/dapp-kit/wallet-hooks/useSwitchAccount.mdx diff --git a/docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useWallets.mdx b/docs/content/ts-sdk/dapp-kit/wallet-hooks/useWallets.mdx similarity index 100% rename from docs/content/references/ts-sdk/dapp-kit/wallet-hooks/useWallets.mdx rename to docs/content/ts-sdk/dapp-kit/wallet-hooks/useWallets.mdx diff --git a/docs/content/references/ts-sdk/dapp-kit/wallet-provider.mdx b/docs/content/ts-sdk/dapp-kit/wallet-provider.mdx similarity index 100% rename from docs/content/references/ts-sdk/dapp-kit/wallet-provider.mdx rename to docs/content/ts-sdk/dapp-kit/wallet-provider.mdx diff --git a/docs/content/references/ts-sdk/kiosk/advanced-examples.mdx b/docs/content/ts-sdk/kiosk/advanced-examples.mdx similarity index 100% rename from docs/content/references/ts-sdk/kiosk/advanced-examples.mdx rename to docs/content/ts-sdk/kiosk/advanced-examples.mdx diff --git a/docs/content/references/ts-sdk/kiosk/index.mdx b/docs/content/ts-sdk/kiosk/index.mdx similarity index 100% rename from docs/content/references/ts-sdk/kiosk/index.mdx rename to docs/content/ts-sdk/kiosk/index.mdx diff --git a/docs/content/references/ts-sdk/kiosk/kiosk-client/introduction.mdx b/docs/content/ts-sdk/kiosk/kiosk-client/introduction.mdx similarity index 100% rename from docs/content/references/ts-sdk/kiosk/kiosk-client/introduction.mdx rename to docs/content/ts-sdk/kiosk/kiosk-client/introduction.mdx diff --git a/docs/content/references/ts-sdk/kiosk/kiosk-client/kiosk-transaction/examples.mdx b/docs/content/ts-sdk/kiosk/kiosk-client/kiosk-transaction/examples.mdx similarity index 100% rename from docs/content/references/ts-sdk/kiosk/kiosk-client/kiosk-transaction/examples.mdx rename to docs/content/ts-sdk/kiosk/kiosk-client/kiosk-transaction/examples.mdx diff --git a/docs/content/references/ts-sdk/kiosk/kiosk-client/kiosk-transaction/kiosk-transaction.mdx b/docs/content/ts-sdk/kiosk/kiosk-client/kiosk-transaction/kiosk-transaction.mdx similarity index 100% rename from docs/content/references/ts-sdk/kiosk/kiosk-client/kiosk-transaction/kiosk-transaction.mdx rename to docs/content/ts-sdk/kiosk/kiosk-client/kiosk-transaction/kiosk-transaction.mdx diff --git a/docs/content/references/ts-sdk/kiosk/kiosk-client/kiosk-transaction/managing.mdx b/docs/content/ts-sdk/kiosk/kiosk-client/kiosk-transaction/managing.mdx similarity index 100% rename from docs/content/references/ts-sdk/kiosk/kiosk-client/kiosk-transaction/managing.mdx rename to docs/content/ts-sdk/kiosk/kiosk-client/kiosk-transaction/managing.mdx diff --git a/docs/content/references/ts-sdk/kiosk/kiosk-client/kiosk-transaction/purchasing.mdx b/docs/content/ts-sdk/kiosk/kiosk-client/kiosk-transaction/purchasing.mdx similarity index 100% rename from docs/content/references/ts-sdk/kiosk/kiosk-client/kiosk-transaction/purchasing.mdx rename to docs/content/ts-sdk/kiosk/kiosk-client/kiosk-transaction/purchasing.mdx diff --git a/docs/content/references/ts-sdk/kiosk/kiosk-client/querying.mdx b/docs/content/ts-sdk/kiosk/kiosk-client/querying.mdx similarity index 100% rename from docs/content/references/ts-sdk/kiosk/kiosk-client/querying.mdx rename to docs/content/ts-sdk/kiosk/kiosk-client/querying.mdx diff --git a/docs/content/references/ts-sdk/kiosk/kiosk-client/transfer-policy-transaction/introduction.mdx b/docs/content/ts-sdk/kiosk/kiosk-client/transfer-policy-transaction/introduction.mdx similarity index 100% rename from docs/content/references/ts-sdk/kiosk/kiosk-client/transfer-policy-transaction/introduction.mdx rename to docs/content/ts-sdk/kiosk/kiosk-client/transfer-policy-transaction/introduction.mdx diff --git a/docs/content/references/ts-sdk/kiosk/kiosk-client/transfer-policy-transaction/using-the-manager.mdx b/docs/content/ts-sdk/kiosk/kiosk-client/transfer-policy-transaction/using-the-manager.mdx similarity index 100% rename from docs/content/references/ts-sdk/kiosk/kiosk-client/transfer-policy-transaction/using-the-manager.mdx rename to docs/content/ts-sdk/kiosk/kiosk-client/transfer-policy-transaction/using-the-manager.mdx diff --git a/docs/content/references/ts-sdk/typescript/bcs.mdx b/docs/content/ts-sdk/typescript/bcs.mdx similarity index 100% rename from docs/content/references/ts-sdk/typescript/bcs.mdx rename to docs/content/ts-sdk/typescript/bcs.mdx diff --git a/docs/content/references/ts-sdk/typescript/cryptography/keypairs.mdx b/docs/content/ts-sdk/typescript/cryptography/keypairs.mdx similarity index 98% rename from docs/content/references/ts-sdk/typescript/cryptography/keypairs.mdx rename to docs/content/ts-sdk/typescript/cryptography/keypairs.mdx index 03ef7636b9e..5a2d1af1bea 100644 --- a/docs/content/references/ts-sdk/typescript/cryptography/keypairs.mdx +++ b/docs/content/ts-sdk/typescript/cryptography/keypairs.mdx @@ -12,7 +12,7 @@ The IOTA TypeScript SDK supports three signing schemes: | ECDSA Secp256r1 | `Secp256r1Keypair` | `@iota/iota-sdk/keypairs/secp256r1` | For information on these schemes, see the -[Signatures](../../../../developer/cryptography/transaction-auth/signatures.mdx) topic. +[Signatures](../../../developer/cryptography/transaction-auth/signatures.mdx) topic. To use, import the key pair class your project uses from the `@iota/iota-sdk/keypairs` folder. For example, to use the Ed25519 scheme, import the `Ed25519Keypair` class from diff --git a/docs/content/references/ts-sdk/typescript/cryptography/multisig.mdx b/docs/content/ts-sdk/typescript/cryptography/multisig.mdx similarity index 98% rename from docs/content/references/ts-sdk/typescript/cryptography/multisig.mdx rename to docs/content/ts-sdk/typescript/cryptography/multisig.mdx index 06b7aa889a3..738827a77fc 100644 --- a/docs/content/references/ts-sdk/typescript/cryptography/multisig.mdx +++ b/docs/content/ts-sdk/typescript/cryptography/multisig.mdx @@ -1,7 +1,7 @@ # Multi-Signature Transactions The IOTA TypeScript SDK provides a `MultiSigPublicKey` class to support -[Multi-Signature](../../../../developer/cryptography/transaction-auth/multisig.mdx) (MultiSig) +[Multi-Signature](../../../developer/cryptography/transaction-auth/multisig.mdx) (MultiSig) transaction and personal message signing. This class implements the same interface as the `PublicKey` classes that [Keypairs](./keypairs.mdx) uses diff --git a/docs/content/references/ts-sdk/typescript/executors.mdx b/docs/content/ts-sdk/typescript/executors.mdx similarity index 100% rename from docs/content/references/ts-sdk/typescript/executors.mdx rename to docs/content/ts-sdk/typescript/executors.mdx diff --git a/docs/content/references/ts-sdk/typescript/faucet.mdx b/docs/content/ts-sdk/typescript/faucet.mdx similarity index 100% rename from docs/content/references/ts-sdk/typescript/faucet.mdx rename to docs/content/ts-sdk/typescript/faucet.mdx diff --git a/docs/content/references/ts-sdk/typescript/graphql.mdx b/docs/content/ts-sdk/typescript/graphql.mdx similarity index 100% rename from docs/content/references/ts-sdk/typescript/graphql.mdx rename to docs/content/ts-sdk/typescript/graphql.mdx diff --git a/docs/content/references/ts-sdk/typescript/hello-iota.mdx b/docs/content/ts-sdk/typescript/hello-iota.mdx similarity index 95% rename from docs/content/references/ts-sdk/typescript/hello-iota.mdx rename to docs/content/ts-sdk/typescript/hello-iota.mdx index 686abee55a7..942eb463727 100644 --- a/docs/content/references/ts-sdk/typescript/hello-iota.mdx +++ b/docs/content/ts-sdk/typescript/hello-iota.mdx @@ -10,7 +10,7 @@ projects. ## Before you begin You need an address on a IOTA development network (Devnet, Testnet, local). If you don't already have -an address, use the [IOTA Client CLI](../../../references/cli/client.mdx) or the +an address, use the [IOTA Client CLI](../../references/cli/client.mdx) or the IOTA Wallet browser extension to create one. You also need [Node.js](https://nodejs.org/en/download/current) and a package manager like @@ -105,5 +105,5 @@ the faucet. You can check the total IOTA for your address using the IOTA Wallet <Faucet/> -You can also use the [IOTA Client CLI](../../cli/client.mdx) to perform client +You can also use the [IOTA Client CLI](../../references/cli/client.mdx) to perform client calls on a IOTA network. \ No newline at end of file diff --git a/docs/content/references/ts-sdk/typescript/index.mdx b/docs/content/ts-sdk/typescript/index.mdx similarity index 100% rename from docs/content/references/ts-sdk/typescript/index.mdx rename to docs/content/ts-sdk/typescript/index.mdx diff --git a/docs/content/references/ts-sdk/typescript/install.mdx b/docs/content/ts-sdk/typescript/install.mdx similarity index 94% rename from docs/content/references/ts-sdk/typescript/install.mdx rename to docs/content/ts-sdk/typescript/install.mdx index c041f440d80..c18412c0d5e 100644 --- a/docs/content/references/ts-sdk/typescript/install.mdx +++ b/docs/content/ts-sdk/typescript/install.mdx @@ -16,7 +16,7 @@ npm i @iota/iota-sdk Projects developing against one of the on-chain IOTA networks (Devnet, Testnet, Mainnet) should use the base SDK published in the NPM registry (previous section) because the code aligns with the relevant JSON-RPC. If your developing against a -[local network](../../../developer/getting-started/local-network.mdx) built from the +[local network](../../developer/getting-started/local-network.mdx) built from the `main` branch of the IOTA monorepo, however, you should use the `experimental`-tagged SDK package as it contains the latest features (or a local build detailed in the section that follows). diff --git a/docs/content/references/ts-sdk/typescript/iota-client.mdx b/docs/content/ts-sdk/typescript/iota-client.mdx similarity index 98% rename from docs/content/references/ts-sdk/typescript/iota-client.mdx rename to docs/content/ts-sdk/typescript/iota-client.mdx index 1a4210cdc33..c247114639d 100644 --- a/docs/content/references/ts-sdk/typescript/iota-client.mdx +++ b/docs/content/ts-sdk/typescript/iota-client.mdx @@ -35,8 +35,8 @@ during development. In a production application, however, you should use the - `mainnet` For local development, you can run `cargo run --bin iota start --with-faucet --force-regenesis` to -spin up a local network with a local validator, a Full node, and a faucet server. Refer to -[the Local Network guide](../../../developer/getting-started/local-network.mdx) for +spin up a local network with a local validator, a full node, and a faucet server. Refer to +[the Local Network guide](../../developer/getting-started/local-network.mdx) for more information. ## Manually calling unsupported RPC methods @@ -55,7 +55,7 @@ const committeeInfo = await client.call('iotax_getCommitteeInfo', []); ``` For a full list of available RPC methods, see the -[RPC documentation](../../iota-api). +[RPC documentation](../../references/iota-api). ## Subscribing to events with IotaClient diff --git a/docs/content/references/ts-sdk/typescript/owned-object-pool/custom-split-strategy.mdx b/docs/content/ts-sdk/typescript/owned-object-pool/custom-split-strategy.mdx similarity index 100% rename from docs/content/references/ts-sdk/typescript/owned-object-pool/custom-split-strategy.mdx rename to docs/content/ts-sdk/typescript/owned-object-pool/custom-split-strategy.mdx diff --git a/docs/content/references/ts-sdk/typescript/owned-object-pool/examples.mdx b/docs/content/ts-sdk/typescript/owned-object-pool/examples.mdx similarity index 100% rename from docs/content/references/ts-sdk/typescript/owned-object-pool/examples.mdx rename to docs/content/ts-sdk/typescript/owned-object-pool/examples.mdx diff --git a/docs/content/references/ts-sdk/typescript/owned-object-pool/index.mdx b/docs/content/ts-sdk/typescript/owned-object-pool/index.mdx similarity index 100% rename from docs/content/references/ts-sdk/typescript/owned-object-pool/index.mdx rename to docs/content/ts-sdk/typescript/owned-object-pool/index.mdx diff --git a/docs/content/references/ts-sdk/typescript/owned-object-pool/local-development.mdx b/docs/content/ts-sdk/typescript/owned-object-pool/local-development.mdx similarity index 98% rename from docs/content/references/ts-sdk/typescript/owned-object-pool/local-development.mdx rename to docs/content/ts-sdk/typescript/owned-object-pool/local-development.mdx index aec12c0308d..d263c3e3654 100644 --- a/docs/content/references/ts-sdk/typescript/owned-object-pool/local-development.mdx +++ b/docs/content/ts-sdk/typescript/owned-object-pool/local-development.mdx @@ -43,7 +43,7 @@ iota client switch --env testnet && iota client envs Also, make sure that your admin account (the account `iota client active-address` identifies) owns enough IOTA. You can get IOTA for a test network from the -[IOTA faucet](../../../../developer/getting-started/get-coins.mdx). +[IOTA faucet](../../../developer/getting-started/get-coins.mdx). Next, run the setup script: diff --git a/docs/content/references/ts-sdk/typescript/owned-object-pool/overview.mdx b/docs/content/ts-sdk/typescript/owned-object-pool/overview.mdx similarity index 96% rename from docs/content/references/ts-sdk/typescript/owned-object-pool/overview.mdx rename to docs/content/ts-sdk/typescript/owned-object-pool/overview.mdx index 0978437e67b..463bca18a77 100644 --- a/docs/content/references/ts-sdk/typescript/owned-object-pool/overview.mdx +++ b/docs/content/ts-sdk/typescript/owned-object-pool/overview.mdx @@ -14,7 +14,7 @@ benefit of the lower latency those objects provide. On top of that, they are imp completely avoid because the transaction's gas coin is an owned object. Finally, the situation is exacerbated by -[coin-merging](../../../../developer/iota-101/transactions/ptb/optimizing-gas-with-coin-merging.mdx) and the IOTA TypeScript SDK's +[coin-merging](../../../developer/iota-101/transactions/ptb/optimizing-gas-with-coin-merging.mdx) and the IOTA TypeScript SDK's default coin selection logic, which uses all the `0x2::coin::Coin<0x2::iota::IOTA>` objects owned by an address for every transaction's gas payment. These defaults make sending transactions from your wallet straightforward (doing so automatically cleans up coin dust), but means that developers @@ -63,7 +63,7 @@ Before you can run this example, you need to already have at least one coin of t `0x2::coin::Coin<0x2::iota::IOTA>` in your wallet for each transaction that you need to execute in parallel (in our case 10 coins). Each `Coin<IOTA>` should have enough balance to execute each transaction. If you need IOTA for a test network, you can -[use a faucet](../../../../developer/getting-started/get-coins.mdx) to mint some. +[use a faucet](../../../developer/getting-started/get-coins.mdx) to mint some. ```ts import { IotaClient } from '@iota/iota-sdk/client'; diff --git a/docs/content/references/ts-sdk/typescript/plugins.mdx b/docs/content/ts-sdk/typescript/plugins.mdx similarity index 100% rename from docs/content/references/ts-sdk/typescript/plugins.mdx rename to docs/content/ts-sdk/typescript/plugins.mdx diff --git a/docs/content/references/ts-sdk/typescript/transaction-building/basics.mdx b/docs/content/ts-sdk/typescript/transaction-building/basics.mdx similarity index 100% rename from docs/content/references/ts-sdk/typescript/transaction-building/basics.mdx rename to docs/content/ts-sdk/typescript/transaction-building/basics.mdx diff --git a/docs/content/references/ts-sdk/typescript/transaction-building/gas.mdx b/docs/content/ts-sdk/typescript/transaction-building/gas.mdx similarity index 100% rename from docs/content/references/ts-sdk/typescript/transaction-building/gas.mdx rename to docs/content/ts-sdk/typescript/transaction-building/gas.mdx diff --git a/docs/content/references/ts-sdk/typescript/transaction-building/intents.mdx b/docs/content/ts-sdk/typescript/transaction-building/intents.mdx similarity index 100% rename from docs/content/references/ts-sdk/typescript/transaction-building/intents.mdx rename to docs/content/ts-sdk/typescript/transaction-building/intents.mdx diff --git a/docs/content/references/ts-sdk/typescript/transaction-building/offline.mdx b/docs/content/ts-sdk/typescript/transaction-building/offline.mdx similarity index 100% rename from docs/content/references/ts-sdk/typescript/transaction-building/offline.mdx rename to docs/content/ts-sdk/typescript/transaction-building/offline.mdx diff --git a/docs/content/references/ts-sdk/typescript/transaction-building/sponsored-transactions.mdx b/docs/content/ts-sdk/typescript/transaction-building/sponsored-transactions.mdx similarity index 100% rename from docs/content/references/ts-sdk/typescript/transaction-building/sponsored-transactions.mdx rename to docs/content/ts-sdk/typescript/transaction-building/sponsored-transactions.mdx diff --git a/docs/content/references/ts-sdk/typescript/utils.mdx b/docs/content/ts-sdk/typescript/utils.mdx similarity index 100% rename from docs/content/references/ts-sdk/typescript/utils.mdx rename to docs/content/ts-sdk/typescript/utils.mdx diff --git a/docs/examples/move/ctf/challenge_0/Move.toml b/docs/examples/move/ctf/challenge_0/Move.toml new file mode 100644 index 00000000000..3ac4452a944 --- /dev/null +++ b/docs/examples/move/ctf/challenge_0/Move.toml @@ -0,0 +1,36 @@ +[package] +name = "leapFrog" +edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move +# license = "" # e.g., "MIT", "GPL", "Apache 2.0" +# authors = ["..."] # e.g., ["Joe Smith (joesmith@noemail.com)", "John Snow (johnsnow@noemail.com)"] + +[dependencies] +Iota = { git = "https://github.com/iotaledger/iota.git", subdir = "crates/iota-framework/packages/iota-framework", rev = "testnet" } + +# For remote import, use the `{ git = "...", subdir = "...", rev = "..." }`. +# Revision can be a branch, a tag, and a commit hash. +# MyRemotePackage = { git = "https://some.remote/host.git", subdir = "remote/path", rev = "main" } + +# For local dependencies use `local = path`. Path is relative to the package root +# Local = { local = "../path/to" } + +# To resolve a version conflict and force a specific version for dependency +# override use `override = true` +# Override = { local = "../conflicting/version", override = true } + +[addresses] +leapFrog = "0x0" + +# Named addresses will be accessible in Move as `@name`. They're also exported: +# for example, `std = "0x1"` is exported by the Standard Library. +# alice = "0xA11CE" + +[dev-dependencies] +# The dev-dependencies section allows overriding dependencies for `--test` and +# `--dev` modes. You can introduce test-only dependencies here. +# Local = { local = "../path/to/dev-build" } + +[dev-addresses] +# The dev-addresses section allows overwriting named addresses for the `--test` +# and `--dev` modes. +# alice = "0xB0B" diff --git a/docs/examples/move/ctf/challenge_0/sources/leap_frog_nft.move b/docs/examples/move/ctf/challenge_0/sources/leap_frog_nft.move new file mode 100644 index 00000000000..9ffaf7d97f3 --- /dev/null +++ b/docs/examples/move/ctf/challenge_0/sources/leap_frog_nft.move @@ -0,0 +1,73 @@ +module leapFrog::leap_frog_nft { + use iota::url::{Self, Url}; + use std::string; + use iota::event; + + public struct LeapFrogNFT has key, store { + id: UID, + name: string::String, + description: string::String, + url: Url, + } + + public struct NFTMinted has copy, drop { + object_id: ID, + creator: address, + name: string::String, + } + + public fun name(nft: &LeapFrogNFT): &string::String { + &nft.name + } + + public fun description(nft: &LeapFrogNFT): &string::String { + &nft.description + } + + public fun url(nft: &LeapFrogNFT): &Url { + &nft.url + } + + public fun mint_to_sender( + name: vector<u8>, + description: vector<u8>, + url: vector<u8>, + recipient: address, + ctx: &mut TxContext + ) { + let sender = tx_context::sender(ctx); + let nft = LeapFrogNFT { + id: object::new(ctx), + name: string::utf8(name), + description: string::utf8(description), + url: url::new_unsafe_from_bytes(url) + }; + + event::emit(NFTMinted { + object_id: object::id(&nft), + creator: sender, + name: nft.name, + }); + + transfer::public_transfer(nft, recipient); + } + + public fun transfer( + nft: LeapFrogNFT, recipient: address, _: &mut TxContext + ) { + transfer::public_transfer(nft, recipient) + } + + public fun update_description( + nft: &mut LeapFrogNFT, + new_description: vector<u8>, + _: &mut TxContext + ) { + nft.description = string::utf8(new_description) + } + + public fun burn(nft: LeapFrogNFT, _: &mut TxContext) { + let LeapFrogNFT { id, name: _, description: _, url: _ } = nft; + object::delete(id) + } +} \ No newline at end of file diff --git a/docs/site/docusaurus.config.js b/docs/site/docusaurus.config.js index 13c95c94996..ac9d9583fdd 100644 --- a/docs/site/docusaurus.config.js +++ b/docs/site/docusaurus.config.js @@ -110,6 +110,26 @@ const config = { intentionallyNotExported: [], }, ], + [ + '@docusaurus/plugin-client-redirects', + { + createRedirects(existingPath) { + const redirects = [ + { + from: '/references/ts-sdk', + to: '/ts-sdk', + }, + ]; + let paths = []; + for (const redirect of redirects) { + if (existingPath.startsWith(redirect.to)) { + paths.push(existingPath.replace(redirect.to, redirect.from)); + } + } + return paths.length > 0 ? paths : undefined; + }, + }, + ], 'plugin-image-zoom' ], presets: [ @@ -243,7 +263,7 @@ const config = { }, { label: "TS SDK", - to: "references/ts-sdk/typescript/", + to: "ts-sdk/typescript/", }, { label: "IOTA Identity", diff --git a/docs/site/package.json b/docs/site/package.json index d8d580fffdf..19d5568dd89 100644 --- a/docs/site/package.json +++ b/docs/site/package.json @@ -23,6 +23,7 @@ "@artsy/to-title-case": "^1.1.0", "@docsearch/react": "^3.6.0", "@docusaurus/core": "3.5.2", + "@docusaurus/plugin-client-redirects": "3.5.2", "@docusaurus/preset-classic": "3.5.2", "@docusaurus/remark-plugin-npm2yarn": "^3.5.2", "@docusaurus/theme-common": "^3.5.2", diff --git a/docs/site/src/components/CTF/ctf-verifier.tsx b/docs/site/src/components/CTF/ctf-verifier.tsx index d6ee34965ca..0ba79670930 100644 --- a/docs/site/src/components/CTF/ctf-verifier.tsx +++ b/docs/site/src/components/CTF/ctf-verifier.tsx @@ -46,26 +46,27 @@ const ChallengeVerifier: React.FC<ChallengeVerifierProps> = ({ expectedObjectTyp }; return ( - <div className='flex items-center'> - <input - type="text" - value={inputText} - onChange={(e) => setInputText(e.target.value)} - placeholder="Enter Flag Object Id" - className="input-field mr-2" - /> - <button onClick={handleSubmit} className={clsx("button", { "button-disabled": loading })}> - {loading ? 'Loading...' : 'Submit'} - </button> - - {error && <p className='text-red-500 text-center mb-0 ml-2'>{error}</p>} - - {coins && ( - <div> - <h2>Result</h2> - <pre>{JSON.stringify(coins, null, 2)}</pre> - </div> - )} + <div className='bg-[#0000001a] dark:bg-[#1e1e1e] p-5 rounded-lg'> + <h3>Claim your NFT reward</h3> + <label >Flag Id <span className="red">*</span></label> + <div className='flex flex-col flex-wrap items-start mt-1'> + <input + type="text" + value={inputText} + onChange={(e) => setInputText(e.target.value)} + placeholder="Enter Flag Object Id" + className="input-field" + /> + {<p className={`text-red-500 mb-0 mt-1 text-sm ${error ? 'visible' : 'invisible'}`}>{error}</p>} + <button + onClick={handleSubmit} + className={`${clsx("button", { "button-disabled": inputText=='' || loading })} min-w-28 mt-4`} + disabled={inputText=='' || loading} + > + {loading ? 'Loading...' : 'Submit Your Challenge'} + </button> + {coins && <p className='mb-0 py-3 px-2 bg-[#353535] rounded-md'>{coins}</p>} + </div> </div> ); }; diff --git a/docs/site/src/components/CTF/mint-leap-frog-nft.tsx b/docs/site/src/components/CTF/mint-leap-frog-nft.tsx new file mode 100644 index 00000000000..5bc63e2d783 --- /dev/null +++ b/docs/site/src/components/CTF/mint-leap-frog-nft.tsx @@ -0,0 +1,151 @@ +import React, { useState, useMemo } from 'react'; +import { + IotaClientProvider, + useSignAndExecuteTransaction, + WalletProvider, +} from '@iota/dapp-kit'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { getFullnodeUrl } from '@iota/iota-sdk/client'; +import clsx from 'clsx'; +import { useConnectWallet, useWallets } from '@iota/dapp-kit'; +import Popup from './popup'; +import { handleMintLeapFrogSubmit } from "../../utils/ctf-utils" + +const NETWORKS = { + testnet: { url: getFullnodeUrl('testnet') }, +}; + +const MintLeapFrogNFT: React.FC = () => { + const [nft, setNFT] = useState({ + name:'', + description:'', + url:'', + address:'' + }); + const [coins, setCoins] = useState<string | null>(null); + const [showPopup, setShowPopup] = useState<boolean>(false); + const [loading, setLoading] = useState(false); + const [error, setError] = useState<{ + status: 'success' | 'error'; + description: string; + title: string; + }>({ + status: 'success', + description: '', + title: '', + }); + const [isValidIOTAAddress,setIsValidIOTAAddress] = useState<boolean>(true); + const wallets = useWallets(); + const { mutate } = useConnectWallet(); + const { mutate: signAndExecuteTransaction } = useSignAndExecuteTransaction(); + const regex = /^0x[a-fA-F0-9]{64}$/; + const handleSubmit = async () => { + await handleMintLeapFrogSubmit({ + nft, + wallets, + mutate, + signAndExecuteTransaction, + setLoading, + setCoins, + setError, + setShowPopup, + }); + }; + + return ( + <div className='bg-[#e5e5e5] dark:bg-[#1e1e1e] p-4 rounded-lg'> + <h3>Claim you Leap Frog NFT</h3> + <div className="flex flex-col items-start"> + <label htmlFor="name">Name <span className="red">*</span></label> + <input + type="text" + value={nft.name} + onChange={(e) => setNFT((prevState) => ({ + ...prevState, + name:e.target.value + }))} + placeholder="Enter name" + className="input-field mb-4" + /> + <label htmlFor="description">Description <span className="red">*</span></label> + <input + type="text" + value={nft.description} + onChange={(e) => setNFT((prevState) => ({ + ...prevState, + description:e.target.value + }))} + placeholder="Enter description" + className="input-field mb-4" + /> + <label htmlFor="URL">URL <span className="red">*</span></label> + <input + type="text" + value={nft.url} + onChange={(e) => setNFT((prevState) => ({ + ...prevState, + url:e.target.value + }))} + placeholder="Enter url" + className="input-field mb-4" + /> + <label htmlFor="Recipient address">Recipient address <span className="red">*</span></label> + <input + type="text" + value={nft.address} + onChange={(e) => { + setNFT((prevState) => ({ + ...prevState, + address:e.target.value + })) + setIsValidIOTAAddress(regex.test(e.target.value)) + }} + placeholder="Enter recipient address" + className="input-field" + /> + <span className={`red text-sm ${!isValidIOTAAddress ? 'visible' : 'invisible'} mb-4`}>Enter a valid IOTA address</span> + <button + onClick={handleSubmit} + className={`${clsx('button', { 'button-disabled': loading })} p-3 min-w-[12.5rem]`} + disabled={loading|| coins==="Congratulations! You have successfully completed this level!" || nft.name==='' || nft.description==='' || nft.url==='' || nft.address==='' || !isValidIOTAAddress} + > + {loading ? 'Loading...' : 'Submit Challenge'} + </button> + </div> + <div className="flex items-center"> + {coins && !loading && <pre className="mt-2 mb-0 p-3">{coins}</pre>} + </div> + {showPopup && ( + <Popup + status={error.status} + description={error.description} + title={error.title} + setShowPopup={setShowPopup} + showPopup={showPopup} + /> + )} + </div> + ); +}; + +const withProviders = (Component: React.FC) => { + return () => { + if (typeof window === 'undefined') { + return null; + } + + const queryClient = useMemo(() => new QueryClient(), []); + + return ( + <QueryClientProvider client={queryClient}> + <IotaClientProvider networks={NETWORKS}> + <WalletProvider> + <Component/> + </WalletProvider> + </IotaClientProvider> + </QueryClientProvider> + ); + }; +}; + +export default withProviders(MintLeapFrogNFT); \ No newline at end of file diff --git a/docs/site/src/components/CTF/popup.tsx b/docs/site/src/components/CTF/popup.tsx new file mode 100644 index 00000000000..b8eb42e14b1 --- /dev/null +++ b/docs/site/src/components/CTF/popup.tsx @@ -0,0 +1,53 @@ +import React from 'react' + +interface PropTypes { + status: 'success' | 'error', + description: string, + title: string, + setShowPopup: React.Dispatch<React.SetStateAction<boolean>>, + showPopup: boolean +} + +const Popup = ({ status, description, title, setShowPopup, showPopup }: PropTypes) => { + return ( + <div className="relative z-10" aria-labelledby="modal-title" role="dialog" aria-modal="true"> + <div className="fixed inset-0 dark:bg-gray-500/75 bg-gray-200/75 transition-opacity" aria-hidden="true"></div> + <div className="fixed inset-0 z-10 w-screen overflow-y-auto"> + <div className="flex min-h-full items-center justify-center p-4 text-center"> + <div className="relative transform overflow-hidden rounded-lg bg-white text-center shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-md"> + <div className="bg-[#ffffff] px-6 py-10"> + <div className={`${status !== 'success' && 'hidden'} mx-auto mb-6 flex size-16 items-center justify-center rounded-full bg-green-100`}> + <svg className="size-8 text-green-500" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"> + <path stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5" /> + </svg> + </div> + <div className={`${status === 'success' && 'hidden'} mx-auto mb-6 flex size-16 items-center justify-center rounded-full bg-red-100`}> + <svg className="size-6 text-red-600" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" data-slot="icon"> + <path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z" /> + </svg> + </div> + <h3 className="text-lg font-semibold text-gray-900 mb-2" id="modal-title"> + {title} + </h3> + <p className="text-sm text-gray-500 mb-6"> + {description} + </p> + <div> + <button + type="button" + className="inline-flex cursor-pointer w-full border-none justify-center rounded-md bg-[#017195] px-4 py-2 text-sm font-semibold text-white hover:text-black" + onClick={() => setShowPopup(!showPopup)} + > + Close + </button> + </div> + </div> + </div> + </div> + </div> + </div> + + ) +} + +export default Popup \ No newline at end of file diff --git a/docs/site/src/pages/index.js b/docs/site/src/pages/index.js index 1919f7e9b1a..bf59252a2f7 100644 --- a/docs/site/src/pages/index.js +++ b/docs/site/src/pages/index.js @@ -118,7 +118,7 @@ export default function Home() { className={styles.cardLink} to="./operator/iota-full-node/overview" > - Run a IOTA Full node + Run an IOTA Full node <span className="block bg-auto bg-[url(/img/index/right-arrow.svg)]"></span> </Link> </HomeCard> diff --git a/docs/site/src/utils/ctf-utils.ts b/docs/site/src/utils/ctf-utils.ts new file mode 100644 index 00000000000..ad7f7a9c76e --- /dev/null +++ b/docs/site/src/utils/ctf-utils.ts @@ -0,0 +1,181 @@ +import { getFullnodeUrl, IotaClient } from '@iota/iota-sdk/client'; +import { Transaction } from '@iota/iota-sdk/transactions'; + +export const handleChallengeSubmit = async ({ + inputText, + expectedObjectType, + nftName, + challengeNumber, + wallets, + mutate, + signAndExecuteTransaction, + setLoading, + setCoins, + setError, + setShowPopup, +}: any) => { + setLoading(true); + setError({ + status: 'success', + description: '', + title: '', + }); + setCoins(null); + + try { + const NETWORKS = { + testnet: { url: getFullnodeUrl('testnet') }, + }; + const NFTPackageAddress = "0x61b31360fb89cae585b8cb593edde20dfc690a3f260c12693bbb8b33ebf4707d" + const client = new IotaClient({ url: NETWORKS.testnet.url }); + const result = await client.getObject({ id: inputText, options: { showType: true } }); + + if (result.data.type === expectedObjectType) { + const message = 'Congratulations! You have successfully completed this level!'; + const wallet = wallets[0]; + + mutate( + { wallet }, + { + onSuccess: () => { + const tx = () => { + const tx = new Transaction(); + const arg0 = new TextEncoder().encode(`Challenge_${challengeNumber}_${nftName}_NFT`); + const arg1 = new TextEncoder().encode('NFT Reward for completing challenge'); + tx.setGasBudget(50000000); + tx.moveCall({ + target: `${NFTPackageAddress}::CTF_NFT::mint_to_sender`, + arguments: [tx.pure.vector('u8', arg0), tx.pure.vector('u8', arg1)], + }); + return tx; + }; + + signAndExecuteTransaction( + { + transaction: tx(), + }, + { + onSuccess: ({ digest }: any) => { + client.waitForTransaction({ digest, options: { showEffects: true } }).then(() => { + setError({ + status: 'success', + description: 'An NFT reward was minted and transferred to your IOTA wallet address for completing the challenge.', + title: 'NFT Minted', + }); + setCoins(message); + setLoading(false); + setShowPopup(true); + }); + }, + onError: (error: any) => { + setError({ + status: 'error', + description: `Failed to execute transaction : ${error}`, + title: 'Submission failed', + }); + setLoading(false); + setShowPopup(true); + }, + } + ); + }, + } + ); + } else { + setCoins('Invalid Flag Object Id. Please try again.'); + } + } catch (err: any) { + setError({ + status: 'error', + description: err.message || 'An error occurred. Please try again.', + title: 'Submission failed', + }); + setLoading(false); + } +}; + +export const handleMintLeapFrogSubmit = async ({ + nft, + wallets, + mutate, + signAndExecuteTransaction, + setLoading, + setCoins, + setError, + setShowPopup, +}: any) => { + setLoading(true); + setError({ + status: 'success', + description: '', + title: '', + }); + setCoins(null); + + try { + const NETWORKS = { + testnet: { url: getFullnodeUrl('testnet') }, + }; + const NFTPackageAddress = "0x649884331fa662235b2c06c6eb488e5327105dded1331f6b7541ef4fdbd9eeca" + const client = new IotaClient({ url: NETWORKS.testnet.url }); + + const message = 'Congratulations! You have successfully completed this level!'; + const wallet = wallets[0]; + + mutate( + { wallet }, + { + onSuccess: () => { + const tx = () => { + const tx = new Transaction(); + const arg0 = new TextEncoder().encode(nft.name); + const arg1 = new TextEncoder().encode(nft.description); + const arg2 = new TextEncoder().encode(nft.url); + tx.setGasBudget(50000000); + tx.moveCall({ + target: `${NFTPackageAddress}::leap_frog_nft::mint_to_sender`, + arguments: [tx.pure.vector('u8', arg0), tx.pure.vector('u8', arg1), tx.pure.vector('u8', arg2), tx.pure.address(nft.address)], + }); + return tx; + }; + + signAndExecuteTransaction( + { + transaction: tx(), + }, + { + onSuccess: ({ digest }: any) => { + client.waitForTransaction({ digest, options: { showEffects: true } }).then(() => { + setError({ + status: 'success', + description: 'An NFT reward is minted to your IOTA wallet address upon completing the challenge.', + title: 'NFT Minted', + }); + setCoins(message); + setLoading(false); + setShowPopup(true); + }); + }, + onError: (error: any) => { + setError({ + status: 'error', + description: `Failed to execute transaction : ${error}`, + title: 'Submission failed', + }); + setLoading(false); + setShowPopup(true); + }, + } + ); + }, + } + ); + } catch (err: any) { + setError({ + status: 'error', + description: err.message || 'An error occurred. Please try again.', + title: 'Submission failed', + }); + setLoading(false); + } +}; \ No newline at end of file diff --git a/docs/site/static/json/developer/advanced-topics/custom-indexer.json b/docs/site/static/json/developer/advanced-topics/custom-indexer.json index 984bbe3440d..12998fe23f4 100644 --- a/docs/site/static/json/developer/advanced-topics/custom-indexer.json +++ b/docs/site/static/json/developer/advanced-topics/custom-indexer.json @@ -13,12 +13,12 @@ "answerOptions": [ { "answerText": "It prioritizes locally available checkpoint data while using remote data for backfilling or failover", "isCorrect": true }, { "answerText": "It allows running multiple ingestion daemons simultaneously for faster checkpoint processing", "isCorrect": false }, - { "answerText": "It processes checkpoints from multiple Full nodes at once, improving throughput", "isCorrect": false }, - { "answerText": "It connects directly to the IOTA mainnet without needing a local Full node", "isCorrect": false } + { "answerText": "It processes checkpoints from multiple full nodes at once, improving throughput", "isCorrect": false }, + { "answerText": "It connects directly to the IOTA mainnet without needing a local full node", "isCorrect": false } ] }, { - "questionText": "Which part of the IOTA Full node configuration allows you to enable checkpoint dumping for a local reader setup?", + "questionText": "Which part of the IOTA full node configuration allows you to enable checkpoint dumping for a local reader setup?", "answerOptions": [ { "answerText": "checkpoint-executor-config", "isCorrect": true }, { "answerText": "data-ingestion-config", "isCorrect": false }, diff --git a/docs/site/static/json/developer/cryptography/offline-signing.json b/docs/site/static/json/developer/cryptography/offline-signing.json index d9c4ef33863..2cc223844ec 100644 --- a/docs/site/static/json/developer/cryptography/offline-signing.json +++ b/docs/site/static/json/developer/cryptography/offline-signing.json @@ -12,7 +12,7 @@ "questionText": "Which command is used to execute a signed transaction in IOTA?", "answerOptions": [ { "answerText": "iota client execute-signed-tx", "isCorrect": true }, - { "answerText": "iota client transfer-iota", "isCorrect": false }, + { "answerText": "iota client pay-all-iota", "isCorrect": false }, { "answerText": "iota keytool sign", "isCorrect": false }, { "answerText": "iota client publish", "isCorrect": false } ] diff --git a/docs/site/static/json/developer/iota-101/transactions/sponsored-transactions/about-sponsored-transactions.json b/docs/site/static/json/developer/iota-101/transactions/sponsored-transactions/about-sponsored-transactions.json index 100030713f4..075e4ce865a 100644 --- a/docs/site/static/json/developer/iota-101/transactions/sponsored-transactions/about-sponsored-transactions.json +++ b/docs/site/static/json/developer/iota-101/transactions/sponsored-transactions/about-sponsored-transactions.json @@ -11,7 +11,7 @@ { "questionText": "In a user-initiated sponsored transaction, what step happens after the sponsor signs the TransactionData?", "answerOptions": [ - { "answerText": "The user submits the signed transaction directly to a Full node", "isCorrect": false }, + { "answerText": "The user submits the signed transaction directly to a full node", "isCorrect": false }, { "answerText": "The sponsor sends the TransactionData and Signature back to the user", "isCorrect": true }, { "answerText": "The transaction is broadcast to the network", "isCorrect": false }, { "answerText": "The user constructs the GasData object", "isCorrect": false } diff --git a/docs/site/static/json/node-operators/data-management.json b/docs/site/static/json/node-operators/data-management.json index 5a95a751b8e..3096b8293a6 100644 --- a/docs/site/static/json/node-operators/data-management.json +++ b/docs/site/static/json/node-operators/data-management.json @@ -1,6 +1,6 @@ [ { - "questionText": "What is the main purpose of the state sync protocol in an IOTA Full node?", + "questionText": "What is the main purpose of the state sync protocol in an IOTA full node?", "answerOptions": [ { "answerText": "To enable fast transaction submission.", "isCorrect": false }, { "answerText": "To synchronize the local state with committed checkpoints from validators.", "isCorrect": true }, @@ -9,7 +9,7 @@ ] }, { - "questionText": "Which configuration option would you set to enable aggressive pruning in your IOTA Full node?", + "questionText": "Which configuration option would you set to enable aggressive pruning in your IOTA full node?", "answerOptions": [ { "answerText": "num-epochs-to-retain: 0", "isCorrect": true }, { "answerText": "num-epochs-to-retain: 10", "isCorrect": false }, @@ -18,7 +18,7 @@ ] }, { - "questionText": "What happens when an IOTA Full node cannot retrieve checkpoints from its peers?", + "questionText": "What happens when an IOTA full node cannot retrieve checkpoints from its peers?", "answerOptions": [ { "answerText": "It stops processing new transactions.", "isCorrect": false }, { "answerText": "It falls back to downloading missing checkpoints from a pre-configured archive.", "isCorrect": true }, diff --git a/docs/site/static/json/node-operators/iota-full-node/node-setup.json b/docs/site/static/json/node-operators/iota-full-node/node-setup.json index 18c60e6b744..9f5016a4370 100644 --- a/docs/site/static/json/node-operators/iota-full-node/node-setup.json +++ b/docs/site/static/json/node-operators/iota-full-node/node-setup.json @@ -1,6 +1,6 @@ [ { - "questionText": "In the context of IOTA Full nodes, what is the significance of the 2f+1 validators during transaction processing?", + "questionText": "In the context of IOTA full nodes, what is the significance of the 2f+1 validators during transaction processing?", "answerOptions": [ { "answerText": "They ensure that transactions are signed before being sent to the network.", "isCorrect": false }, { "answerText": "They help in achieving consensus and finality for a transaction.", "isCorrect": true }, @@ -9,7 +9,7 @@ ] }, { - "questionText": "When configuring the Full node, which YAML parameter is critical for specifying the path to the database used by the node?", + "questionText": "When configuring the full node, which YAML parameter is critical for specifying the path to the database used by the node?", "answerOptions": [ { "answerText": "db-path", "isCorrect": true }, { "answerText": "data-storage", "isCorrect": false }, @@ -18,7 +18,7 @@ ] }, { - "questionText": "In the pruning configuration for an IOTA Full node, why would you set `num-epochs-to-retain` to 0?", + "questionText": "In the pruning configuration for an IOTA full node, why would you set `num-epochs-to-retain` to 0?", "answerOptions": [ { "answerText": "To retain all object versions indefinitely.", "isCorrect": false }, { "answerText": "To enable aggressive pruning of old object versions as soon as possible.", "isCorrect": true }, diff --git a/docs/site/static/json/node-operators/iota-full-node/overview.json b/docs/site/static/json/node-operators/iota-full-node/overview.json index e7ca0283c59..2aa742f3764 100644 --- a/docs/site/static/json/node-operators/iota-full-node/overview.json +++ b/docs/site/static/json/node-operators/iota-full-node/overview.json @@ -1,6 +1,6 @@ [ { - "questionText": "In the context of IOTA Full nodes, what is the significance of the 2f+1 validators during transaction processing?", + "questionText": "In the context of IOTA full nodes, what is the significance of the 2f+1 validators during transaction processing?", "answerOptions": [ { "answerText": "They ensure that transactions are signed before being sent to the network.", "isCorrect": false }, { "answerText": "They help in achieving consensus and finality for a transaction.", "isCorrect": true }, diff --git a/docs/site/static/json/node-operators/iota-full-node/pruning.json b/docs/site/static/json/node-operators/iota-full-node/pruning.json index 5cc66342e02..f7dcee2c69e 100644 --- a/docs/site/static/json/node-operators/iota-full-node/pruning.json +++ b/docs/site/static/json/node-operators/iota-full-node/pruning.json @@ -1,6 +1,6 @@ [ { - "questionText": "In the pruning configuration for an IOTA Full node, why would you set `num-epochs-to-retain` to 0?", + "questionText": "In the pruning configuration for an IOTA full node, why would you set `num-epochs-to-retain` to 0?", "answerOptions": [ { "answerText": "To retain all object versions indefinitely.", "isCorrect": false }, { "answerText": "To enable aggressive pruning of old object versions as soon as possible.", "isCorrect": true }, diff --git a/docs/site/static/json/node-operators/snapshots.json b/docs/site/static/json/node-operators/snapshots.json index 03587085c46..35ea84b063e 100644 --- a/docs/site/static/json/node-operators/snapshots.json +++ b/docs/site/static/json/node-operators/snapshots.json @@ -9,7 +9,7 @@ ] }, { - "questionText": "Which command is used to restore a Full node from a RocksDB snapshot?", + "questionText": "Which command is used to restore a full node from a RocksDB snapshot?", "answerOptions": [ { "answerText": "iota-tool download-db-snapshot", "isCorrect": true }, { "answerText": "iota-tool restore-snapshot", "isCorrect": false }, @@ -18,7 +18,7 @@ ] }, { - "questionText": "What must be done before restoring a Full node using a formal snapshot?", + "questionText": "What must be done before restoring a full node using a formal snapshot?", "answerOptions": [ { "answerText": "Ensure the node is running with the latest software.", "isCorrect": false }, { "answerText": "Stop the node if it's currently running.", "isCorrect": true }, diff --git a/examples/custom-indexer/rust/remote_reader.rs b/examples/custom-indexer/rust/remote_reader.rs index 6837fb45c00..84d573188b6 100644 --- a/examples/custom-indexer/rust/remote_reader.rs +++ b/examples/custom-indexer/rust/remote_reader.rs @@ -26,7 +26,7 @@ impl Worker for CustomWorker { async fn main() -> Result<()> { let (executor, _) = setup_single_workflow( CustomWorker, - "https://checkpoints.testnet.iota.io".to_string(), + "https://checkpoints.testnet.iota.cafe".to_string(), 0, // initial checkpoint number 5, // concurrency None, // extra reader options diff --git a/examples/tic-tac-toe/ui/README.md b/examples/tic-tac-toe/ui/README.md index cad40e908a2..e6bb47f0d24 100644 --- a/examples/tic-tac-toe/ui/README.md +++ b/examples/tic-tac-toe/ui/README.md @@ -22,7 +22,7 @@ Client dApp using the following tools: - [Vite](https://vitejs.dev/) for build tooling - [Radix UI](https://www.radix-ui.com/) for pre-built UI components - [ESLint](https://eslint.org/) -- [`@iota/dapp-kit`](https://docs.iota.org/references/ts-sdk/dapp-kit) for connecting to +- [`@iota/dapp-kit`](https://docs.iota.org/ts-sdk/dapp-kit) for connecting to wallets and loading data - [pnpm](https://pnpm.io/) for package management diff --git a/external-crates/move/Cargo.toml b/external-crates/move/Cargo.toml index 553f221bceb..d883af7b0ea 100644 --- a/external-crates/move/Cargo.toml +++ b/external-crates/move/Cargo.toml @@ -76,7 +76,7 @@ prettydiff = "0.4.0" primitive-types = { version = "0.10.1", features = ["impl-serde"] } proc-macro2 = "1.0.24" proptest = "1.0.0" -proptest-derive = "0.3.0" +proptest-derive = "0.5.1" quote = "1.0.9" rand = "0.8.0" rayon = "1.5.0" diff --git a/iota-execution/latest/iota-move-natives/src/crypto/bls12381.rs b/iota-execution/latest/iota-move-natives/src/crypto/bls12381.rs index a3aaf1f845e..2b8071a5618 100644 --- a/iota-execution/latest/iota-move-natives/src/crypto/bls12381.rs +++ b/iota-execution/latest/iota-move-natives/src/crypto/bls12381.rs @@ -85,7 +85,7 @@ pub fn bls12381_min_sig_verify( * (msg_ref.len() as u64).into() + bls12381_bls12381_min_sig_verify_cost_params .bls12381_bls12381_min_sig_verify_msg_cost_per_block - * (((msg_ref.len() + BLS12381_BLOCK_SIZE - 1) / BLS12381_BLOCK_SIZE) as u64).into() + * (msg_ref.len().div_ceil(BLS12381_BLOCK_SIZE) as u64).into() ); let cost = context.gas_used(); @@ -173,7 +173,7 @@ pub fn bls12381_min_pk_verify( * (msg_ref.len() as u64).into() + bls12381_bls12381_min_pk_verify_cost_params .bls12381_bls12381_min_pk_verify_msg_cost_per_block - * (((msg_ref.len() + BLS12381_BLOCK_SIZE - 1) / BLS12381_BLOCK_SIZE) as u64).into() + * (msg_ref.len().div_ceil(BLS12381_BLOCK_SIZE) as u64).into() ); let cost = context.gas_used(); diff --git a/iota-execution/latest/iota-move-natives/src/crypto/ecdsa_k1.rs b/iota-execution/latest/iota-move-natives/src/crypto/ecdsa_k1.rs index 8ae62fe1ed8..a38e1b9a5d4 100644 --- a/iota-execution/latest/iota-move-natives/src/crypto/ecdsa_k1.rs +++ b/iota-execution/latest/iota-move-natives/src/crypto/ecdsa_k1.rs @@ -134,7 +134,7 @@ pub fn ecrecover( native_charge_gas_early_exit!( context, cost_per_byte * (msg_ref.len() as u64).into() - + cost_per_block * (((msg_ref.len() + block_size - 1) / block_size) as u64).into() + + cost_per_block * (msg_ref.len().div_ceil(block_size) as u64).into() ); let cost = context.gas_used(); @@ -297,7 +297,7 @@ pub fn secp256k1_verify( native_charge_gas_early_exit!( context, cost_per_byte * (msg_ref.len() as u64).into() - + cost_per_block * (((msg_ref.len() + block_size - 1) / block_size) as u64).into() + + cost_per_block * (msg_ref.len().div_ceil(block_size) as u64).into() ); let cost = context.gas_used(); diff --git a/iota-execution/latest/iota-move-natives/src/crypto/ecdsa_r1.rs b/iota-execution/latest/iota-move-natives/src/crypto/ecdsa_r1.rs index f680a5ad505..209b0741f8d 100644 --- a/iota-execution/latest/iota-move-natives/src/crypto/ecdsa_r1.rs +++ b/iota-execution/latest/iota-move-natives/src/crypto/ecdsa_r1.rs @@ -128,7 +128,7 @@ pub fn ecrecover( native_charge_gas_early_exit!( context, cost_per_byte * (msg_ref.len() as u64).into() - + cost_per_block * (((msg_ref.len() + block_size - 1) / block_size) as u64).into() + + cost_per_block * (msg_ref.len().div_ceil(block_size) as u64).into() ); let cost = context.gas_used(); @@ -248,7 +248,7 @@ pub fn secp256r1_verify( native_charge_gas_early_exit!( context, cost_per_byte * (msg_ref.len() as u64).into() - + cost_per_block * (((msg_ref.len() + block_size - 1) / block_size) as u64).into() + + cost_per_block * (msg_ref.len().div_ceil(block_size) as u64).into() ); let cost = context.gas_used(); diff --git a/iota-execution/latest/iota-move-natives/src/crypto/ecvrf.rs b/iota-execution/latest/iota-move-natives/src/crypto/ecvrf.rs index ebdbf2bbd69..ad6cd2d621a 100644 --- a/iota-execution/latest/iota-move-natives/src/crypto/ecvrf.rs +++ b/iota-execution/latest/iota-move-natives/src/crypto/ecvrf.rs @@ -84,9 +84,7 @@ pub fn ecvrf_verify( ecvrf_ecvrf_verify_cost_params.ecvrf_ecvrf_verify_alpha_string_cost_per_byte * (alpha_string_len as u64).into() + ecvrf_ecvrf_verify_cost_params.ecvrf_ecvrf_verify_alpha_string_cost_per_block - * (((alpha_string_len + ECVRF_SHA512_BLOCK_SIZE - 1) / ECVRF_SHA512_BLOCK_SIZE) - as u64) - .into() + * (alpha_string_len.div_ceil(ECVRF_SHA512_BLOCK_SIZE) as u64).into() ); let cost = context.gas_used(); diff --git a/iota-execution/latest/iota-move-natives/src/crypto/ed25519.rs b/iota-execution/latest/iota-move-natives/src/crypto/ed25519.rs index abcbd502e6f..f3497f80b5d 100644 --- a/iota-execution/latest/iota-move-natives/src/crypto/ed25519.rs +++ b/iota-execution/latest/iota-move-natives/src/crypto/ed25519.rs @@ -79,7 +79,7 @@ pub fn ed25519_verify( ed25519_verify_cost_params.ed25519_ed25519_verify_msg_cost_per_byte * (msg_ref.len() as u64).into() + ed25519_verify_cost_params.ed25519_ed25519_verify_msg_cost_per_block - * (((msg_ref.len() + ED25519_BLOCK_SIZE - 1) / ED25519_BLOCK_SIZE) as u64).into() + * (msg_ref.len().div_ceil(ED25519_BLOCK_SIZE) as u64).into() ); let cost = context.gas_used(); diff --git a/iota-execution/latest/iota-move-natives/src/crypto/groth16.rs b/iota-execution/latest/iota-move-natives/src/crypto/groth16.rs index 0bb0c790a2a..ae1e6005106 100644 --- a/iota-execution/latest/iota-move-natives/src/crypto/groth16.rs +++ b/iota-execution/latest/iota-move-natives/src/crypto/groth16.rs @@ -187,16 +187,18 @@ pub fn verify_groth16_proof_internal( .groth16_verify_groth16_proof_internal_bls12381_cost_base, groth16_verify_groth16_proof_internal_cost_params .groth16_verify_groth16_proof_internal_bls12381_cost_per_public_input, - (public_proof_inputs.len() + fastcrypto_zkp::bls12381::conversions::SCALAR_SIZE - 1) - / fastcrypto_zkp::bls12381::conversions::SCALAR_SIZE, + public_proof_inputs + .len() + .div_ceil(fastcrypto_zkp::bls12381::conversions::SCALAR_SIZE), ), BN254 => ( groth16_verify_groth16_proof_internal_cost_params .groth16_verify_groth16_proof_internal_bn254_cost_base, groth16_verify_groth16_proof_internal_cost_params .groth16_verify_groth16_proof_internal_bn254_cost_per_public_input, - (public_proof_inputs.len() + fastcrypto_zkp::bn254::api::SCALAR_SIZE - 1) - / fastcrypto_zkp::bn254::api::SCALAR_SIZE, + public_proof_inputs + .len() + .div_ceil(fastcrypto_zkp::bn254::api::SCALAR_SIZE), ), _ => { // Charge for failure but dont fail if we run out of gas otherwise the actual diff --git a/iota-execution/latest/iota-move-natives/src/crypto/hash.rs b/iota-execution/latest/iota-move-natives/src/crypto/hash.rs index 8c229194533..8276bf8a43d 100644 --- a/iota-execution/latest/iota-move-natives/src/crypto/hash.rs +++ b/iota-execution/latest/iota-move-natives/src/crypto/hash.rs @@ -46,7 +46,7 @@ fn hash<H: HashFunction<DIGEST_SIZE>, const DIGEST_SIZE: usize>( msg_cost_per_byte.mul((msg_ref.len() as u64).into()) // Round up the blocks + msg_cost_per_block - .mul((((msg_ref.len() + block_size - 1) / block_size) as u64).into()) + .mul((msg_ref.len().div_ceil(block_size) as u64).into()) ); Ok(NativeResult::ok(context.gas_used(), smallvec![ diff --git a/nre/README.md b/nre/README.md index 7ab95c31b2b..036ba18d2e9 100644 --- a/nre/README.md +++ b/nre/README.md @@ -4,11 +4,11 @@ This repo contains: -- [Iota for Node Operators](./iota_for_node_operators.md) - This documentation aggregates all the information about deploying and operating the Iota Node software for Node Operators. +- [IOTA for Node Operators](./iota_for_node_operators.md) - This documentation aggregates all the information about deploying and operating the IOTA Node software for Node Operators. - `ansible/` - An ansible playbook for standing up your node. Successful execution of the playbook will result in a systemd managed process running iota-node. You can use this or just consult the steps when provisioning your node. -- `config/` - Iota Node configuration templates. +- `config/` - IOTA Node configuration templates. - `docker/` - A docker compose configuration for standing up your node. You can use this or just consult the steps when provisioning your node. diff --git a/nre/ansible/README.md b/nre/ansible/README.md index 5b2d0d3893b..5c1791b9987 100644 --- a/nre/ansible/README.md +++ b/nre/ansible/README.md @@ -1,6 +1,6 @@ -# Configure a Linux system as a Iota Node using Ansible +# Configure a Linux system as a IOTA Node using Ansible -This is a self contained Ansible role for configuring a Linux system as a Iota Node. +This is a self-contained Ansible role for configuring a Linux system as an IOTA Node. Tested with `ansible [core 2.13.4]` and: @@ -17,7 +17,7 @@ Tested with `ansible [core 2.13.4]` and: 4. Update [validator.yaml](../config/validator.yaml) and copy it to this directory. -5. Copy the genesis.blob to this directory (should be available after the Genesis ceremony). +5. Copy the `genesis.blob` to this directory (see [Genesis](https://docs.iota.org/operator/genesis)). 6. Update the `keypair_path` var in the [Ansible Inventory](./inventory.yaml) diff --git a/nre/ansible/roles/iota-node/files/iota-node.service b/nre/ansible/roles/iota-node/files/iota-node.service index 76512d92601..d6870d55efa 100644 --- a/nre/ansible/roles/iota-node/files/iota-node.service +++ b/nre/ansible/roles/iota-node/files/iota-node.service @@ -1,5 +1,5 @@ [Unit] -Description=Iota Node +Description=IOTA Node [Service] User=iota diff --git a/nre/docker/README.md b/nre/docker/README.md index bc80d87cca3..0c06d997226 100644 --- a/nre/docker/README.md +++ b/nre/docker/README.md @@ -1,4 +1,4 @@ -# Run Iota Node using Docker Compose +# Run IOTA Node using Docker Compose Tested using: @@ -22,15 +22,15 @@ network-key-pair: path: /opt/iota/key-pairs/network.key ``` -3. Place `genesis.blob` in the same directory as [`docker-compose.yaml`](https://github.com/iotaledger/iota/blob/testnet/nre/docker/docker-compose.yaml). (available post genesis ceremony) +3. Place `genesis.blob` in the same directory as [`docker-compose.yaml`](https://github.com/iotaledger/iota/blob/testnet/nre/docker/docker-compose.yaml). (see [Genesis](https://docs.iota.org/operator/genesis)) ## Connectivity -You may need to explicitly open the ports outlined in [Iota for Node Operators](../validator-tasks#connectivity) for the required Iota Node connectivity. +You may need to explicitly open the ports outlined in [IOTA for Node Operators](../validator-tasks#connectivity) for the required IOTA Node connectivity. ## Start the node -Start Iota Node in detached mode: +Start IOTA Node in detached mode: `sudo docker compose up -d` @@ -44,7 +44,7 @@ By default, logs are stored at `/var/lib/docker/containers/[container-id]/[conta sudo docker compose logs -f validator ``` -- By default all logs are output, limit this using `--since` +- By default, all logs are output, limit this using `--since` ```shell sudo docker logs --since 10m -f validator @@ -52,7 +52,7 @@ sudo docker logs --since 10m -f validator ## Storage -- What is the size of the local Iota database? +- What is the size of the local IOTA database? ```shell # get the volume location on disk @@ -61,7 +61,7 @@ sudo docker volume inspect docker_iotadb sudo du -sh /var/lib/docker/volumes/docker_iotadb/_data ``` -- Delete the local Iota databases (volume) +- Delete the local IOTA databases (volume) ```shell sudo docker-compose down -v @@ -69,7 +69,7 @@ sudo docker-compose down -v ## Updates -- **DO NOT** delete the Iota databases +- **DO NOT** delete the IOTA databases 1. Stop docker compose diff --git a/nre/helm/graphql/values.yaml b/nre/helm/graphql/values.yaml index 533e3803f73..d0fb1fb374c 100644 --- a/nre/helm/graphql/values.yaml +++ b/nre/helm/graphql/values.yaml @@ -27,7 +27,7 @@ env: RUST_BACKTRACE: value: "1" RPC_URL: - value: "https://public-rpc.mainnet.iota.io" # you will want to point this to a local fullnode instance like http://<servicename>.<namespace>.svc.cluster.local:900 + value: "https://api.mainnet.iota.cafe" # you will want to point this to a local fullnode instance like http://<servicename>.<namespace>.svc.cluster.local:900 DB_URL: valueFrom: secretKeyRef: diff --git a/nre/helm/indexer/values.reader.yaml b/nre/helm/indexer/values.reader.yaml index 3bbd6c3188b..b6049ac6258 100644 --- a/nre/helm/indexer/values.reader.yaml +++ b/nre/helm/indexer/values.reader.yaml @@ -6,9 +6,9 @@ args: [ "--db-url", "$(DB_URL)", "--rpc-client-url", - "https://public-rpc.mainnet.iota.io", + "https://api.mainnet.iota.cafe", "--remote-store-url", - "https://checkpoints.mainnet.iota.io", + "https://checkpoints.mainnet.iota.cafe", "--rpc-server-worker", ] diff --git a/nre/helm/indexer/values.writer.yaml b/nre/helm/indexer/values.writer.yaml index 1882ddf9abe..e5aa9fe495d 100644 --- a/nre/helm/indexer/values.writer.yaml +++ b/nre/helm/indexer/values.writer.yaml @@ -6,9 +6,9 @@ args: [ "--db-url", "$(DB_URL)", "--rpc-client-url", - "https://public-rpc.mainnet.iota.io", + "https://api.mainnet.iota.cafe", "--remote-store-url", - "https://checkpoints.mainnet.iota.io", + "https://checkpoints.mainnet.iota.cafe", "--fullnode-sync-worker", ] diff --git a/nre/helm/indexer/values.yaml b/nre/helm/indexer/values.yaml index 06882753a9b..f7f1bf8892f 100644 --- a/nre/helm/indexer/values.yaml +++ b/nre/helm/indexer/values.yaml @@ -27,9 +27,9 @@ env: CHECKPOINT_COMMIT_BATCH_SIZE: value: "300" RPC_CLIENT: - value: "https://public-rpc.mainnet.iota.io" + value: "https://api.mainnet.iota.cafe" REMOTE_STORE: - value: "https://checkpoints.mainnet.iota.io" + value: "https://checkpoints.mainnet.iota.cafe" DB_URL: valueFrom: secretKeyRef: diff --git a/nre/systemd/README.md b/nre/systemd/README.md index b80e9a26fb6..5a93e608618 100644 --- a/nre/systemd/README.md +++ b/nre/systemd/README.md @@ -1,4 +1,4 @@ -# Run a Iota Node using Systemd +# Run a IOTA Node using Systemd Tested using: @@ -18,29 +18,21 @@ sudo mkdir -p /opt/iota/key-pairs sudo chown -R iota:iota /opt/iota ``` -2. Install the Iota Node (iota-node) binary, two options: +2. Install the IOTA Node (iota-node) binary, two options: -- Pre-built binary stored in Amazon S3: +- Pre-built binary from [Github](https://github.com/iotaledger/iota/releases) -```shell -wget https://releases.iota.io/$IOTA_SHA/iota-node -chmod +x iota-node -sudo mv iota-node /opt/iota/bin -``` - -- Build from source: +- Build from source (select the branch you want to build from depending on the network you want to connect to): ```shell git clone https://github.com/iotaledger/iota.git && cd iota -git checkout $IOTA_SHA +git checkout [devnet|testnet|mainnet] cargo build --release --bin iota-node mv ./target/release/iota-node /opt/iota/bin/iota-node ``` 3. Copy your key-pairs into `/opt/iota/key-pairs/` -If generated during the Genesis ceremony these will be at `IotaExternal.git/iota-testnet-wave3/genesis/key-pairs/` - Make sure when you copy them they retain `iota` user permissions. To be safe you can re-run: `sudo chown -R iota:iota /opt/iota` 4. Update the node configuration file and place it in the `/opt/iota/config/` directory. @@ -56,9 +48,9 @@ network-key-pair: path: /opt/iota/key-pairs/network.key ``` -5. Place genesis.blob in `/opt/iota/config/` (should be available after the Genesis ceremony) +5. Place `genesis.blob` (see [Genesis](https://docs.iota.org/operator/genesis)) in `/opt/iota/config/` -6. Copy the iota-node systemd service unit file +6. Copy the `iota-node` systemd service unit file File: [iota-node.service](./iota-node.service) @@ -78,7 +70,7 @@ sudo systemctl enable iota-node.service ## Connectivity -You may need to explicitly open the ports outlined in [Iota for Node Operators](../validator-tasks#connectivity) for the required Iota Node connectivity. +You may need to explicitly open the ports outlined in [IOTA for Node Operators](../validator-tasks#connectivity) for the required IOTA Node connectivity. ## Start the node @@ -102,11 +94,11 @@ journalctl -u iota-node -f ## Updates -When an update is required to the Iota Node software the following procedure can be used. It is highly **unlikely** that you will want to restart with a clean database. +When an update is required to the IOTA Node software the following procedure can be used. It is highly **unlikely** that you will want to restart with a clean database. - assumes iota-node lives in `/opt/iota/bin/` -- assumes systemd service is named iota-node -- **DO NOT** delete the Iota databases +- assumes systemd service is named `iota-node` +- **DO NOT** delete the IOTA databases 1. Stop iota-node systemd service @@ -114,11 +106,7 @@ When an update is required to the Iota Node software the following procedure can sudo systemctl stop iota-node ``` -2. Fetch the new iota-node binary - -```shell -wget https://releases.iota.io/${IOTA_SHA}/iota-node -``` +2. Fetch the new `iota-node` binary from [Github](https://github.com/iotaledger/iota/releases) 3. Update and move the new binary: diff --git a/nre/systemd/iota-node.service b/nre/systemd/iota-node.service index 76512d92601..d6870d55efa 100644 --- a/nre/systemd/iota-node.service +++ b/nre/systemd/iota-node.service @@ -1,5 +1,5 @@ [Unit] -Description=Iota Node +Description=IOTA Node [Service] User=iota diff --git a/nre/validator_tasks.md b/nre/validator_tasks.md index 9384d2c4111..80547c3ee23 100644 --- a/nre/validator_tasks.md +++ b/nre/validator_tasks.md @@ -1,6 +1,6 @@ ## Overview -This document focuses on running the Iota Node software as a Validator. +This document focuses on running the IOTA Node software as a Validator. <div className="hidden-text"> @@ -21,7 +21,6 @@ This document focuses on running the Iota Node software as a Validator. - [Monitoring](#monitoring) - [Metrics](#metrics) - [Logs](#logs) - - [Dashboards](#dashboards) - [Software Updates](#software-updates) - [State Sync](#state-sync) - [Chain Operations](#chain-operations) @@ -45,25 +44,17 @@ To run an Iota Validator a machine with the following is required: ## Deployment -Iota Node can be deployed in a number of ways. +IOTA Node can be deployed in a number of ways. There are pre-built container images available in [Docker Hub](https://hub.docker.com/r/iotaledger/iota-node/tags). -And pre built `linux/amd64` binaries available in S3 that can be fetched using one of the following methods: +And pre-built `linux/amd64` binaries available in [Github](https://github.com/iotaledger/iota/releases): -```shell -wget https://releases.iota.io/$IOTA_SHA/iota-node -``` - -```shell -curl https://releases.iota.io/$IOTA_SHA/iota-node -o iota-node -``` - -To build directly from source: +To build directly from source (select the branch you want to build from depending on the network you want to connect to): ```shell git clone https://github.com/iotaledger/iota.git && cd iota -git checkout [SHA|BRANCH|TAG] +git checkout [devnet|testnet|mainnet] cargo build --release --bin iota-node ``` @@ -75,7 +66,7 @@ Configuration and guides are available for the following deployment options: ## Configuration -Iota Node runs with a single configuration file provided as an argument, example: +IOTA Node runs with a single configuration file provided as an argument, example: `./iota-node --config-path /opt/iota/config/validator.yaml`. @@ -245,12 +236,6 @@ To change the currently configured logging values: curl localhost:1337/logging -d "info" ``` -### Dashboards - -Public dashboard for network wide visibility: - -- [Iota Testnet Validators](https://metrics.iota.io/public-dashboards/9b841d63c9bf43fe8acec4f0fa991f5e) - ## Software Updates When an update is required to the Iota Node software the following process can be used. Follow the relevant Systemd or @@ -289,17 +274,7 @@ p2p-config: ## Chain Operations The following chain operations are executed using the `iota` CLI. This binary is built and provided as a release similar -to `iota-node`, examples: - -```shell -wget https://releases.iota.io/$IOTA_SHA/iota -chmod +x iota -``` - -```shell -curl https://releases.iota.io/$IOTA_SHA/iota -o iota -chmod +x iota -``` +to `iota-node` on [Github](https://github.com/iotaledger/iota/releases). It is recommended and often required that the `iota` binary release/version matches that of the deployed network. diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dc5cd8b2bf3..7a2de24440b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -259,6 +259,9 @@ importers: formik: specifier: ^2.4.2 version: 2.4.6(react@18.3.1) + idb-keyval: + specifier: ^6.2.1 + version: 6.2.1 qrcode.react: specifier: ^4.0.1 version: 4.0.1(react@18.3.1) @@ -1326,6 +1329,9 @@ importers: '@docusaurus/core': specifier: 3.5.2 version: 3.5.2(@docusaurus/types@3.5.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@mdx-js/react@3.0.1(@types/react@18.3.9)(react@18.3.1))(eslint@8.57.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.2) + '@docusaurus/plugin-client-redirects': + specifier: 3.5.2 + version: 3.5.2(@docusaurus/types@3.5.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@mdx-js/react@3.0.1(@types/react@18.3.9)(react@18.3.1))(eslint@8.57.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.2) '@docusaurus/preset-classic': specifier: 3.5.2 version: 3.5.2(@algolia/client-search@4.24.0)(@mdx-js/react@3.0.1(@types/react@18.3.9)(react@18.3.1))(@types/react@18.3.9)(eslint@8.57.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.2) @@ -3204,6 +3210,13 @@ packages: react: '*' react-dom: '*' + '@docusaurus/plugin-client-redirects@3.5.2': + resolution: {integrity: sha512-GMU0ZNoVG1DEsZlBbwLPdh0iwibrVZiRfmdppvX17SnByCVP74mb/Nne7Ss7ALgxQLtM4IHbXi8ij90VVjAJ+Q==} + engines: {node: '>=18.0'} + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + '@docusaurus/plugin-content-blog@3.5.2': resolution: {integrity: sha512-R7ghWnMvjSf+aeNDH0K4fjyQnt5L0KzUEnUhmf1e3jZrv3wogeytZNN6n7X8yHcMsuZHPOrctQhXWnmxu+IRRg==} engines: {node: '>=18.0'} @@ -18107,6 +18120,39 @@ snapshots: - uglify-js - webpack-cli + '@docusaurus/plugin-client-redirects@3.5.2(@docusaurus/types@3.5.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@mdx-js/react@3.0.1(@types/react@18.3.9)(react@18.3.1))(eslint@8.57.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.2)': + dependencies: + '@docusaurus/core': 3.5.2(@docusaurus/types@3.5.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@mdx-js/react@3.0.1(@types/react@18.3.9)(react@18.3.1))(eslint@8.57.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.2) + '@docusaurus/logger': 3.5.2 + '@docusaurus/utils': 3.5.2(@docusaurus/types@3.5.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(typescript@5.6.2) + '@docusaurus/utils-common': 3.5.2(@docusaurus/types@3.5.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) + '@docusaurus/utils-validation': 3.5.2(@docusaurus/types@3.5.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(typescript@5.6.2) + eta: 2.2.0 + fs-extra: 11.2.0 + lodash: 4.17.21 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + tslib: 2.7.0 + transitivePeerDependencies: + - '@docusaurus/types' + - '@mdx-js/react' + - '@parcel/css' + - '@rspack/core' + - '@swc/core' + - '@swc/css' + - bufferutil + - csso + - debug + - esbuild + - eslint + - lightningcss + - supports-color + - typescript + - uglify-js + - utf-8-validate + - vue-template-compiler + - webpack-cli + '@docusaurus/plugin-content-blog@3.5.2(@docusaurus/plugin-content-docs@3.5.2(@mdx-js/react@3.0.1(@types/react@18.3.9)(react@18.3.1))(eslint@8.57.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.2))(@mdx-js/react@3.0.1(@types/react@18.3.9)(react@18.3.1))(eslint@8.57.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.2)': dependencies: '@docusaurus/core': 3.5.2(@docusaurus/types@3.5.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@mdx-js/react@3.0.1(@types/react@18.3.9)(react@18.3.1))(eslint@8.57.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.2) diff --git a/scripts/generate_files/Dockerfile b/scripts/generate_files/Dockerfile index 334aa855498..c636b270252 100644 --- a/scripts/generate_files/Dockerfile +++ b/scripts/generate_files/Dockerfile @@ -9,7 +9,7 @@ ARG USER_ID=1000 # Check if the USER_ID needs to be updated, and adjust permissions accordingly RUN if [ $USER_ID -ne 1000 ]; then \ usermod -u $USER_ID node; \ - chown -R $USER_ID /home/node; \ + chown -R node /home/node; \ fi # Install pnpm diff --git a/scripts/slipstream/config_slipstream.json b/scripts/slipstream/config_slipstream.json index 1be88eb7763..b791a03be9c 100644 --- a/scripts/slipstream/config_slipstream.json +++ b/scripts/slipstream/config_slipstream.json @@ -203,15 +203,15 @@ }, { "regex": "sdk\\.[Mm]ysten[Ll]abs\\.com\/typescript", - "replacement": "docs.iota.org/references/ts-sdk/typescript" + "replacement": "docs.iota.org/ts-sdk/typescript" }, { "regex": "sdk\\.[Mm]ysten[Ll]abs\\.com\/", - "replacement": "docs.iota.org/references/ts-sdk/" + "replacement": "docs.iota.org/ts-sdk/" }, { "regex": "sdk\\.[Mm]ysten[Ll]abs\\.com", - "replacement": "docs.iota.org/references/ts-sdk/typescript" + "replacement": "docs.iota.org/ts-sdk/typescript" }, { "regex": "[Mm]ysten[Ll]abs\\.com", diff --git a/sdk/create-dapp/README.md b/sdk/create-dapp/README.md index 5cda509fd84..54407b22446 100644 --- a/sdk/create-dapp/README.md +++ b/sdk/create-dapp/README.md @@ -31,7 +31,7 @@ you including: - [Vite](https://vitejs.dev/) - [Radix UI](https://www.radix-ui.com/) - [ESLint](https://eslint.org/) -- [`@iota/dapp-kit`](https://docs.iota.org/references/ts-sdk/dapp-kit) +- [`@iota/dapp-kit`](https://docs.iota.org/ts-sdk/dapp-kit) These templates are still new, and would love to get feedback and suggestions for improvements or future templates. Please open an issue on GitHub if you have any feedback. diff --git a/sdk/create-dapp/package.json b/sdk/create-dapp/package.json index b709ffd341d..fa6117294d6 100644 --- a/sdk/create-dapp/package.json +++ b/sdk/create-dapp/package.json @@ -2,7 +2,7 @@ "name": "@iota/create-dapp", "author": "IOTA Foundation <info@iota.org>", "description": "A CLI for creating new IOTA dApps", - "homepage": "https://docs.iota.org/references/ts-sdk/typescript/", + "homepage": "https://docs.iota.org/ts-sdk/typescript/", "version": "0.3.0", "license": "Apache-2.0", "files": [ diff --git a/sdk/create-dapp/templates/react-client-dapp/README.md b/sdk/create-dapp/templates/react-client-dapp/README.md index 0ab6d299881..80e33ab70bc 100644 --- a/sdk/create-dapp/templates/react-client-dapp/README.md +++ b/sdk/create-dapp/templates/react-client-dapp/README.md @@ -8,7 +8,7 @@ Client dApp using the following tools: - [Vite](https://vitejs.dev/) for build tooling - [Radix UI](https://www.radix-ui.com/) for pre-built UI components - [ESLint](https://eslint.org/) -- [`@iota/dapp-kit`](https://docs.iota.org/references/ts-sdk/dapp-kit) for +- [`@iota/dapp-kit`](https://docs.iota.org/ts-sdk/dapp-kit) for connecting to wallets and loading data - [pnpm](https://pnpm.io/) for package management diff --git a/sdk/create-dapp/templates/react-e2e-counter/README.md b/sdk/create-dapp/templates/react-e2e-counter/README.md index 7e7f648f195..acd475b819c 100644 --- a/sdk/create-dapp/templates/react-e2e-counter/README.md +++ b/sdk/create-dapp/templates/react-e2e-counter/README.md @@ -8,7 +8,7 @@ Client dApp using the following tools: - [Vite](https://vitejs.dev/) for build tooling - [Radix UI](https://www.radix-ui.com/) for pre-built UI components - [ESLint](https://eslint.org/) for linting -- [`@iota/dapp-kit`](https://docs.iota.org/references/ts-sdk/dapp-kit) for +- [`@iota/dapp-kit`](https://docs.iota.org/ts-sdk/dapp-kit) for connecting to wallets and loading data - [pnpm](https://pnpm.io/) for package management @@ -33,7 +33,7 @@ If you haven't set up an address in the iota client yet, you can use the following command to get a new address: ```bash -iota client new-address secp256k1 +iota client new-address --key-scheme secp256k1 ``` This well generate a new address and recover phrase for you. You can mark a diff --git a/sdk/dapp-kit/README.md b/sdk/dapp-kit/README.md index b7c36ca127d..2b52701e388 100644 --- a/sdk/dapp-kit/README.md +++ b/sdk/dapp-kit/README.md @@ -8,7 +8,7 @@ The IOTA dApp Kit is a set of React components, hooks, and utilities that make i dApp for the IOTA ecosystem. It provides hooks and components for querying data from the IOTA blockchain, and connecting to IOTA wallets. -See https://docs.iota.org/references/ts-sdk/typescript for full documentation +See https://docs.iota.org/ts-sdk/typescript for full documentation ### Core Features @@ -72,7 +72,7 @@ dApp up and running. To use our provided UI components, you will need to import the dApp Kit's CSS stylesheet into your dApp as shown below. For more information regarding customization options, check out the respective documentation pages for the components and -[themes](https://docs.iota.org/references/ts-sdk/dapp-kit/themes). +[themes](https://docs.iota.org/ts-sdk/dapp-kit/themes). ```tsx import '@iota/dapp-kit/dist/index.css'; diff --git a/sdk/dapp-kit/package.json b/sdk/dapp-kit/package.json index 096b7694d2e..062cdcf99a3 100644 --- a/sdk/dapp-kit/package.json +++ b/sdk/dapp-kit/package.json @@ -2,7 +2,7 @@ "name": "@iota/dapp-kit", "author": "IOTA Foundation <info@iota.org>", "description": "A collection of React hooks and components for interacting with the IOTA blockchain and wallets.", - "homepage": "https://docs.iota.org/references/ts-sdk/dapp-kit/", + "homepage": "https://docs.iota.org/ts-sdk/dapp-kit/", "version": "0.3.2", "license": "Apache-2.0", "files": [ diff --git a/sdk/kiosk/README.md b/sdk/kiosk/README.md index 519630aa6dd..39ed8172f18 100644 --- a/sdk/kiosk/README.md +++ b/sdk/kiosk/README.md @@ -7,7 +7,7 @@ This Kiosk SDK library provides different utilities to interact/create/manage a [Kiosk](https://github.com/iotaledger/iota/tree/develop/kiosk). -[You can read the documentation and see examples by clicking here.](https://docs.iota.org/references/ts-sdk/kiosk) +[You can read the documentation and see examples by clicking here.](https://docs.iota.org/ts-sdk/kiosk) ## Install @@ -17,7 +17,7 @@ To use the Kiosk SDK in your project, run the following command in your project npm i @iota/kiosk @iota/iota-sdk ``` -To use the Kiosk SDK, you must create a [KioskClient](https://docs.iota.org/references/ts-sdk/kiosk/kiosk-client/introduction) instance. +To use the Kiosk SDK, you must create a [KioskClient](https://docs.iota.org/ts-sdk/kiosk/kiosk-client/introduction) instance. ## Setup @@ -38,4 +38,4 @@ const kioskClient = new KioskClient({ }); ``` -You can read the KioskClient documentation to query kiosk data [here](https://docs.iota.org/references/ts-sdk/kiosk/kiosk-client/querying). +You can read the KioskClient documentation to query kiosk data [here](https://docs.iota.org/ts-sdk/kiosk/kiosk-client/querying). diff --git a/sdk/typescript/README.md b/sdk/typescript/README.md index 9018fc5c12a..3ca3b51ce9f 100644 --- a/sdk/typescript/README.md +++ b/sdk/typescript/README.md @@ -1,7 +1,7 @@ # Docs site For more complete docs, visit the -[IOTA TypeScript SDK docs](https://docs.iota.org/references/ts-sdk/typescript/) +[IOTA TypeScript SDK docs](https://docs.iota.org/ts-sdk/typescript/) # IOTA TypeScript SDK @@ -105,7 +105,7 @@ https://stackoverflow.com/questions/52676244/node-version-not-updating-after-nvm To run E2E tests against Devnet ``` -VITE_FAUCET_URL='https://faucet.devnet.iota.org:443/gas' VITE_FULLNODE_URL='https://fullnode.devnet.iota.org' pnpm --filter @iota/iota-sdk exec vitest e2e +VITE_FAUCET_URL='https://faucet.devnet.iota.cafe:443/gas' VITE_FULLNODE_URL='https://api.devnet.iota.cafe' pnpm --filter @iota/iota-sdk exec vitest e2e ``` ## Connecting to IOTA Network @@ -114,7 +114,7 @@ The `IotaClient` class provides a connection to the JSON-RPC Server and should b read-only operations. The default URLs to connect with the RPC server are: - local: http://127.0.0.1:9000 -- Devnet: https://fullnode.devnet.iota.org +- Devnet: https://api.devnet.iota.cafe ```typescript import { getFullnodeUrl, IotaClient } from '@iota/iota-sdk/client'; @@ -176,7 +176,7 @@ await requestIotaFromFaucetV0({ ## Writing APIs For a primer for building transactions, refer to -[this guide](https://docs.iota.org/references/ts-sdk/typescript/transaction-building/basics). +[this guide](https://docs.iota.org/ts-sdk/typescript/transaction-building/basics). ### Transfer Object diff --git a/sdk/typescript/package.json b/sdk/typescript/package.json index 45cf01555b8..26fd5a2c0b5 100644 --- a/sdk/typescript/package.json +++ b/sdk/typescript/package.json @@ -2,7 +2,7 @@ "name": "@iota/iota-sdk", "author": "IOTA Foundation <info@iota.org>", "description": "IOTA TypeScript API", - "homepage": "https://docs.iota.org/references/ts-sdk/typescript/", + "homepage": "https://docs.iota.org/ts-sdk/typescript/", "version": "0.4.0", "license": "Apache-2.0", "sideEffects": false, diff --git a/sdk/typescript/test/unit/cryptography/ed25519-publickey.test.ts b/sdk/typescript/test/unit/cryptography/ed25519-publickey.test.ts index 439504d8cce..e0c99fd555d 100644 --- a/sdk/typescript/test/unit/cryptography/ed25519-publickey.test.ts +++ b/sdk/typescript/test/unit/cryptography/ed25519-publickey.test.ts @@ -8,7 +8,7 @@ import { Ed25519PublicKey } from '../../../src/keypairs/ed25519'; // Test case generated against CLI: // cargo build --bin iota -// ../iota/target/debug/iota client new-address ed25519 +// ../iota/target/debug/iota client new-address --key-scheme ed25519 // ../iota/target/debug/iota keytool list const TEST_CASES = [ { diff --git a/sdk/typescript/test/unit/cryptography/secp256k1-publickey.test.ts b/sdk/typescript/test/unit/cryptography/secp256k1-publickey.test.ts index f4ec1ec86cc..24c578c58d5 100644 --- a/sdk/typescript/test/unit/cryptography/secp256k1-publickey.test.ts +++ b/sdk/typescript/test/unit/cryptography/secp256k1-publickey.test.ts @@ -10,7 +10,7 @@ import { INVALID_SECP256K1_PUBLIC_KEY, VALID_SECP256K1_PUBLIC_KEY } from './secp // Test case generated against CLI: // cargo build --bin iota -// ../iota/target/debug/iota client new-address secp256k1 +// ../iota/target/debug/iota client new-address --key-scheme secp256k1 // ../iota/target/debug/iota keytool list const TEST_CASES = [ { diff --git a/sdk/typescript/test/unit/cryptography/secp256r1-publickey.test.ts b/sdk/typescript/test/unit/cryptography/secp256r1-publickey.test.ts index 8ff85da52b5..25daf282dea 100644 --- a/sdk/typescript/test/unit/cryptography/secp256r1-publickey.test.ts +++ b/sdk/typescript/test/unit/cryptography/secp256r1-publickey.test.ts @@ -10,7 +10,7 @@ import { INVALID_SECP256R1_PUBLIC_KEY, VALID_SECP256R1_PUBLIC_KEY } from './secp // Test case generated against CLI: // cargo build --bin iota -// ../iota/target/debug/iota client new-address secp256r1 +// ../iota/target/debug/iota client new-address --key-scheme secp256r1 // ../iota/target/debug/iota keytool list const TEST_CASES = [ {