Skip to content
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9aafb6c
feat(protocols): add SDA (Smart Deposit Address) protocol interface
AlonzoRicardo Jun 24, 2026
066400b
feat(protocols): add custody model + recipient-keyed history to SDA i…
AlonzoRicardo Jun 30, 2026
7accd53
feat(protocols): add activation model + generic derivation to SDA int…
AlonzoRicardo Jul 1, 2026
d6f7658
refactor(protocols): add Blockchain type alias for SDA chain fields
AlonzoRicardo Jul 2, 2026
3545f2a
refactor(protocols): accept number | bigint for SDA deposit limits
AlonzoRicardo Jul 2, 2026
0060e75
refactor(protocols): make SdaDepositAddress.id required
AlonzoRicardo Jul 2, 2026
e299a0e
refactor(protocols): use skip offset instead of cursor in SdaTransfer…
AlonzoRicardo Jul 2, 2026
ae6ab3d
refactor(protocols): rename getDepositAddressTransfers to getTransfers
AlonzoRicardo Jul 2, 2026
be6e8c1
refactor(protocols): swap getTransfersByRecipient arg order to (desti…
AlonzoRicardo Jul 2, 2026
71e587a
refactor(protocols): drop config argument from base SdaProtocol
AlonzoRicardo Jul 3, 2026
386e2ee
refactor(protocols): drop generic derivation field from SDA types
AlonzoRicardo Jul 3, 2026
072ea09
feat(errors): add UnsupportedOperationError and AccountRequiredError
AlonzoRicardo Jul 3, 2026
3a7d9e0
refactor(protocols): drop SdaCapabilities descriptor for behavior-bas…
AlonzoRicardo Jul 3, 2026
8907ba8
docs(protocols): document AccountRequiredError on create/derive
AlonzoRicardo Jul 3, 2026
6bc203f
refactor(protocols): make SdaRecoveryOptions a union of identifying s…
AlonzoRicardo Jul 6, 2026
83303e1
docs(protocols): remove provider names from SDA interface JSDoc
AlonzoRicardo Jul 7, 2026
42097de
fix(types): emit ISdaProtocol as interface and SdaProtocol as abstrac…
AlonzoRicardo Jul 7, 2026
e639e62
refactor(protocols): drop options.quote; quoteDeposit is a standalone…
AlonzoRicardo Jul 7, 2026
5112778
docs(protocols): SdaLimits is base-unit only; omit if denominated oth…
AlonzoRicardo Jul 7, 2026
eda7dcb
refactor(protocols): rework SDA error taxonomy (review round 2)
AlonzoRicardo Jul 9, 2026
6ba18ee
refactor(protocols): apply review round 2 docs + renames to SDA inter…
AlonzoRicardo Jul 9, 2026
f6ba3b3
refactor(protocols): drop unused SdaTransfer fields
AlonzoRicardo Jul 9, 2026
412d807
style(protocols): wrap SDA doc comments at 120 columns
AlonzoRicardo Jul 10, 2026
d82dca3
style(types): normalize SDA .d.ts comments to tsc output
AlonzoRicardo Jul 10, 2026
e145969
refactor(protocols): apply review round 3 to the SDA interface
AlonzoRicardo Jul 13, 2026
fa4cd7e
refactor(protocols): drop non-shared fields from SdaCreateDepositAddr…
AlonzoRicardo Jul 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ export {

export { IWalletAccount } from './src/wallet-account.js'

export { NotImplementedError, SignerError } from './src/errors.js'
export {
NotImplementedError,
SignerError,
UnsupportedOperationError,
ValueError,
NoSuchElementError
} from './src/errors.js'

export { ISigner } from './src/signer.js'
42 changes: 42 additions & 0 deletions src/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,45 @@ export class SignerError extends Error {
this.name = 'SignerError'
}
}

export class UnsupportedOperationError extends Error {
/**
* Create a new unsupported operation error. Thrown by an optional operation
* that the concrete implementation deliberately does not support.
*
* @param {string} operation - The name of the operation that is not supported.
*/
constructor (operation) {
super(`Operation '${operation}' is not supported by this protocol.`)

this.name = 'UnsupportedOperationError'
}
}

export class ValueError extends Error {
/**
* Create a new value error. Thrown when an argument has the correct type but
* violates a validation rule.
Comment thread
Davi0kProgramsThings marked this conversation as resolved.
Outdated
*
* @param {string} message - The error's message.
*/
constructor (message) {
super(message)

this.name = 'ValueError'
}
}

export class NoSuchElementError extends Error {
/**
* Create a new no such element error. Thrown when a lookup finds no element for
* the given identifier.
*
* @param {string} message - The error's message.
*/
constructor (message) {
super(message)

this.name = 'NoSuchElementError'
}
}
21 changes: 21 additions & 0 deletions src/protocols/index.js
Comment thread
Davi0kProgramsThings marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,25 @@
/** @typedef {import('./swidge-protocol.js').SwidgeSupportedToken} SwidgeSupportedToken */
/** @typedef {import('./swidge-protocol.js').SwidgeSupportedTokensOptions} SwidgeSupportedTokensOptions */

/** @typedef {import('./sda-protocol.js').Blockchain} Blockchain */
/** @typedef {import('./sda-protocol.js').SdaToken} SdaToken */
/** @typedef {import('./sda-protocol.js').SdaDepositAddressLimits} SdaDepositAddressLimits */
/** @typedef {import('./sda-protocol.js').SdaRoutesOptions} SdaRoutesOptions */
/** @typedef {import('./sda-protocol.js').SdaRoute} SdaRoute */
/** @typedef {import('./sda-protocol.js').SdaDepositOptions} SdaDepositOptions */
/** @typedef {import('./sda-protocol.js').SdaFeeType} SdaFeeType */
/** @typedef {import('./sda-protocol.js').SdaFee} SdaFee */
/** @typedef {import('./sda-protocol.js').SdaDepositQuote} SdaDepositQuote */
/** @typedef {import('./sda-protocol.js').SdaCreateDepositAddressOptions} SdaCreateDepositAddressOptions */
/** @typedef {import('./sda-protocol.js').SdaDepositAddress} SdaDepositAddress */
/** @typedef {import('./sda-protocol.js').SdaTransferStatus} SdaTransferStatus */
/** @typedef {import('./sda-protocol.js').SdaTransfer} SdaTransfer */
/** @typedef {import('./sda-protocol.js').SdaTransfersOptions} SdaTransfersOptions */
/** @typedef {import('./sda-protocol.js').SdaRecoverById} SdaRecoverById */
/** @typedef {import('./sda-protocol.js').SdaRecoverByAddress} SdaRecoverByAddress */
/** @typedef {import('./sda-protocol.js').SdaRecoveryOptions} SdaRecoveryOptions */
/** @typedef {import('./sda-protocol.js').SdaRecoveryResult} SdaRecoveryResult */

export { default as SwapProtocol, ISwapProtocol } from './swap-protocol.js'

export { default as BridgeProtocol, IBridgeProtocol } from './bridge-protocol.js'
Expand All @@ -77,3 +96,5 @@ export { default as LendingProtocol, ILendingProtocol } from './lending-protocol
export { default as FiatProtocol, IFiatProtocol } from './fiat-protocol.js'

export { default as SwidgeProtocol, ISwidgeProtocol } from './swidge-protocol.js'

export { default as SdaProtocol, ISdaProtocol } from './sda-protocol.js'
Loading