Skip to content

MsgSetDynamicStoreValue sets the boolean for one address in a dynamic store. Creator only.

Sets the boolean value for one address in a dynamic store. Only the store's creator can sign it. Approvals with a DynamicStoreChallenge read this value at transfer time.

Example

bash
bb tx tokenization set-dynamic-store-value 1 bb1py4mfpg6uf59qkyzg0nmau322c5873eeysp5ue true --from alice --chain-id bitbadges-1
ts
import { BitBadgesSigningClient, GenericCosmosAdapter, MsgSetDynamicStoreValue } from 'bitbadges';

const adapter = await GenericCosmosAdapter.fromMnemonic(process.env.MNEMONIC!, 'bitbadges-1');
const client = new BitBadgesSigningClient({ adapter, network: 'mainnet' });

const msg = new MsgSetDynamicStoreValue({
  creator: 'bb1p0rrel3365scadq5k9pv0x0zp9j22js6dnw70d',
  storeId: 1n,
  address: 'bb1py4mfpg6uf59qkyzg0nmau322c5873eeysp5ue',
  value: true
});

const result = await client.signAndBroadcast([msg]);
console.log(result.txHash, result.success);
json
{
  "creator": "bb1p0rrel3365scadq5k9pv0x0zp9j22js6dnw70d",
  "storeId": "1",
  "address": "bb1py4mfpg6uf59qkyzg0nmau322c5873eeysp5ue",
  "value": true
}

Ask your agent:

text
Allowlist bb1py4mfpg6uf59qkyzg0nmau322c5873eeysp5ue in dynamic store 1.

Fields

FieldTypeRequiredDescription
creatorstringyesSigner. Must equal the store's createdBy.
storeIdUintyesStore to write to.
addressstringyesAddress the value applies to. Must be a valid bb-prefixed bech32 address.
valueboolyesValue to store.

Response

FieldTypeDescription
previousValuestring"true" or "false": the value before this write. Falls back to the store's defaultValue when the address had no entry.
reviewItemsstring[]Advisory notes.

Behavior

  • Fails with ErrInvalidDynamicStoreID if the store does not exist or the signer is not its creator, and with an address error for an invalid address.
  • Writes the value even when it equals the default, so the address then has an explicit entry.
  • Emits store_id, address, and value event attributes.

Edit this page on GitHub