#Typescript bindings
1 messages · Page 1 of 1 (latest)
Type aliases, as above, are not supported by the contract specification embedded into contracts. If you just use “Address” as the type it’ll work.
There’s an issue open for adding support for type aliases: https://github.com/stellar/rs-soroban-sdk/issues/1063
What did you do? I have a project that uses rust workspaces (each contract is a separate workspace member). I want to share some code between them, mostly types. repro: here is a repro https://gith...
do you consider it a hard issue to solve?
if not i'd love to tackle it. it would be a good way for me to get into the sdk
hey @wicked widget , is this going to be solved?
I just had another issue, this time when deploying the contract:
I have this type:
pub type MyNamespace = Address;
which i use for storage:
#[contracttype]
pub enum NamespacedStorage {
Main(MyNamespace, StorageKeys),
}
But when deploying the contract, it doesn't recognize MyNamespace, i get the error:
❌ error: Missing Entry MyNamespace
i noticed that it's due to some functions in the contract expecting the type as parameter:
pub fn set_namespaced(env: Env, namespace: MyNamespace, value: u32) {
env.storage().instance().set(
&NamespacedStorage::Main(namespace, StorageKeys::SimpleKey),
&value,
);
}