mirror of
https://github.com/onsonr/sonr.git
synced 2025-03-10 13:07:09 +00:00
- **refactor: move session-related code to middleware package** - **refactor: update PKL build process and adjust related configurations** - **feat: integrate base.cosmos.v1 Genesis module** - **refactor: pass session context to modal rendering functions** - **refactor: move nebula package to app directory and update templ version** - **refactor: Move home section video view to dedicated directory** - **refactor: remove unused views file** - **refactor: move styles and UI components to global scope** - **refactor: Rename images.go to cdn.go** - **feat: Add Empty State Illustrations** - **refactor: Consolidate Vault Index Logic** - **fix: References to App.wasm and remove Vault Directory embedded CDN files** - **refactor: Move CDN types to Models** - **fix: Correct line numbers in templ error messages for arch_templ.go** - **refactor: use common types for peer roles** - **refactor: move common types and ORM to a shared package** - **fix: Config import dwn** - **refactor: move nebula directory to app** - **feat: Rebuild nebula** - **fix: correct file paths in panels templates** - **feat: Remove duplicate types** - **refactor: Move dwn to pkg/core** - **refactor: Binary Structure** - **feat: Introduce Crypto Pkg** - **fix: Broken Process Start** - **feat: Update pkg/* structure** - **feat: Refactor PKL Structure** - **build: update pkl build process** - **chore: Remove Empty Files** - **refactor: remove unused macaroon package** - **feat: Add WebAwesome Components** - **refactor: consolidate build and generation tasks into a single taskfile, remove redundant makefile targets** - **refactor: refactor server and move components to pkg/core/dwn** - **build: update go modules** - **refactor: move gateway logic into dedicated hway command** - **feat: Add KSS (Krawczyk-Song-Song) MPC cryptography module** - **feat: Implement MPC-based JWT signing and UCAN token generation** - **feat: add support for MPC-based JWT signing** - **feat: Implement MPC-based UCAN capabilities for smart accounts** - **feat: add address field to keyshareSource** - **feat: Add comprehensive MPC test suite for keyshares, UCAN tokens, and token attenuations** - **refactor: improve MPC keyshare management and signing process** - **feat: enhance MPC capability hierarchy documentation** - **refactor: rename GenerateKeyshares function to NewKeyshareSource for clarity** - **refactor: remove unused Ethereum address computation** - **feat: Add HasHandle and IsAuthenticated methods to HTTPContext** - **refactor: Add context.Context support to session HTTPContext** - **refactor: Resolve context interface conflicts in HTTPContext** - **feat: Add session ID context key and helper functions** - **feat: Update WebApp Page Rendering** - **refactor: Simplify context management by using single HTTPContext key** - **refactor: Simplify HTTPContext creation and context management in session middleware** - **refactor: refactor session middleware to use a single data structure** - **refactor: Simplify HTTPContext implementation and session data handling** - **refactor: Improve session context handling and prevent nil pointer errors** - **refactor: Improve session context handling with nil safety and type support** - **refactor: improve session data injection** - **feat: add full-screen modal component and update registration flow** - **chore: add .air.toml to .gitignore** - **feat: add Air to devbox and update dependencies**
276 lines
3.8 KiB
Plaintext
276 lines
3.8 KiB
Plaintext
@go.Package { name = "github.com/onsonr/sonr/pkg/common/models" }
|
|
|
|
module common.types.ORM
|
|
|
|
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
|
|
|
|
|
|
// Enums
|
|
typealias AssetType = "native"|"wrapped"|"staking"|"pool"|"ibc"|"cw20"
|
|
|
|
typealias DIDMethod = "ipfs"|"sonr"|"bitcoin"|"ethereum"|"ibc"|"webauthn"|"dwn"|"service"
|
|
|
|
typealias KeyAlgorithm = "es256"|"es384"|"es512"|"eddsa"|"es256k"|"ecdsa"
|
|
|
|
typealias KeyCurve = "p256"|"p384"|"p521"|"x25519"|"x448"|"ed25519"|"ed448"|"secp256k1"|"bls12381"|"keccak256"
|
|
|
|
typealias KeyEncoding = "raw"|"hex"|"multibase"
|
|
|
|
typealias KeyRole = "authentication"|"assertion"|"delegation"|"invocation"
|
|
|
|
typealias KeyType = "octet"|"elliptic"|"rsa"|"symmetric"|"hmac"|"mpc"|"zk"|"webauthn"|"bip32"
|
|
|
|
typealias KeyShareRole = "user"|"validator"
|
|
|
|
typealias PermissionGrant = "none"|"read"|"write"|"verify"|"broadcast"|"admin"
|
|
|
|
typealias PermissionScope = "profile"|"metadata"|"permissions"|"wallets"|"transactions"|"user"|"validator"
|
|
|
|
typealias Base58 = String
|
|
typealias Base64 = String
|
|
|
|
typealias Bech32 = String
|
|
typealias Keccak = String
|
|
|
|
typealias ChainCode = UInt
|
|
typealias Scope = String
|
|
|
|
typealias Hex = String
|
|
|
|
class PrimaryKey extends go.Field {
|
|
structTags {
|
|
["json"] = "%{name},omitempty"
|
|
["query"] = "%{name}"
|
|
}
|
|
}
|
|
|
|
class JsonField extends go.Field {
|
|
structTags {
|
|
["json"] = "%{name},omitempty"
|
|
}
|
|
}
|
|
|
|
|
|
class Account {
|
|
@PrimaryKey
|
|
id: String
|
|
|
|
@JsonField
|
|
name: String
|
|
|
|
@JsonField
|
|
address: Bech32|Keccak|String
|
|
|
|
@JsonField
|
|
publicKey: Base58
|
|
|
|
@JsonField
|
|
chainCode: ChainCode
|
|
|
|
@JsonField
|
|
index: Int
|
|
|
|
@JsonField
|
|
controller: Bech32
|
|
|
|
@JsonField
|
|
createdAt: String?
|
|
}
|
|
|
|
class Asset {
|
|
@PrimaryKey
|
|
id: String
|
|
|
|
@JsonField
|
|
name: String
|
|
|
|
@JsonField
|
|
symbol: String
|
|
|
|
@JsonField
|
|
decimals: Int
|
|
|
|
@JsonField
|
|
chainCode: ChainCode
|
|
|
|
@JsonField
|
|
createdAt: String?
|
|
}
|
|
|
|
class Chain {
|
|
@PrimaryKey
|
|
id: String
|
|
|
|
@JsonField
|
|
name: String
|
|
|
|
@JsonField
|
|
networkId: String
|
|
|
|
@JsonField
|
|
chainCode: ChainCode
|
|
|
|
@JsonField
|
|
createdAt: String?
|
|
}
|
|
|
|
class Credential {
|
|
@PrimaryKey
|
|
id: String
|
|
|
|
@JsonField
|
|
subject: String
|
|
|
|
@JsonField
|
|
controller: Bech32
|
|
|
|
@JsonField
|
|
attestationType: String
|
|
|
|
@JsonField
|
|
origin: String
|
|
|
|
@JsonField
|
|
label: String?
|
|
|
|
@JsonField
|
|
deviceId: String?
|
|
|
|
@JsonField
|
|
credentialId: Base64
|
|
|
|
@JsonField
|
|
publicKey: Base64
|
|
|
|
@JsonField
|
|
transport: List<String>
|
|
|
|
@JsonField
|
|
signCount: UInt
|
|
|
|
@JsonField
|
|
userPresent: Boolean
|
|
|
|
@JsonField
|
|
userVerified: Boolean
|
|
|
|
@JsonField
|
|
backupEligible: Boolean
|
|
|
|
@JsonField
|
|
backupState: Boolean
|
|
|
|
@JsonField
|
|
cloneWarning: Boolean
|
|
|
|
@JsonField
|
|
createdAt: String?
|
|
|
|
@JsonField
|
|
updatedAt: String?
|
|
}
|
|
|
|
class DID {
|
|
@PrimaryKey
|
|
id: String
|
|
role: KeyRole
|
|
algorithm: KeyAlgorithm
|
|
encoding: KeyEncoding
|
|
curve: KeyCurve
|
|
key_type: KeyType
|
|
raw: Base64
|
|
jwk: JWK
|
|
}
|
|
|
|
class JWK {
|
|
@JsonField
|
|
kty: String
|
|
|
|
@JsonField
|
|
crv: String
|
|
|
|
@JsonField
|
|
x: String
|
|
|
|
@JsonField
|
|
y: String
|
|
|
|
@JsonField
|
|
n: String
|
|
|
|
@JsonField
|
|
e: String
|
|
}
|
|
|
|
class Grant {
|
|
@PrimaryKey
|
|
id: UInt
|
|
|
|
@JsonField
|
|
subject: String
|
|
|
|
@JsonField
|
|
controller: Bech32
|
|
|
|
@JsonField
|
|
origin: String
|
|
|
|
@JsonField
|
|
token: String
|
|
|
|
@JsonField
|
|
scopes: List<String>
|
|
|
|
@JsonField
|
|
createdAt: String?
|
|
|
|
@JsonField
|
|
updatedAt: String?
|
|
}
|
|
|
|
class Keyshare {
|
|
@PrimaryKey
|
|
id: String
|
|
|
|
@JsonField
|
|
data: Base64
|
|
|
|
@JsonField
|
|
role: Int
|
|
|
|
@JsonField
|
|
createdAt: String?
|
|
|
|
@JsonField
|
|
lastRefreshed: String?
|
|
}
|
|
|
|
class Profile {
|
|
@PrimaryKey
|
|
id: String
|
|
|
|
@JsonField
|
|
subject: String
|
|
|
|
@JsonField
|
|
controller: Bech32
|
|
|
|
@JsonField
|
|
originUri: String?
|
|
|
|
@JsonField
|
|
publicMetadata: String?
|
|
|
|
@JsonField
|
|
privateMetadata: String?
|
|
|
|
@JsonField
|
|
createdAt: String?
|
|
|
|
@JsonField
|
|
updatedAt: String?
|
|
}
|
|
|
|
db_name: String = "vault"
|
|
db_version: Int = 1
|