React library exposing a provider, client access, and hooks for ACTA API and Soroban transactions. The network is inferred from the baseURL.
ActaConfigprovider anduseActaClientcontext accessor- Hooks:
useVault,useCredential,useVaultRead - Base URLs:
mainNetandtestNet
import { ActaConfig, mainNet } from "@acta-team/acta-sdk";
export function App() {
return (
<ActaConfig baseURL={mainNet}>
{/* your app */}
</ActaConfig>
);
}The API key is automatically read from environment variables:
ACTA_API_KEY_MAINNET(for mainnet)ACTA_API_KEY_TESTNET(for testnet)ACTA_API_KEY(fallback for both networks)
import { useActaClient } from "@acta-team/acta-sdk";
const client = useActaClient();
const config = await client.getConfig();
// config: { rpcUrl, networkPassphrase, actaContractId }-
useVault: Vault operations - create vault, authorize issuer, revoke issuercreateVault: Initialize a vault for an ownerauthorizeIssuer: Authorize an issuer in the vaultrevokeIssuer: Revoke an authorized issuer from the vault
-
useCredential: Credential operations - issue and revokeissue: Issue a credential (stores in vault and marks as valid)revoke: Revoke a credential
-
useVaultRead: Vault read operations - list IDs, get VC, verify VClistVcIds: List credential IDs owned by an ownergetVc: Get a credential from the vaultverifyVc: Verify the status of a credential in the vault