Static
Private
Readonly
APP_Path prefix for application URIs
Static
Private
Readonly
ASSET_Path prefix for asset URIs
Static
Private
Readonly
SCHEMEThe ARC-82 URI scheme
Static
buildConstructs an ARC-82 compliant application URI.
The application ID to include in the URI
Optional
params: AppQueryParamsOptional query parameters for the application
A formatted ARC-82 URI string for the application
When the ID is invalid or parameters are malformed
// Simple application URI
const uri1 = Arc82.buildAppUri(123);
// "algorand://app/123"
// Application URI with box query
const uri2 = Arc82.buildAppUri(123, {
box: ['Ym94X2tleQ%3D%3D']
});
// "algorand://app/123?box=Ym94X2tleQ%3D%3D"
Static
buildConstructs an ARC-82 compliant asset URI.
The asset ID to include in the URI
Optional
params: AssetQueryParamsOptional query parameters for the asset
A formatted ARC-82 URI string for the asset
When the ID is invalid
// Simple asset URI
const uri1 = Arc82.buildAssetUri(456);
// "algorand://asset/456"
// Asset URI with multiple parameters
const uri2 = Arc82.buildAssetUri(456, {
total: true,
decimals: true,
unitname: true
});
// "algorand://asset/456?total&decimals&unitname"
Static
decodeDecodes a base64url encoded string to UTF-8.
The base64url encoded string to decode
The decoded UTF-8 string
When the input is invalid base64url or decoding fails
const decoded = Arc82.decodeBase64Url('SGVsbG8gV29ybGQ');
// "Hello World"
Static
encodeStatic
extractExtracts the ID from an ARC-82 URI without performing full parsing.
The URI string to extract the ID from
The extracted ID or null if the URI is invalid
const id1 = Arc82.extractId('algorand://app/123');
// 123
const id2 = Arc82.extractId('invalid://uri');
// null
Static
extractExtracts the type from an ARC-82 URI without performing full parsing.
The URI string to extract the type from
The extracted type (APPLICATION or ASSET) or null if invalid
const type1 = Arc82.extractType('algorand://app/123');
// AlgorandUriType.APPLICATION
const type2 = Arc82.extractType('algorand://asset/456');
// AlgorandUriType.ASSET
const type3 = Arc82.extractType('invalid://uri');
// null
Static
Private
isPrivate
Validates whether a string is in valid Algorand address format. Uses simplified validation - a robust implementation would use algosdk.
The address string to validate
True if the address format is valid, false otherwise
Static
isValidates whether a URI string is ARC-82 compliant.
The URI string to validate
True if the URI is valid ARC-82 format, false otherwise
const isValid1 = Arc82.isValidArc82Uri('algorand://app/123');
// true
const isValid2 = Arc82.isValidArc82Uri('http://example.com');
// false
Static
Private
isStatic
parseParses an ARC-82 compliant URI string.
The URI string to parse
The parsed URI object containing type, ID, and parameters
When the URI is invalid or malformed
const parsed = Arc82.parse('algorand://app/123?box=Ym94X2tleQ%3D%3D');
console.log(parsed.type); // AlgorandUriType.APPLICATION
console.log(parsed.id); // 123
console.log(parsed.appParams?.box); // ['Ym94X2tleQ%3D%3D']
Static
Private
parsePrivate
Parses application-specific query parameters from URL search parameters.
The URLSearchParams object containing query parameters
The original URI string for error reporting
Parsed application query parameters
When parameters are invalid or malformed
Static
Private
parsePrivate
Parses asset-specific query parameters from URL search parameters.
The URLSearchParams object containing query parameters
The original URI string for error reporting
Parsed asset query parameters
Static
queryQueries application data from the Algorand blockchain based on a parsed ARC-82 URI.
This method fetches application information and any requested storage data from the blockchain. It supports querying box storage, global state, local state, and TEAL programs.
The parsed ARC-82 URI for an application
The Algorand network to query (mainnet, testnet, localnet)
A promise that resolves to application query results
When the URI is not for an application or querying fails
const uri = 'algorand://app/123?global=Z2xvYmFsX2tleQ%3D%3D&box=Ym94X2tleQ%3D%3D';
const parsed = Arc82.parse(uri);
const result = await Arc82.queryApplication(parsed, 'testnet');
if (result.success) {
console.log('Application exists:', result.exists);
console.log('Global state:', result.global);
console.log('Box storage:', result.boxes);
}
Static
queryQueries asset data from the Algorand blockchain based on a parsed ARC-82 URI.
This method fetches asset information and any requested parameter data from the blockchain. It supports querying all asset parameters including total supply, decimals, frozen status, names, URLs, and administrative addresses.
The parsed ARC-82 URI for an asset
The Algorand network to query (mainnet, testnet, localnet)
A promise that resolves to asset query results
When the URI is not for an asset or querying fails
const uri = 'algorand://asset/456?total&decimals&unitname';
const parsed = Arc82.parse(uri);
const result = await Arc82.queryAsset(parsed, 'testnet');
if (result.success && result.exists) {
console.log('Total supply:', result.parameters.total);
console.log('Decimals:', result.parameters.decimals);
console.log('Unit name:', result.parameters.unitname);
}
Static
queryQueries blockchain data directly from an ARC-82 URI string.
This is a convenience method that combines URI parsing and blockchain querying in a single operation. It automatically determines whether the URI is for an application or asset and calls the appropriate query method.
The ARC-82 URI string to parse and query
The Algorand network to query (mainnet, testnet, localnet)
A promise that resolves to query results (either application or asset data)
When the URI is invalid
When blockchain querying fails
// Query application data
const appResult = await Arc82.queryFromUri(
'algorand://app/123?global=Z2xvYmFsX2tleQ%3D%3D',
'testnet'
);
// Query asset data
const assetResult = await Arc82.queryFromUri(
'algorand://asset/456?total&unitname',
'testnet'
);
Main parser class for ARC-82 Algorand URIs. Provides static methods for parsing, constructing, and querying ARC-82 compliant URIs.
Example