React SDK
React library exposing a provider, client access, and hooks for ACTA API and Soroban transactions. The network is inferred from the baseURL.
Exports
ActaConfigprovider anduseActaClientcontext accessorHooks:
useCreateCredential,useCreateVault,useAuthorizeIssuer,useVaultApi,useTxPrepare,useVaultStoreBase URLs:
mainNetandtestNet
Provider Setup
import { ActaConfig, mainNet } from "@acta-team/acta-sdk";
export function App() {
return (
<ActaConfig baseURL={mainNet} apiKey={"your-api-key"}>
{/* your app */}
</ActaConfig>
);
}Accessing the Client
import { useActaClient } from "@acta-team/acta-sdk";
const client = useActaClient();
const defaults = client.getDefaults();
// defaults: { rpcUrl, networkPassphrase, issuanceContractId, vaultContractId }Hooks Summary
useCreateCredential: issue a credential via the APIuseCreateVault: build, sign, and submit theinitializetxuseAuthorizeIssuer: authorize an issuer in the VaultuseVaultApi: direct Vault reads (list IDs, get VC) and verificationuseTxPrepare: build unsigned XDRs for store/issue/list/get flowsuseVaultStore: submit signed XDR to store a credential
Last updated

