nordnet-model
Pure data types and crypto for the Nordnet External API v2.
Zero I/O dependencies (no reqwest, no tokio, no tokio-rustls). Hosts:
auth— Ed25519 SSH-key login flow primitives plus theauth::Sessionnewtype.models— serde structs for every documented request and response shape, organised per resource group.ids— newtype wrappers for resource identifiers.error::AuthError— error type covering only whatauthcan fail at.
Both nordnet-api (REST client) and
nordnet-feed (streaming client)
depend on this crate for shared wire-typed inputs and outputs. The crate is
I/O-free and may be embedded in non-CLI consumers.
Install
Usage
use Session;
use AccountId;
let session = Session ;
let acc = from;
# let _ = ;
Sign a login challenge with an OpenSSH-format Ed25519 private key:
use auth;
let pem = read_to_string?;
let signing_key = parse_private_key_openssh?;
let signature_b64 = sign_challenge?;
# Ok::
Type strictness
- Numeric IDs use newtypes — passing an
OrderIdwhere anAccountIdis expected is a compile error. - Money is
Money { amount: Decimal, currency }— neverf64. - Timestamps are
time::OffsetDateTimewith ISO-8601 serde. - Decimal JSON form is bare numbers (
arbitrary_precision), preserved byte-equivalent across roundtrip. - Response structs do not carry
#[serde(deny_unknown_fields)]— undocumented server fields are silently ignored. Request structs keepdeny_unknown_fieldsto catch local bugs in tests.
License
Dual-licensed under MIT OR Apache-2.0.