money.sql 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. -- Wallet definitions for this contract.
  2. -- We store data that is needed to be able to receive and send tokens.
  3. -- The keypairs in our wallet
  4. CREATE TABLE IF NOT EXISTS BZHKGQ26bzmBithTQYTJtjo2QdCqpkR9tjSBopT4yf4o_money_keys (
  5. key_id INTEGER PRIMARY KEY NOT NULL,
  6. is_default INTEGER NOT NULL,
  7. public BLOB NOT NULL,
  8. secret BLOB NOT NULL
  9. );
  10. -- The coins we have the information to and can spend
  11. CREATE TABLE IF NOT EXISTS BZHKGQ26bzmBithTQYTJtjo2QdCqpkR9tjSBopT4yf4o_money_coins (
  12. coin BLOB PRIMARY KEY NOT NULL,
  13. is_spent INTEGER NOT NULL,
  14. value BLOB NOT NULL,
  15. token_id BLOB NOT NULL,
  16. spend_hook BLOB NOT NULL,
  17. user_data BLOB NOT NULL,
  18. coin_blind BLOB NOT NULL,
  19. value_blind BLOB NOT NULL,
  20. token_blind BLOB NOT NULL,
  21. secret BLOB NOT NULL,
  22. leaf_position BLOB NOT NULL,
  23. memo BLOB,
  24. spent_tx_hash TEXT DEFAULT '-'
  25. );
  26. -- Arbitrary tokens
  27. CREATE TABLE IF NOT EXISTS BZHKGQ26bzmBithTQYTJtjo2QdCqpkR9tjSBopT4yf4o_money_tokens (
  28. token_id BLOB PRIMARY KEY NOT NULL,
  29. mint_authority BLOB NOT NULL,
  30. token_blind BLOB NOT NULL,
  31. is_frozen INTEGER NOT NULL,
  32. freeze_height INTEGER
  33. );
  34. -- The token aliases in our wallet
  35. CREATE TABLE IF NOT EXISTS BZHKGQ26bzmBithTQYTJtjo2QdCqpkR9tjSBopT4yf4o_money_aliases (
  36. alias BLOB PRIMARY KEY NOT NULL,
  37. token_id BLOB NOT NULL
  38. );