Skip to main content

Installation

Initialize

Auth token required. Request one by DMing @beharefe on Telegram or emailing gm@actioncodes.org.

Methods

resolve

Verify a code and get its details.
string
required
The 8-digit action code from the user
Example:

getStatus

Get the current status of a code.
string
required
The action code to check
Example:

observeStatus

Watch for status changes over time. Returns an async iterator.
string
required
The action code to observe
object
Example:
observeStatus automatically stops when the code is finalized or expires. You can also break early.

attachTransaction

Attach a transaction for the user to sign.
string
required
The action code
string
required
Base64-encoded serialized transaction
ActionCodeMeta
Optional metadata (description, label, etc.)
Example:

attachMessage

Attach a message for the user to sign.
string
required
The action code
string
required
The message to sign
ActionCodeMeta
Optional metadata
Example:

finalizeTransaction

Manually finalize a code with a transaction signature. Usually not needed — the user’s wallet does this automatically.
string
required
The action code
string
required
The transaction signature

finalizeMessage

Manually finalize a code with a signed message. Usually not needed — the user’s wallet does this automatically.
string
required
The action code
string
required
The signed message

register

Create a new action code. For advanced use — most apps receive codes from users instead.
PublicKey
required
The wallet public key
function
required
A function that signs a message: (message: string) => Promise<string>
ActionCodeMeta
Optional metadata
Example:
Most applications should receive codes from users rather than generate them. Users generate codes at actioncode.app.

Error Handling

The SDK throws specific error types:

Types

ActionCodeMeta

ActionCodeStatusResponse

ObserveStatusOptions