mirror of
https://github.com/getAlby/hub.git
synced 2026-08-13 12:33:39 +02:00
* feat: nwc create_connection command (WIP) * feat: allow creating superuser apps from the ui * fix: pass methods rather than scopes in create_connection method * chore: add extra tests * fix: use browser router in http mode * fix: update links to not use hash router * fix: add redirect from hash router url * fix: return nostrWalletConnectUrl in nwc connection success event and message * feat: publish nwa event * chore: use nwc info event instead of nwa event * feat: create custom alby go detail page * chore: allow creating/editing apps with the same name * fix: convert budget from msats to sats (#1111) * chore: address NWA feedback * chore: address feedback - adjust button copy - make create_connection methods consistent with http deeplink flow - remove unused constant - add empty string check before adding lud16 tag - fix test * feat: add support for notification_types in create_connection method * fix: shorter button copy * fix: do not include lud16 tag in published info event * Feat: add lud16 to get_info response (#1128) feat: add lud16 to get_info response * chore: minor alby go screen improvements * fix: incorrect unlock password error message to create app with superuser access * chore: minor ui improvements on alby go detail page * chore: avoid duplicate app names by adding a suffix * chore: move scopes check to apps service, add new tests, DRY controller test setup * fix: scopes component full access scopes and isolated scope group check * fix: use supported capabilities for Alby Go * fix: return correct app name * chore: address minor comments --------- Co-authored-by: im-adithya <imadithyavardhan@gmail.com>
63 lines
2 KiB
Go
63 lines
2 KiB
Go
package constants
|
|
|
|
// shared constants used by multiple packages
|
|
|
|
const (
|
|
TRANSACTION_TYPE_INCOMING = "incoming"
|
|
TRANSACTION_TYPE_OUTGOING = "outgoing"
|
|
|
|
TRANSACTION_STATE_PENDING = "PENDING"
|
|
TRANSACTION_STATE_SETTLED = "SETTLED"
|
|
TRANSACTION_STATE_FAILED = "FAILED"
|
|
)
|
|
|
|
const (
|
|
BUDGET_RENEWAL_DAILY = "daily"
|
|
BUDGET_RENEWAL_WEEKLY = "weekly"
|
|
BUDGET_RENEWAL_MONTHLY = "monthly"
|
|
BUDGET_RENEWAL_YEARLY = "yearly"
|
|
BUDGET_RENEWAL_NEVER = "never"
|
|
)
|
|
|
|
func GetBudgetRenewals() []string {
|
|
return []string{
|
|
BUDGET_RENEWAL_DAILY,
|
|
BUDGET_RENEWAL_WEEKLY,
|
|
BUDGET_RENEWAL_MONTHLY,
|
|
BUDGET_RENEWAL_YEARLY,
|
|
BUDGET_RENEWAL_NEVER,
|
|
}
|
|
}
|
|
|
|
const (
|
|
PAY_INVOICE_SCOPE = "pay_invoice" // also covers pay_keysend and multi_* payment methods
|
|
GET_BALANCE_SCOPE = "get_balance"
|
|
GET_INFO_SCOPE = "get_info"
|
|
MAKE_INVOICE_SCOPE = "make_invoice"
|
|
LOOKUP_INVOICE_SCOPE = "lookup_invoice"
|
|
LIST_TRANSACTIONS_SCOPE = "list_transactions"
|
|
SIGN_MESSAGE_SCOPE = "sign_message"
|
|
NOTIFICATIONS_SCOPE = "notifications" // covers all notification types
|
|
SUPERUSER_SCOPE = "superuser"
|
|
)
|
|
|
|
// limit encoded metadata length, otherwise relays may have trouble listing multiple transactions
|
|
// given a relay limit of 512000 bytes and ideally being able to list 25 transactions,
|
|
// each transaction would have to have a maximum size of 20480
|
|
// accounting for encryption and other metadata in the response, this is set to 4096 characters
|
|
const INVOICE_METADATA_MAX_LENGTH = 4096
|
|
|
|
// errors used by NIP-47 and the transaction service
|
|
const (
|
|
ERROR_INTERNAL = "INTERNAL"
|
|
ERROR_NOT_IMPLEMENTED = "NOT_IMPLEMENTED"
|
|
ERROR_QUOTA_EXCEEDED = "QUOTA_EXCEEDED"
|
|
ERROR_INSUFFICIENT_BALANCE = "INSUFFICIENT_BALANCE"
|
|
ERROR_UNAUTHORIZED = "UNAUTHORIZED"
|
|
ERROR_EXPIRED = "EXPIRED"
|
|
ERROR_RESTRICTED = "RESTRICTED"
|
|
ERROR_BAD_REQUEST = "BAD_REQUEST"
|
|
ERROR_NOT_FOUND = "NOT_FOUND"
|
|
ERROR_UNSUPPORTED_VERSION = "UNSUPPORTED_VERSION"
|
|
ERROR_OTHER = "OTHER"
|
|
)
|