{"id":13652562,"url":"https://github.com/virto-network/scales","last_synced_at":"2025-12-30T05:42:17.033Z","repository":{"id":45601423,"uuid":"378154190","full_name":"virto-network/scales","owner":"virto-network","description":"SCALE Serialization","archived":true,"fork":false,"pushed_at":"2024-01-17T17:18:49.000Z","size":74,"stargazers_count":7,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-03-18T15:14:53.837Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/virto-network.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-06-18T13:09:37.000Z","updated_at":"2024-04-15T07:12:19.084Z","dependencies_parsed_at":"2024-04-15T07:12:14.844Z","dependency_job_id":"88c1bf8c-08db-4207-a37d-394f699418f8","html_url":"https://github.com/virto-network/scales","commit_stats":{"total_commits":56,"total_committers":4,"mean_commits":14.0,"dds":0.2321428571428571,"last_synced_commit":"035d71b355c4d3b34a5884b81b3f330a82f1cd33"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virto-network%2Fscales","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virto-network%2Fscales/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virto-network%2Fscales/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virto-network%2Fscales/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/virto-network","download_url":"https://codeload.github.com/virto-network/scales/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250365351,"owners_count":21418670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T02:01:00.523Z","updated_at":"2025-12-12T13:02:22.180Z","avatar_url":"https://github.com/virto-network.png","language":"Rust","funding_links":[],"categories":["SCALE Codec"],"sub_categories":[],"readme":"\u003e ⚠️ SCALES is moving to the [VirtoSDK](https://github.com/virto-network/virto-sdk)\n\n# scales - SCALE Serialization\n\nMaking use of [type information](https://github.com/paritytech/scale-info) this library allows \nconversion to/from [SCALE](https://github.com/paritytech/parity-scale-codec) encoded data, \nspecially useful when conversion is for dynamic types like JSON.\n\n### From SCALE\n\n`scales::Value` wraps the raw SCALE binary data and the type id within type registry \ngiving you an object that can be serialized to any compatible format.\n\n```rust\nlet value = scales::Value::new(scale_binary_data, type_id, \u0026type_registry);\nserde_json::to_string(value)?;\n```\n\n### To SCALE\n\nPublic methods from the `scales::serializer::*` module(feature `experimental-serializer`)\nallow for a best effort conversion of dynamic types(e.g. `serde_json::Value`) to SCALE\nbinary format. The serializer tries to be smart when interpreting the input and convert it\nto the desired format dictated by the provided type in the registry.\n\n```rust\n// simple conversion\nlet scale_data = to_vec(some_serializable_input); // or to_bytes(\u0026mut bytes, input);\n\n// with type info\nlet scale_data = to_vec_with_info(input, Some((\u0026registry, type_id)));\n\n// from an unordered list of properties that make an object\nlet input = vec![(\"prop_b\", 123), (\"prop_a\", 456)];\nlet scale_data = to_vec_from_iter(input, (\u0026registry, type_id));\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirto-network%2Fscales","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvirto-network%2Fscales","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirto-network%2Fscales/lists"}