
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
@albedo-link/intent
Advanced tools
A lightweight browser wrapper for Albedo API that provides a promise-based interface for all supported intents.
This library is a lightweight browser wrapper for Albedo API that provides a promise-based interface for all supported intents.
npm i -S @albedo-link/intent
import albedo from '@albedo-link/intent'
public_key
- View public keyRequests account public key. It's a simple way of authentication for Stellar-based applications. The response ensures that a user owns the corresponding secret key.
Parameters
token
(string) - (optional) Verification token generated by the application (should be unique or random).callback
(string) - (optional) Optional URL callback where Albedo will POST a signed token and public key.require_existing
(boolean) - (optional) Allow existing Albedo accounts only.Returns
pubkey
(string) - User-selected public key.signed_message
(string) - HEX-encoded authentication message derived from the public key and verification token.signature
(string) - HEX-encoded ED25519 signature of the authentication message that can be further used to verify user's keypair ownership.Example
albedo.publicKey({
token: 'r9gbUuThXLr/wOrg2dxWHOO4DQsvQsTpkv1OtfETB3c='
})
.then(res => console.log(res))
sign_message
- Sign text messageRequests arbitrary message signing. Can be used to implement identity/ownership verification.
Parameters
message
(string) - (required) Text message to sign.pubkey
(string) - (optional) Specific public key requested by the application.callback
(string) - (optional) Optional URL callback where Albedo will POST a signed message.Returns
pubkey
(string) - User-selected public key.original_message
(string) - Text message to sign from request.signed_message
(string) - HEX-encoded message derived from the public key and original message.message_signature
(string) - HEX-encoded ED25519 signature of the signed message.Example
albedo.signMessage({
message: 'Alice doesn\'t trust Bob'
})
.then(res => console.log(res))
tx
- Sign transactionRequests a signature for the transaction. Returns the signed transaction envelope that can be submitted to the network or used for multi-sig coordination.
Parameters
xdr
(string) - (required) XDR-encoded transaction envelope to sign.pubkey
(string) - (optional) Specific public key requested by the application.network
(string) - (optional) Stellar network identifier.callback
(string) - (optional) Optional URL callback where Albedo will POST the signed transaction XDR instead of submitting it to Horizon.description
(string) - (optional) Optional human-friendly short transaction description provided by developers.submit
(boolean) - (optional) If set, the signed transaction will be submitted to the Horizon server instead of returning it to the application.Returns
xdr
(string) - XDR-encoded transaction envelope from request.tx_hash
(string) - HEX-encoded transaction hash.signed_envelope_xdr
(string) - XDR-encoded transaction envelope with new signatures.network
(string) - Stellar network identifier.result
(object) - Optional response from Horizon if the transaction has been submitted automatically.Example
albedo.tx({
xdr: 'AAAAALPZeTF.......B0dpb99l'
})
.then(res => console.log(res))
pay
- Make paymentRequests a payment from a user. Works with any Stellar asset, supports transaction memo.
Parameters
amount
(string) - (required) Requested payment amount.destination
(string) - (required) Payment destination address.asset_code
(string) - (optional) Asset code (skip for XLM).asset_issuer
(string) - (optional) Asset issuer (skip for XLM).memo
(string) - (optional) Transaction memo (required for exchanges and some anchors).memo_type
(string) - (optional) Transaction memo type.pubkey
(string) - (optional) Specific public key requested by the application.network
(string) - (optional) Stellar network identifier or private network passphrase.callback
(string) - (optional) Optional URL callback where Albedo will POST the signed transaction XDR instead of submitting it to Horizon.submit
(boolean) - (optional) If set, the signed transaction will be submitted to the Horizon server instead of returning it to the application.Returns
amount
(string) - Payment amount from request.destination
(string) - Payment destination address from request.asset_code
(string) - Asset code from request.asset_issuer
(string) - Asset issuer from request.memo
(string) - Transaction memo from request.memo_type
(string) - Transaction memo type from request.tx_hash
(string) - HEX-encoded transaction hash.signed_envelope_xdr
(string) - XDR-encoded transaction envelope with new signatures.pubkey
(string) - User-selected public key.network
(string) - Stellar network identifier.result
(object) - Optional response from Horizon if the transaction has been submitted automatically.Example
albedo.pay({
amount: '5',
asset_code: 'EURT',
asset_issuer: 'GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S'
})
.then(res => console.log(res))
trust
- Establish trustlineRequests permission to create a trustline to a given Stellar asset. Gradually simplifies the process of creating trustlines for anchors, ICOs, and airdrops.
Parameters
asset_code
(string) - (required) Trustline asset code.asset_issuer
(string) - (required) Trustline asset issuer address.limit
(string) - (optional) Trust limit.memo
(string) - (optional) Transaction memo (required for exchanges and some anchors).memo_type
(string) - (optional) Transaction memo type.pubkey
(string) - (optional) Specific public key requested by the application.network
(string) - (optional) Stellar network identifier or private network passphrase.callback
(string) - (optional) Optional URL callback where Albedo will POST the signed transaction XDR instead of submitting it to Horizon.submit
(boolean) - (optional) If set, the signed transaction will be submitted to the Horizon server instead of returning it to the application.Returns
asset_code
(string) - Trustline asset code from request.asset_issuer
(string) - Trustline asset issuer address from request.limit
(string) - Trust limit from request.tx_hash
(string) - HEX-encoded transaction hash.signed_envelope_xdr
(string) - XDR-encoded transaction envelope with new signatures.pubkey
(string) - User-selected public key.network
(string) - Stellar network identifier.result
(object) - Optional response from Horizon if the transaction has been submitted automatically.Example
albedo.trust({
asset_code: 'EURT',
asset_issuer: 'GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S'
})
.then(res => console.log(res))
exchange
- Swap tokensRequests permission to buy tokens on Stellar DEX at market price.
Parameters
amount
(string) - (required) The amount of asset to buy.max_price
(string) - (required) Maximum price the user willing to pay.sell_asset_code
(string) - (optional) Asset code of the asset to sell.sell_asset_issuer
(string) - (optional) Issuer account of the asset to sell.buy_asset_code
(string) - (optional) Asset code of the asset to buy.buy_asset_issuer
(string) - (optional) Issuer account of the asset to buy.memo
(string) - (optional) Transaction memo (required for exchanges and some anchors).memo_type
(string) - (optional) Transaction memo type.pubkey
(string) - (optional) Specific public key requested by the application.network
(string) - (optional) Stellar network identifier or private network passphrase.callback
(string) - (optional) Optional URL callback where Albedo will POST the signed transaction XDR instead of submitting it to Horizon.submit
(boolean) - (optional) If set, the signed transaction will be submitted to the Horizon server instead of returning it to the application.Returns
amount
(string) - The amount of asset to buy from request.max_price
(string) - Maximum price the user willing to pay from request.sell_asset_code
(string) - Asset code of the asset to sell from request.sell_asset_issuer
(string) - Issuer account of the asset to sell from request.buy_asset_code
(string) - Asset code of the asset to buy from request.buy_asset_issuer
(string) - Issuer account of the asset to buy from request.tx_hash
(string) - HEX-encoded transaction hash.signed_envelope_xdr
(string) - XDR-encoded transaction envelope with new signatures.pubkey
(string) - User-selected public key.network
(string) - Stellar network identifier.result
(object) - Optional response from Horizon if the transaction has been submitted automatically.Example
albedo.exchange({
amount: '5',
max_price: '3.5',
sell_asset_code: 'USD',
sell_asset_issuer: 'GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX',
buy_asset_code: 'EURT',
buy_asset_issuer: 'GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S'
})
.then(res => console.log(res))
implicit_flow
- Implicit permissionsRequests temporary access token for one or more intents that can be used to execute actions without explicit confirmation from the user. In order to be executed implicitly, an implicit flow permissions for a given intent should be granted and "pubkey" parameter set.
Parameters
intents
(string|string[]) - (required) Requested implicit flow intents.network
(string) - (optional) Stellar network identifier or private network passphrase.Returns
granted
(boolean) - Whether a user granted permissions or not.intents
(string[]) - Requested implicit flow intents.grants
(string[]) - Implicit flow intents that have been granted.session
(string) - Unique implicit session id.valid_until
(number) - Session expiration timestamp.pubkey
(string) - User-selected public key.network
(string) - Stellar network identifier.Example
albedo.implicitFlow({
intents: 'tx,pay,trust,sign_message'
})
.then(res => console.log(res))
manage_account
- Open account settingsOpens account settings window for a given account.
Parameters
pubkey
(string) - (required) Specific public key requested by the application.network
(string) - (optional) Stellar network identifier or private network passphrase.Returns
pubkey
(string) - Public key from intent request.Example
albedo.manageAccount()
.then(res => console.log(res))
batch
- Intents batchRequests execution of several tx intents bundled together. This intent is atomic – a user confirms or rejects all bundled requests at once, with the same account and the same Stellar network.
Parameters
intents
(object[]) - (required) Requested tx intents that should be executed together.pubkey
(string) - (optional) Specific public key requested by the application.network
(string) - (optional) Stellar network identifier or private network passphrase.Returns
intents
(object[]) - Requested tx intents.results
(object[]) - Array of results for each requested intent.pubkey
(string) - User-selected public key.network
(string) - Stellar network identifier.Example
albedo.batch({
intents: 'tx,pay,trust,sign_message'
})
.then(res => console.log(res))
Collection of helpers to simplify various operations in the implicit mode.
isImplicitSessionAllowed(intent, pubkey)
Checks whether an implicit session has been granted earlier for an intent + pubkey pair.
Parameters
intent
(string) - (required) Intent to check.pubkey
(string) - (required) Public key of the account which granted access.Returns
true/false
Example
const isAllowed = albedo.isImplicitSessionAllowed(
'tx',
'GBQW4KLMRXIMSDWBEWX4AWQKWYW7R3E7SFPSHTUDTFFT22NNUC6COL72'
)
listImplicitSessions()
Enumerates all currently active implicit sessions.
Returns
Example
for (let session of albedo.listImplicitSessions()){
console.log(session.pubkey, session.valid_until, session.grants)
}
forgetImplicitSession(pubkey)
Revokes session permission granted for an account.
Parameters
pubkey
(string) - (required) Public key of the account which granted access.Example
const pubkey = 'GBQW4KLMRXIMSDWBEWX4AWQKWYW7R3E7SFPSHTUDTFFT22NNUC6COL72'
albedo.forgetImplicitSession(pubkey)
console.log(albedo.listImplicitSessions().some(s => s.pubkey === pubkey))
To create UMD library bundle, run the following NPM script:
npm run build
It will also automatically update examples and parameters definitions for all available intents.
Running tests:
npm run test
FAQs
A lightweight browser wrapper for Albedo API that provides a promise-based interface for all supported intents.
The npm package @albedo-link/intent receives a total of 1,165 weekly downloads. As such, @albedo-link/intent popularity was classified as popular.
We found that @albedo-link/intent demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.