Skip to main content

Retrieve Value

Retrieve secret strings and integers from the network. Retrieve and decode a stored secret string (SecretBlob) or a stored secret integer (SecretInteger)

Get a Quote to Retrieve Value

src/nillion/components/RetrieveSecretForm.tsx
const operation = nillion.Operation.retrieve_value();

const quote = await getQuote({
client: nillionClient,
operation,
});

Pay to Retrieve Value and get Payment Receipt

src/nillion/components/RetrieveSecretForm.tsx
const [nilChainClient, nilChainWallet] =
await createNilChainClientAndWalletFromPrivateKey();

const paymentReceipt = await payWithWalletFromPrivateKey(
nilChainClient,
nilChainWallet,
quote
);

Retrieve SecretBlob or SecretInteger

src/nillion/components/RetrieveSecretForm.tsx
const value = await retrieveSecret({
nillionClient,
store_id: storeId,
secret_name: secretName,
receipt: paymentReceipt,
});
Feedback