feat: make use of spel's [#account_type] directive

This annotates custom account data as [#account_type], to allow for deserializing abritrary LEZ account data.

Closes #49
This commit is contained in:
r4bbit 2026-05-11 15:31:31 +02:00
parent e7a69f619f
commit f4a0aaf8d0
21 changed files with 4771 additions and 193 deletions

370
Cargo.lock generated
View File

@ -46,6 +46,7 @@ dependencies = [
"nssa_core 0.1.0 (git+https://github.com/logos-blockchain/logos-execution-zone.git?tag=v0.2.0-rc3)",
"risc0-zkvm",
"serde",
"spel-framework-macros",
"token_core",
]
@ -284,7 +285,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a"
dependencies = [
"num-traits",
"rand 0.8.5",
"rand 0.8.6",
]
[[package]]
@ -386,9 +387,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
version = "2.11.0"
version = "2.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af"
checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3"
[[package]]
name = "blake2"
@ -460,6 +461,15 @@ dependencies = [
"syn 2.0.117",
]
[[package]]
name = "bs58"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4"
dependencies = [
"tinyvec",
]
[[package]]
name = "bumpalo"
version = "3.20.2"
@ -544,9 +554,9 @@ dependencies = [
[[package]]
name = "cc"
version = "1.2.57"
version = "1.2.62"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a0dd1ca384932ff3641c8718a02769f1698e7563dc6974ffd03346116310423"
checksum = "a1dce859f0832a7d088c4f1119888ab94ef4b5d6795d1ce05afb7fe159d79f98"
dependencies = [
"find-msvc-tools",
"shlex",
@ -1044,9 +1054,9 @@ dependencies = [
[[package]]
name = "fastrand"
version = "2.3.0"
version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6"
[[package]]
name = "ff"
@ -1253,9 +1263,9 @@ dependencies = [
[[package]]
name = "hashbrown"
version = "0.16.1"
version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
[[package]]
name = "hashlink"
@ -1334,18 +1344,18 @@ checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
[[package]]
name = "hybrid-array"
version = "0.4.8"
version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8655f91cd07f2b9d0c24137bd650fe69617773435ee5ec83022377777ce65ef1"
checksum = "9155a582abd142abc056962c29e3ce5ff2ad5469f4246b537ed42c5deba857da"
dependencies = [
"typenum",
]
[[package]]
name = "hyper"
version = "1.8.1"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11"
checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca"
dependencies = [
"atomic-waker",
"bytes",
@ -1356,7 +1366,6 @@ dependencies = [
"httparse",
"itoa",
"pin-project-lite",
"pin-utils",
"smallvec",
"tokio",
"want",
@ -1364,15 +1373,14 @@ dependencies = [
[[package]]
name = "hyper-rustls"
version = "0.27.7"
version = "0.27.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58"
checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f"
dependencies = [
"http",
"hyper",
"hyper-util",
"rustls",
"rustls-pki-types",
"tokio",
"tokio-rustls",
"tower-service",
@ -1428,12 +1436,13 @@ dependencies = [
[[package]]
name = "icu_collections"
version = "2.1.1"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43"
checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c"
dependencies = [
"displaydoc",
"potential_utf",
"utf8_iter",
"yoke",
"zerofrom",
"zerovec",
@ -1441,9 +1450,9 @@ dependencies = [
[[package]]
name = "icu_locale_core"
version = "2.1.1"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6"
checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29"
dependencies = [
"displaydoc",
"litemap",
@ -1454,9 +1463,9 @@ dependencies = [
[[package]]
name = "icu_normalizer"
version = "2.1.1"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599"
checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4"
dependencies = [
"icu_collections",
"icu_normalizer_data",
@ -1468,15 +1477,15 @@ dependencies = [
[[package]]
name = "icu_normalizer_data"
version = "2.1.1"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a"
checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38"
[[package]]
name = "icu_properties"
version = "2.1.2"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec"
checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de"
dependencies = [
"icu_collections",
"icu_locale_core",
@ -1488,15 +1497,15 @@ dependencies = [
[[package]]
name = "icu_properties_data"
version = "2.1.2"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af"
checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14"
[[package]]
name = "icu_provider"
version = "2.1.1"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614"
checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421"
dependencies = [
"displaydoc",
"icu_locale_core",
@ -1525,6 +1534,7 @@ version = "0.1.0"
dependencies = [
"serde_json",
"spel-framework-core",
"toml",
]
[[package]]
@ -1540,9 +1550,9 @@ dependencies = [
[[package]]
name = "idna_adapter"
version = "1.2.1"
version = "1.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344"
checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714"
dependencies = [
"icu_normalizer",
"icu_properties",
@ -1567,12 +1577,12 @@ dependencies = [
[[package]]
name = "indexmap"
version = "2.13.0"
version = "2.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017"
checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9"
dependencies = [
"equivalent",
"hashbrown 0.16.1",
"hashbrown 0.17.1",
"serde",
"serde_core",
]
@ -1606,16 +1616,6 @@ version = "2.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2"
[[package]]
name = "iri-string"
version = "0.7.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a"
dependencies = [
"memchr",
"serde",
]
[[package]]
name = "itertools"
version = "0.13.0"
@ -1636,16 +1636,18 @@ dependencies = [
[[package]]
name = "itoa"
version = "1.0.17"
version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
[[package]]
name = "js-sys"
version = "0.3.91"
version = "0.3.98"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c"
checksum = "67df7112613f8bfd9150013a0314e196f4800d3201ae742489d999db2f979f08"
dependencies = [
"cfg-if",
"futures-util",
"once_cell",
"wasm-bindgen",
]
@ -1714,9 +1716,9 @@ checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2"
[[package]]
name = "libc"
version = "0.2.183"
version = "0.2.186"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d"
checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
[[package]]
name = "libm"
@ -1726,9 +1728,9 @@ checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"
[[package]]
name = "libredox"
version = "0.1.14"
version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1744e39d1d6a9948f4f388969627434e31128196de472883b39f148769bfe30a"
checksum = "e02f3bb43d335493c96bf3fd3a321600bf6bd07ed34bc64118e9293bdffea46c"
dependencies = [
"libc",
]
@ -1741,9 +1743,9 @@ checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
[[package]]
name = "litemap"
version = "0.8.1"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77"
checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0"
[[package]]
name = "log"
@ -1801,7 +1803,7 @@ version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21"
dependencies = [
"bitflags 2.11.0",
"bitflags 2.11.1",
"block",
"core-graphics-types",
"foreign-types",
@ -1812,9 +1814,9 @@ dependencies = [
[[package]]
name = "mio"
version = "1.1.1"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc"
checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1"
dependencies = [
"libc",
"wasi",
@ -1839,7 +1841,7 @@ dependencies = [
"k256",
"log",
"nssa_core 0.1.0 (git+https://github.com/logos-blockchain/logos-execution-zone.git?tag=v0.2.0-rc3)",
"rand 0.8.5",
"rand 0.8.6",
"risc0-binfmt",
"risc0-build",
"risc0-zkvm",
@ -1904,16 +1906,16 @@ dependencies = [
"num-integer",
"num-iter",
"num-traits",
"rand 0.8.5",
"rand 0.8.6",
"smallvec",
"zeroize",
]
[[package]]
name = "num-conv"
version = "0.2.0"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050"
checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967"
[[package]]
name = "num-integer"
@ -2014,12 +2016,6 @@ version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
[[package]]
name = "pin-utils"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "pkcs1"
version = "0.7.5"
@ -2055,9 +2051,9 @@ dependencies = [
[[package]]
name = "potential_utf"
version = "0.1.4"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77"
checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564"
dependencies = [
"zerovec",
]
@ -2093,7 +2089,7 @@ version = "3.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f"
dependencies = [
"toml_edit 0.25.5+spec-1.1.0",
"toml_edit 0.25.11+spec-1.1.0",
]
[[package]]
@ -2119,13 +2115,13 @@ dependencies = [
[[package]]
name = "proptest"
version = "1.10.0"
version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37566cb3fdacef14c0737f9546df7cfeadbfbc9fef10991038bf5015d0c80532"
checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744"
dependencies = [
"bitflags 2.11.0",
"bitflags 2.11.1",
"num-traits",
"rand 0.9.2",
"rand 0.9.4",
"rand_chacha 0.9.0",
"rand_xorshift",
"unarray",
@ -2183,7 +2179,7 @@ dependencies = [
"bytes",
"getrandom 0.3.4",
"lru-slab",
"rand 0.9.2",
"rand 0.9.4",
"ring",
"rustc-hash",
"rustls",
@ -2232,9 +2228,9 @@ checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
[[package]]
name = "rand"
version = "0.8.5"
version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a"
dependencies = [
"libc",
"rand_chacha 0.3.1",
@ -2243,9 +2239,9 @@ dependencies = [
[[package]]
name = "rand"
version = "0.9.2"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea"
dependencies = [
"rand_chacha 0.9.0",
"rand_core 0.9.5",
@ -2437,7 +2433,7 @@ dependencies = [
"elf",
"lazy_static",
"postcard",
"rand 0.9.2",
"rand 0.9.4",
"risc0-zkp",
"risc0-zkvm-platform",
"ruint",
@ -2670,14 +2666,14 @@ dependencies = [
[[package]]
name = "ruint"
version = "1.17.2"
version = "1.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c141e807189ad38a07276942c6623032d3753c8859c146104ac2e4d68865945a"
checksum = "0298da754d1395046b0afdc2f20ee76d29a8ae310cd30ffa84ed42acba9cb12a"
dependencies = [
"borsh",
"proptest",
"rand 0.8.5",
"rand 0.9.2",
"rand 0.8.6",
"rand 0.9.4",
"ruint-macro",
"serde_core",
"valuable",
@ -2692,9 +2688,9 @@ checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18"
[[package]]
name = "rustc-hash"
version = "2.1.1"
version = "2.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe"
[[package]]
name = "rustc_version"
@ -2711,7 +2707,7 @@ version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190"
dependencies = [
"bitflags 2.11.0",
"bitflags 2.11.1",
"errno",
"libc",
"linux-raw-sys",
@ -2720,9 +2716,9 @@ dependencies = [
[[package]]
name = "rustls"
version = "0.23.37"
version = "0.23.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "758025cb5fccfd3bc2fd74708fd4682be41d99e5dff73c377c0646c6012c73a4"
checksum = "ef86cd5876211988985292b91c96a8f2d298df24e75989a43a3c73f2d4d8168b"
dependencies = [
"once_cell",
"ring",
@ -2734,9 +2730,9 @@ dependencies = [
[[package]]
name = "rustls-pki-types"
version = "1.14.0"
version = "1.14.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd"
checksum = "30a7197ae7eb376e574fe940d068c30fe0462554a3ddbe4eca7838e049c937a9"
dependencies = [
"web-time",
"zeroize",
@ -2744,9 +2740,9 @@ dependencies = [
[[package]]
name = "rustls-webpki"
version = "0.103.9"
version = "0.103.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53"
checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e"
dependencies = [
"ring",
"rustls-pki-types",
@ -2825,9 +2821,9 @@ dependencies = [
[[package]]
name = "semver"
version = "1.0.27"
version = "1.0.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2"
checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"
dependencies = [
"serde",
"serde_core",
@ -2899,15 +2895,16 @@ dependencies = [
[[package]]
name = "serde_with"
version = "3.18.0"
version = "3.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd5414fad8e6907dbdd5bc441a50ae8d6e26151a03b1de04d89a5576de61d01f"
checksum = "e72c1c2cb7b223fafb600a619537a871c2818583d619401b785e7c0b746ccde2"
dependencies = [
"base64",
"bs58",
"chrono",
"hex",
"indexmap 1.9.3",
"indexmap 2.13.0",
"indexmap 2.14.0",
"schemars 0.9.0",
"schemars 1.2.1",
"serde_core",
@ -2918,9 +2915,9 @@ dependencies = [
[[package]]
name = "serde_with_macros"
version = "3.18.0"
version = "3.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3db8978e608f1fe7357e211969fd9abdcae80bac1ba7a3369bb7eb6b404eb65"
checksum = "b90c488738ecb4fb0262f41f43bc40efc5868d9fb744319ddf5f5317f417bfac"
dependencies = [
"darling 0.23.0",
"proc-macro2",
@ -2990,10 +2987,11 @@ dependencies = [
[[package]]
name = "spel-framework-core"
version = "0.2.0"
source = "git+https://github.com/logos-co/spel.git?tag=v0.2.0-rc.2#9005e9fbbd78b0530412f9987273f753ed32eb2d"
source = "git+https://github.com/logos-co/spel.git?rev=338129a5209e46d433bb068c96ab2eb7cc2601d9#338129a5209e46d433bb068c96ab2eb7cc2601d9"
dependencies = [
"borsh",
"nssa_core 0.1.0 (git+https://github.com/logos-blockchain/logos-execution-zone.git?tag=v0.2.0-rc1)",
"nssa_core 0.1.0 (git+https://github.com/logos-blockchain/logos-execution-zone.git?tag=v0.2.0-rc3)",
"proc-macro2",
"serde",
"serde_json",
"sha2",
@ -3001,6 +2999,19 @@ dependencies = [
"thiserror 1.0.69",
]
[[package]]
name = "spel-framework-macros"
version = "0.2.0"
source = "git+https://github.com/logos-co/spel.git?rev=338129a5209e46d433bb068c96ab2eb7cc2601d9#338129a5209e46d433bb068c96ab2eb7cc2601d9"
dependencies = [
"proc-macro2",
"quote",
"serde_json",
"sha2",
"spel-framework-core",
"syn 2.0.117",
]
[[package]]
name = "spin"
version = "0.9.8"
@ -3047,7 +3058,7 @@ name = "stablecoin_core"
version = "0.1.0"
dependencies = [
"borsh",
"nssa_core",
"nssa_core 0.1.0 (git+https://github.com/logos-blockchain/logos-execution-zone.git?tag=v0.2.0-rc1)",
"serde",
]
@ -3055,7 +3066,7 @@ dependencies = [
name = "stablecoin_program"
version = "0.1.0"
dependencies = [
"nssa_core",
"nssa_core 0.1.0 (git+https://github.com/logos-blockchain/logos-execution-zone.git?tag=v0.2.0-rc1)",
"stablecoin_core",
]
@ -3220,9 +3231,9 @@ dependencies = [
[[package]]
name = "tinystr"
version = "0.8.2"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869"
checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d"
dependencies = [
"displaydoc",
"zerovec",
@ -3259,6 +3270,7 @@ dependencies = [
"borsh",
"nssa_core 0.1.0 (git+https://github.com/logos-blockchain/logos-execution-zone.git?tag=v0.2.0-rc3)",
"serde",
"spel-framework-macros",
]
[[package]]
@ -3271,9 +3283,9 @@ dependencies = [
[[package]]
name = "tokio"
version = "1.50.0"
version = "1.52.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "27ad5e34374e03cfffefc301becb44e9dc3c17584f414349ebe29ed26661822d"
checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe"
dependencies = [
"bytes",
"libc",
@ -3329,9 +3341,9 @@ dependencies = [
[[package]]
name = "toml_datetime"
version = "1.0.1+spec-1.1.0"
version = "1.1.1+spec-1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b320e741db58cac564e26c607d3cc1fdc4a88fd36c879568c07856ed83ff3e9"
checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7"
dependencies = [
"serde_core",
]
@ -3342,7 +3354,7 @@ version = "0.22.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
dependencies = [
"indexmap 2.13.0",
"indexmap 2.14.0",
"serde",
"serde_spanned",
"toml_datetime 0.6.11",
@ -3352,23 +3364,23 @@ dependencies = [
[[package]]
name = "toml_edit"
version = "0.25.5+spec-1.1.0"
version = "0.25.11+spec-1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ca1a40644a28bce036923f6a431df0b34236949d111cc07cb6dca830c9ef2e1"
checksum = "0b59c4d22ed448339746c59b905d24568fcbb3ab65a500494f7b8c3e97739f2b"
dependencies = [
"indexmap 2.13.0",
"toml_datetime 1.0.1+spec-1.1.0",
"indexmap 2.14.0",
"toml_datetime 1.1.1+spec-1.1.0",
"toml_parser",
"winnow 1.0.0",
"winnow 1.0.2",
]
[[package]]
name = "toml_parser"
version = "1.0.10+spec-1.1.0"
version = "1.1.2+spec-1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7df25b4befd31c4816df190124375d5a20c6b6921e2cad937316de3fccd63420"
checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526"
dependencies = [
"winnow 1.0.0",
"winnow 1.0.2",
]
[[package]]
@ -3394,20 +3406,20 @@ dependencies = [
[[package]]
name = "tower-http"
version = "0.6.8"
version = "0.6.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8"
checksum = "68d6fdd9f81c2819c9a8b0e0cd91660e7746a8e6ea2ba7c6b2b057985f6bcb51"
dependencies = [
"bitflags 2.11.0",
"bitflags 2.11.1",
"bytes",
"futures-util",
"http",
"http-body",
"iri-string",
"pin-project-lite",
"tower",
"tower-layer",
"tower-service",
"url",
]
[[package]]
@ -3472,9 +3484,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
[[package]]
name = "typenum"
version = "1.19.0"
version = "1.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb"
checksum = "40ce102ab67701b8526c123c1bab5cbe42d7040ccfd0f64af1a385808d2f43de"
[[package]]
name = "unarray"
@ -3547,11 +3559,11 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
[[package]]
name = "wasip2"
version = "1.0.2+wasi-0.2.9"
version = "1.0.3+wasi-0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5"
checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6"
dependencies = [
"wit-bindgen",
"wit-bindgen 0.57.1",
]
[[package]]
@ -3560,14 +3572,14 @@ version = "0.4.0+wasi-0.3.0-rc-2026-01-06"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5"
dependencies = [
"wit-bindgen",
"wit-bindgen 0.51.0",
]
[[package]]
name = "wasm-bindgen"
version = "0.2.114"
version = "0.2.121"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e"
checksum = "49ace1d07c165b0864824eee619580c4689389afa9dc9ed3a4c75040d82e6790"
dependencies = [
"cfg-if",
"once_cell",
@ -3578,23 +3590,19 @@ dependencies = [
[[package]]
name = "wasm-bindgen-futures"
version = "0.4.64"
version = "0.4.71"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9c5522b3a28661442748e09d40924dfb9ca614b21c00d3fd135720e48b67db8"
checksum = "96492d0d3ffba25305a7dc88720d250b1401d7edca02cc3bcd50633b424673b8"
dependencies = [
"cfg-if",
"futures-util",
"js-sys",
"once_cell",
"wasm-bindgen",
"web-sys",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.114"
version = "0.2.121"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6"
checksum = "8e68e6f4afd367a562002c05637acb8578ff2dea1943df76afb9e83d177c8578"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@ -3602,9 +3610,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.114"
version = "0.2.121"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3"
checksum = "d95a9ec35c64b2a7cb35d3fead40c4238d0940c86d107136999567a4703259f2"
dependencies = [
"bumpalo",
"proc-macro2",
@ -3615,9 +3623,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.114"
version = "0.2.121"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16"
checksum = "c4e0100b01e9f0d03189a92b96772a1fb998639d981193d7dbab487302513441"
dependencies = [
"unicode-ident",
]
@ -3639,7 +3647,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909"
dependencies = [
"anyhow",
"indexmap 2.13.0",
"indexmap 2.14.0",
"wasm-encoder",
"wasmparser",
]
@ -3663,17 +3671,17 @@ version = "0.244.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe"
dependencies = [
"bitflags 2.11.0",
"bitflags 2.11.1",
"hashbrown 0.15.5",
"indexmap 2.13.0",
"indexmap 2.14.0",
"semver",
]
[[package]]
name = "web-sys"
version = "0.3.91"
version = "0.3.98"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "854ba17bb104abfb26ba36da9729addc7ce7f06f5c0f90f3c391f8461cca21f9"
checksum = "4b572dff8bcf38bad0fa19729c89bb5748b2b9b1d8be70cf90df697e3a8f32aa"
dependencies = [
"js-sys",
"wasm-bindgen",
@ -3691,9 +3699,9 @@ dependencies = [
[[package]]
name = "webpki-roots"
version = "1.0.6"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22cfaf3c063993ff62e73cb4311efde4db1efb31ab78a3e5c457939ad5cc0bed"
checksum = "52f5ee44c96cf55f1b349600768e3ece3a8f26010c05265ab73f945bb1a2eb9d"
dependencies = [
"rustls-pki-types",
]
@ -3924,9 +3932,9 @@ dependencies = [
[[package]]
name = "winnow"
version = "1.0.0"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a90e88e4667264a994d34e6d1ab2d26d398dcdca8b7f52bec8668957517fc7d8"
checksum = "2ee1708bef14716a11bae175f579062d4554d95be2c6829f518df847b7b3fdd0"
dependencies = [
"memchr",
]
@ -3940,6 +3948,12 @@ dependencies = [
"wit-bindgen-rust-macro",
]
[[package]]
name = "wit-bindgen"
version = "0.57.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e"
[[package]]
name = "wit-bindgen-core"
version = "0.51.0"
@ -3959,7 +3973,7 @@ checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21"
dependencies = [
"anyhow",
"heck",
"indexmap 2.13.0",
"indexmap 2.14.0",
"prettyplease",
"syn 2.0.117",
"wasm-metadata",
@ -3989,8 +4003,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2"
dependencies = [
"anyhow",
"bitflags 2.11.0",
"indexmap 2.13.0",
"bitflags 2.11.1",
"indexmap 2.14.0",
"log",
"serde",
"serde_derive",
@ -4009,7 +4023,7 @@ checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736"
dependencies = [
"anyhow",
"id-arena",
"indexmap 2.13.0",
"indexmap 2.14.0",
"log",
"semver",
"serde",
@ -4021,9 +4035,9 @@ dependencies = [
[[package]]
name = "writeable"
version = "0.6.2"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9"
checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4"
[[package]]
name = "yaml-rust2"
@ -4038,9 +4052,9 @@ dependencies = [
[[package]]
name = "yoke"
version = "0.8.1"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954"
checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca"
dependencies = [
"stable_deref_trait",
"yoke-derive",
@ -4049,9 +4063,9 @@ dependencies = [
[[package]]
name = "yoke-derive"
version = "0.8.1"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d"
checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e"
dependencies = [
"proc-macro2",
"quote",
@ -4061,18 +4075,18 @@ dependencies = [
[[package]]
name = "zerocopy"
version = "0.8.42"
version = "0.8.48"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2578b716f8a7a858b7f02d5bd870c14bf4ddbbcf3a4c05414ba6503640505e3"
checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9"
dependencies = [
"zerocopy-derive",
]
[[package]]
name = "zerocopy-derive"
version = "0.8.42"
version = "0.8.48"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e6cc098ea4d3bd6246687de65af3f920c430e236bee1e3bf2e441463f08a02f"
checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4"
dependencies = [
"proc-macro2",
"quote",
@ -4081,18 +4095,18 @@ dependencies = [
[[package]]
name = "zerofrom"
version = "0.1.6"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5"
checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df"
dependencies = [
"zerofrom-derive",
]
[[package]]
name = "zerofrom-derive"
version = "0.1.6"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502"
checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1"
dependencies = [
"proc-macro2",
"quote",
@ -4122,9 +4136,9 @@ dependencies = [
[[package]]
name = "zerotrie"
version = "0.2.3"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851"
checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf"
dependencies = [
"displaydoc",
"yoke",
@ -4133,9 +4147,9 @@ dependencies = [
[[package]]
name = "zerovec"
version = "0.11.5"
version = "0.11.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002"
checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239"
dependencies = [
"yoke",
"zerofrom",
@ -4144,9 +4158,9 @@ dependencies = [
[[package]]
name = "zerovec-derive"
version = "0.11.2"
version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3"
checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555"
dependencies = [
"proc-macro2",
"quote",

View File

@ -5,6 +5,7 @@ edition = "2021"
[dependencies]
nssa_core = { git = "https://github.com/logos-blockchain/logos-execution-zone.git", tag = "v0.2.0-rc3", features = ["host"] }
spel-framework-macros = { git = "https://github.com/logos-co/spel.git", rev = "338129a5209e46d433bb068c96ab2eb7cc2601d9", package = "spel-framework-macros" }
token_core = { path = "../../token/core" }
borsh = { version = "1.5", features = ["derive"] }
serde = { version = "1.0", features = ["derive"] }

View File

@ -6,6 +6,7 @@ use nssa_core::{
program::{PdaSeed, ProgramId},
};
use serde::{Deserialize, Serialize};
use spel_framework_macros::account_type;
// These stable seed bytes are part of the PDA derivation scheme and must stay unchanged for
// compatibility.
@ -120,6 +121,7 @@ pub enum Instruction {
pub const MINIMUM_LIQUIDITY: u128 = 1_000;
#[account_type]
#[derive(Clone, Default, Serialize, Deserialize, BorshSerialize, BorshDeserialize)]
pub struct PoolDefinition {
pub definition_token_a_id: AccountId,

View File

@ -51,6 +51,7 @@ dependencies = [
"nssa_core",
"risc0-zkvm",
"serde",
"spel-framework-macros",
"token_core",
]
@ -2891,7 +2892,7 @@ dependencies = [
[[package]]
name = "spel-framework"
version = "0.2.0"
source = "git+https://github.com/logos-co/spel.git?rev=668aacf354ad0754b3609820ed1b2e15e749c809#668aacf354ad0754b3609820ed1b2e15e749c809"
source = "git+https://github.com/logos-co/spel.git?rev=338129a5209e46d433bb068c96ab2eb7cc2601d9#338129a5209e46d433bb068c96ab2eb7cc2601d9"
dependencies = [
"borsh",
"nssa_core",
@ -2903,7 +2904,7 @@ dependencies = [
[[package]]
name = "spel-framework-core"
version = "0.2.0"
source = "git+https://github.com/logos-co/spel.git?rev=668aacf354ad0754b3609820ed1b2e15e749c809#668aacf354ad0754b3609820ed1b2e15e749c809"
source = "git+https://github.com/logos-co/spel.git?rev=338129a5209e46d433bb068c96ab2eb7cc2601d9#338129a5209e46d433bb068c96ab2eb7cc2601d9"
dependencies = [
"borsh",
"nssa_core",
@ -2918,7 +2919,7 @@ dependencies = [
[[package]]
name = "spel-framework-macros"
version = "0.2.0"
source = "git+https://github.com/logos-co/spel.git?rev=668aacf354ad0754b3609820ed1b2e15e749c809#668aacf354ad0754b3609820ed1b2e15e749c809"
source = "git+https://github.com/logos-co/spel.git?rev=338129a5209e46d433bb068c96ab2eb7cc2601d9#338129a5209e46d433bb068c96ab2eb7cc2601d9"
dependencies = [
"proc-macro2",
"quote",
@ -3151,6 +3152,7 @@ dependencies = [
"borsh",
"nssa_core",
"serde",
"spel-framework-macros",
]
[[package]]

View File

@ -10,7 +10,7 @@ name = "amm"
path = "src/bin/amm.rs"
[dependencies]
spel-framework = { git = "https://github.com/logos-co/spel.git", rev = "668aacf354ad0754b3609820ed1b2e15e749c809", package = "spel-framework" }
spel-framework = { git = "https://github.com/logos-co/spel.git", rev = "338129a5209e46d433bb068c96ab2eb7cc2601d9", package = "spel-framework" }
nssa_core = { git = "https://github.com/logos-blockchain/logos-execution-zone.git", tag = "v0.2.0-rc3" }
risc0-zkvm = { version = "=3.0.5", default-features = false }
amm_core = { path = "../../core" }

View File

@ -47,6 +47,7 @@ mod amm {
fees,
amm_program_id,
);
#[allow(deprecated)]
Ok(SpelOutput::with_chained_calls(post_states, chained_calls)
.with_timestamp_validity_window(..deadline))
}
@ -78,6 +79,7 @@ mod amm {
max_amount_to_add_token_a,
max_amount_to_add_token_b,
);
#[allow(deprecated)]
Ok(SpelOutput::with_chained_calls(post_states, chained_calls)
.with_timestamp_validity_window(..deadline))
}
@ -110,6 +112,7 @@ mod amm {
min_amount_to_remove_token_a,
min_amount_to_remove_token_b,
);
#[allow(deprecated)]
Ok(SpelOutput::with_chained_calls(post_states, chained_calls)
.with_timestamp_validity_window(..deadline))
}
@ -137,6 +140,7 @@ mod amm {
min_amount_out,
token_definition_id_in,
);
#[allow(deprecated)]
Ok(SpelOutput::with_chained_calls(post_states, chained_calls)
.with_timestamp_validity_window(..deadline))
}
@ -164,6 +168,7 @@ mod amm {
max_amount_in,
token_definition_id_in,
);
#[allow(deprecated)]
Ok(SpelOutput::with_chained_calls(post_states, chained_calls)
.with_timestamp_validity_window(..deadline))
}
@ -177,6 +182,7 @@ mod amm {
) -> SpelResult {
let (post_states, chained_calls) =
amm_program::sync::sync_reserves(pool, vault_a, vault_b);
#[allow(deprecated)]
Ok(SpelOutput::with_chained_calls(post_states, chained_calls))
}
}

View File

@ -338,5 +338,186 @@
"args": []
}
],
"accounts": [
{
"name": "PoolDefinition",
"type": {
"kind": "struct",
"fields": [
{
"name": "definition_token_a_id",
"type": "account_id"
},
{
"name": "definition_token_b_id",
"type": "account_id"
},
{
"name": "vault_a_id",
"type": "account_id"
},
{
"name": "vault_b_id",
"type": "account_id"
},
{
"name": "liquidity_pool_id",
"type": "account_id"
},
{
"name": "liquidity_pool_supply",
"type": "u128"
},
{
"name": "reserve_a",
"type": "u128"
},
{
"name": "reserve_b",
"type": "u128"
},
{
"name": "fees",
"type": "u128"
}
]
}
},
{
"name": "TokenDefinition",
"type": {
"kind": "enum",
"variants": [
{
"name": "Fungible",
"fields": [
{
"name": "name",
"type": "string"
},
{
"name": "total_supply",
"type": "u128"
},
{
"name": "metadata_id",
"type": {
"option": "account_id"
}
}
]
},
{
"name": "NonFungible",
"fields": [
{
"name": "name",
"type": "string"
},
{
"name": "printable_supply",
"type": "u128"
},
{
"name": "metadata_id",
"type": "account_id"
}
]
}
]
}
},
{
"name": "TokenHolding",
"type": {
"kind": "enum",
"variants": [
{
"name": "Fungible",
"fields": [
{
"name": "definition_id",
"type": "account_id"
},
{
"name": "balance",
"type": "u128"
}
]
},
{
"name": "NftMaster",
"fields": [
{
"name": "definition_id",
"type": "account_id"
},
{
"name": "print_balance",
"type": "u128"
}
]
},
{
"name": "NftPrintedCopy",
"fields": [
{
"name": "definition_id",
"type": "account_id"
},
{
"name": "owned",
"type": "bool"
}
]
}
]
}
},
{
"name": "TokenMetadata",
"type": {
"kind": "struct",
"fields": [
{
"name": "definition_id",
"type": "account_id"
},
{
"name": "standard",
"type": {
"defined": "MetadataStandard"
}
},
{
"name": "uri",
"type": "string"
},
{
"name": "creators",
"type": "string"
},
{
"name": "primary_sale_date",
"type": "u64"
}
]
}
}
],
"types": [
{
"name": "MetadataStandard",
"kind": "enum",
"variants": [
{
"name": "Simple"
},
{
"name": "Expanded"
}
]
}
],
"instruction_type": "amm_core::Instruction"
}

View File

@ -98,5 +98,142 @@
]
}
],
"accounts": [
{
"name": "TokenDefinition",
"type": {
"kind": "enum",
"variants": [
{
"name": "Fungible",
"fields": [
{
"name": "name",
"type": "string"
},
{
"name": "total_supply",
"type": "u128"
},
{
"name": "metadata_id",
"type": {
"option": "account_id"
}
}
]
},
{
"name": "NonFungible",
"fields": [
{
"name": "name",
"type": "string"
},
{
"name": "printable_supply",
"type": "u128"
},
{
"name": "metadata_id",
"type": "account_id"
}
]
}
]
}
},
{
"name": "TokenHolding",
"type": {
"kind": "enum",
"variants": [
{
"name": "Fungible",
"fields": [
{
"name": "definition_id",
"type": "account_id"
},
{
"name": "balance",
"type": "u128"
}
]
},
{
"name": "NftMaster",
"fields": [
{
"name": "definition_id",
"type": "account_id"
},
{
"name": "print_balance",
"type": "u128"
}
]
},
{
"name": "NftPrintedCopy",
"fields": [
{
"name": "definition_id",
"type": "account_id"
},
{
"name": "owned",
"type": "bool"
}
]
}
]
}
},
{
"name": "TokenMetadata",
"type": {
"kind": "struct",
"fields": [
{
"name": "definition_id",
"type": "account_id"
},
{
"name": "standard",
"type": {
"defined": "MetadataStandard"
}
},
{
"name": "uri",
"type": "string"
},
{
"name": "creators",
"type": "string"
},
{
"name": "primary_sale_date",
"type": "u64"
}
]
}
}
],
"types": [
{
"name": "MetadataStandard",
"kind": "enum",
"variants": [
{
"name": "Simple"
},
{
"name": "Expanded"
}
]
}
],
"instruction_type": "ata_core::Instruction"
}

View File

@ -172,5 +172,142 @@
"args": []
}
],
"accounts": [
{
"name": "TokenDefinition",
"type": {
"kind": "enum",
"variants": [
{
"name": "Fungible",
"fields": [
{
"name": "name",
"type": "string"
},
{
"name": "total_supply",
"type": "u128"
},
{
"name": "metadata_id",
"type": {
"option": "account_id"
}
}
]
},
{
"name": "NonFungible",
"fields": [
{
"name": "name",
"type": "string"
},
{
"name": "printable_supply",
"type": "u128"
},
{
"name": "metadata_id",
"type": "account_id"
}
]
}
]
}
},
{
"name": "TokenHolding",
"type": {
"kind": "enum",
"variants": [
{
"name": "Fungible",
"fields": [
{
"name": "definition_id",
"type": "account_id"
},
{
"name": "balance",
"type": "u128"
}
]
},
{
"name": "NftMaster",
"fields": [
{
"name": "definition_id",
"type": "account_id"
},
{
"name": "print_balance",
"type": "u128"
}
]
},
{
"name": "NftPrintedCopy",
"fields": [
{
"name": "definition_id",
"type": "account_id"
},
{
"name": "owned",
"type": "bool"
}
]
}
]
}
},
{
"name": "TokenMetadata",
"type": {
"kind": "struct",
"fields": [
{
"name": "definition_id",
"type": "account_id"
},
{
"name": "standard",
"type": {
"defined": "MetadataStandard"
}
},
{
"name": "uri",
"type": "string"
},
{
"name": "creators",
"type": "string"
},
{
"name": "primary_sale_date",
"type": "u64"
}
]
}
}
],
"types": [
{
"name": "MetadataStandard",
"kind": "enum",
"variants": [
{
"name": "Simple"
},
{
"name": "Expanded"
}
]
}
],
"instruction_type": "token_core::Instruction"
}

View File

@ -2890,7 +2890,7 @@ dependencies = [
[[package]]
name = "spel-framework"
version = "0.2.0"
source = "git+https://github.com/logos-co/spel.git?rev=668aacf354ad0754b3609820ed1b2e15e749c809#668aacf354ad0754b3609820ed1b2e15e749c809"
source = "git+https://github.com/logos-co/spel.git?rev=338129a5209e46d433bb068c96ab2eb7cc2601d9#338129a5209e46d433bb068c96ab2eb7cc2601d9"
dependencies = [
"borsh",
"nssa_core",
@ -2902,7 +2902,7 @@ dependencies = [
[[package]]
name = "spel-framework-core"
version = "0.2.0"
source = "git+https://github.com/logos-co/spel.git?rev=668aacf354ad0754b3609820ed1b2e15e749c809#668aacf354ad0754b3609820ed1b2e15e749c809"
source = "git+https://github.com/logos-co/spel.git?rev=338129a5209e46d433bb068c96ab2eb7cc2601d9#338129a5209e46d433bb068c96ab2eb7cc2601d9"
dependencies = [
"borsh",
"nssa_core",
@ -2917,7 +2917,7 @@ dependencies = [
[[package]]
name = "spel-framework-macros"
version = "0.2.0"
source = "git+https://github.com/logos-co/spel.git?rev=668aacf354ad0754b3609820ed1b2e15e749c809#668aacf354ad0754b3609820ed1b2e15e749c809"
source = "git+https://github.com/logos-co/spel.git?rev=338129a5209e46d433bb068c96ab2eb7cc2601d9#338129a5209e46d433bb068c96ab2eb7cc2601d9"
dependencies = [
"proc-macro2",
"quote",
@ -3150,6 +3150,7 @@ dependencies = [
"borsh",
"nssa_core",
"serde",
"spel-framework-macros",
]
[[package]]

View File

@ -10,7 +10,7 @@ name = "ata"
path = "src/bin/ata.rs"
[dependencies]
spel-framework = { git = "https://github.com/logos-co/spel.git", rev = "668aacf354ad0754b3609820ed1b2e15e749c809", package = "spel-framework" }
spel-framework = { git = "https://github.com/logos-co/spel.git", rev = "338129a5209e46d433bb068c96ab2eb7cc2601d9", package = "spel-framework" }
nssa_core = { git = "https://github.com/logos-blockchain/logos-execution-zone.git", tag = "v0.2.0-rc3" }
risc0-zkvm = { version = "=3.0.5", default-features = false }
ata_core = { path = "../../core" }

View File

@ -25,6 +25,7 @@ mod ata {
ata_account,
ata_program_id,
);
#[allow(deprecated)]
Ok(SpelOutput::with_chained_calls(post_states, chained_calls))
}
@ -46,6 +47,7 @@ mod ata {
ata_program_id,
amount,
);
#[allow(deprecated)]
Ok(SpelOutput::with_chained_calls(post_states, chained_calls))
}
@ -66,6 +68,7 @@ mod ata {
ata_program_id,
amount,
);
#[allow(deprecated)]
Ok(SpelOutput::with_chained_calls(post_states, chained_calls))
}
}

4032
stablecoin/methods/guest/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -12,6 +12,7 @@ mod stablecoin {
#[instruction]
pub fn noop(account: AccountWithMetadata) -> SpelResult {
#[allow(deprecated)]
Ok(SpelOutput::states_only(stablecoin_program::noop::noop(
account,
)))

View File

@ -5,5 +5,6 @@ edition = "2021"
[dependencies]
nssa_core = { git = "https://github.com/logos-blockchain/logos-execution-zone.git", tag = "v0.2.0-rc3", features = ["host"] }
spel-framework-macros = { git = "https://github.com/logos-co/spel.git", rev = "338129a5209e46d433bb068c96ab2eb7cc2601d9", package = "spel-framework-macros" }
borsh = { version = "1.5", features = ["derive"] }
serde = { version = "1.0", features = ["derive"] }

View File

@ -3,6 +3,7 @@
use borsh::{BorshDeserialize, BorshSerialize};
use nssa_core::account::{AccountId, Data};
use serde::{Deserialize, Serialize};
use spel_framework_macros::account_type;
/// Token Program Instruction.
#[derive(Serialize, Deserialize)]
@ -76,6 +77,7 @@ pub enum NewTokenDefinition {
},
}
#[account_type]
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, BorshSerialize, BorshDeserialize)]
pub enum TokenDefinition {
Fungible {
@ -110,6 +112,7 @@ impl From<&TokenDefinition> for Data {
}
}
#[account_type]
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, BorshSerialize, BorshDeserialize)]
pub enum TokenHolding {
Fungible {
@ -201,6 +204,7 @@ pub struct NewTokenMetadata {
pub creators: String,
}
#[account_type]
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, BorshSerialize, BorshDeserialize)]
pub struct TokenMetadata {
/// Token Definition account id.

View File

@ -2857,7 +2857,7 @@ dependencies = [
[[package]]
name = "spel-framework"
version = "0.2.0"
source = "git+https://github.com/logos-co/spel.git?rev=668aacf354ad0754b3609820ed1b2e15e749c809#668aacf354ad0754b3609820ed1b2e15e749c809"
source = "git+https://github.com/logos-co/spel.git?rev=338129a5209e46d433bb068c96ab2eb7cc2601d9#338129a5209e46d433bb068c96ab2eb7cc2601d9"
dependencies = [
"borsh",
"nssa_core",
@ -2869,7 +2869,7 @@ dependencies = [
[[package]]
name = "spel-framework-core"
version = "0.2.0"
source = "git+https://github.com/logos-co/spel.git?rev=668aacf354ad0754b3609820ed1b2e15e749c809#668aacf354ad0754b3609820ed1b2e15e749c809"
source = "git+https://github.com/logos-co/spel.git?rev=338129a5209e46d433bb068c96ab2eb7cc2601d9#338129a5209e46d433bb068c96ab2eb7cc2601d9"
dependencies = [
"borsh",
"nssa_core",
@ -2884,7 +2884,7 @@ dependencies = [
[[package]]
name = "spel-framework-macros"
version = "0.2.0"
source = "git+https://github.com/logos-co/spel.git?rev=668aacf354ad0754b3609820ed1b2e15e749c809#668aacf354ad0754b3609820ed1b2e15e749c809"
source = "git+https://github.com/logos-co/spel.git?rev=338129a5209e46d433bb068c96ab2eb7cc2601d9#338129a5209e46d433bb068c96ab2eb7cc2601d9"
dependencies = [
"proc-macro2",
"quote",
@ -3130,6 +3130,7 @@ dependencies = [
"borsh",
"nssa_core",
"serde",
"spel-framework-macros",
]
[[package]]

View File

@ -10,7 +10,7 @@ name = "token"
path = "src/bin/token.rs"
[dependencies]
spel-framework = { git = "https://github.com/logos-co/spel.git", rev = "668aacf354ad0754b3609820ed1b2e15e749c809", package = "spel-framework" }
spel-framework = { git = "https://github.com/logos-co/spel.git", rev = "338129a5209e46d433bb068c96ab2eb7cc2601d9", package = "spel-framework" }
nssa_core = { git = "https://github.com/logos-blockchain/logos-execution-zone.git", tag = "v0.2.0-rc3" }
risc0-zkvm = { version = "=3.0.5", default-features = false }
token_core = { path = "../../core" }

View File

@ -18,6 +18,7 @@ mod token {
recipient: AccountWithMetadata,
amount_to_transfer: u128,
) -> SpelResult {
#[allow(deprecated)]
Ok(SpelOutput::states_only(token_program::transfer::transfer(
sender,
recipient,
@ -34,6 +35,7 @@ mod token {
name: String,
total_supply: u128,
) -> SpelResult {
#[allow(deprecated)]
Ok(SpelOutput::states_only(
token_program::new_definition::new_fungible_definition(
definition_target_account,
@ -54,6 +56,7 @@ mod token {
new_definition: token_core::NewTokenDefinition,
metadata: Box<token_core::NewTokenMetadata>,
) -> SpelResult {
#[allow(deprecated)]
Ok(SpelOutput::states_only(
token_program::new_definition::new_definition_with_metadata(
definition_target_account,
@ -72,6 +75,7 @@ mod token {
definition_account: AccountWithMetadata,
account_to_initialize: AccountWithMetadata,
) -> SpelResult {
#[allow(deprecated)]
Ok(SpelOutput::states_only(
token_program::initialize::initialize_account(
definition_account,
@ -87,6 +91,7 @@ mod token {
user_holding_account: AccountWithMetadata,
amount_to_burn: u128,
) -> SpelResult {
#[allow(deprecated)]
Ok(SpelOutput::states_only(token_program::burn::burn(
definition_account,
user_holding_account,
@ -102,6 +107,7 @@ mod token {
user_holding_account: AccountWithMetadata,
amount_to_mint: u128,
) -> SpelResult {
#[allow(deprecated)]
Ok(SpelOutput::states_only(token_program::mint::mint(
definition_account,
user_holding_account,
@ -116,6 +122,7 @@ mod token {
master_account: AccountWithMetadata,
printed_account: AccountWithMetadata,
) -> SpelResult {
#[allow(deprecated)]
Ok(SpelOutput::states_only(token_program::print_nft::print_nft(
master_account,
printed_account,

View File

@ -8,7 +8,8 @@ name = "idl-gen"
path = "src/main.rs"
[dependencies]
spel-framework-core = { git = "https://github.com/logos-co/spel.git", tag = "v0.2.0-rc.2", features = [
spel-framework-core = { git = "https://github.com/logos-co/spel.git", rev = "338129a5209e46d433bb068c96ab2eb7cc2601d9", features = [
"idl-gen",
] }
serde_json = "1.0"
toml = "0.8"

View File

@ -1,4 +1,8 @@
use std::{path::PathBuf, process};
use std::{
fs,
path::{Path, PathBuf},
process,
};
fn main() {
let path: PathBuf = match std::env::args().nth(1) {
@ -9,7 +13,9 @@ fn main() {
}
};
match spel_framework_core::idl_gen::generate_idl_from_file(&path) {
let dep_dirs = find_path_dep_dirs(&path);
match spel_framework_core::idl_gen::generate_idl_from_file_with_deps(&path, &dep_dirs) {
Ok(idl) => println!("{}", serde_json::to_string_pretty(&idl).unwrap()),
Err(e) => {
eprintln!("Error: {e}");
@ -17,3 +23,44 @@ fn main() {
}
}
}
/// Return the crate-root directories of all `path = "..."` entries in the
/// `[dependencies]` table of the `Cargo.toml` nearest to `source_path`.
fn find_path_dep_dirs(source_path: &Path) -> Vec<PathBuf> {
(|| -> Option<Vec<PathBuf>> {
let manifest = find_crate_manifest(source_path)?;
let content = fs::read_to_string(&manifest).ok()?;
let value: toml::Value = toml::from_str(&content).ok()?;
let manifest_dir = manifest.parent()?;
let mut dirs = Vec::new();
if let Some(table) = value.get("dependencies").and_then(|v| v.as_table()) {
for (_name, dep) in table {
if let Some(rel) = dep.get("path").and_then(|v| v.as_str()) {
let dep_dir = manifest_dir.join(rel);
if dep_dir.is_dir() {
dirs.push(dep_dir);
}
}
}
}
Some(dirs)
})()
.unwrap_or_default()
}
/// Walk up from `start` to find the nearest `Cargo.toml`.
fn find_crate_manifest(start: &Path) -> Option<PathBuf> {
let mut dir: &Path = if start.is_file() {
start.parent()?
} else {
start
};
loop {
let candidate = dir.join("Cargo.toml");
if candidate.exists() {
return Some(candidate);
}
dir = dir.parent()?;
}
}