Appearance
Token Ledger Commands
Create:
The create command allows you to initialize a new Token Ledger using the Skuset Factory contract, specifying details like name, type, URI, and signing options, with the option to save transaction details locally if needed.
Usage
sct tokenLedger create --name <name> --description <description> --uri <uri> --type <ledger-type> --from_privKey <private-key-or-vault> --from_address <sender-address> --from_name <sender-name> --memo <memo> --skusetFactoryContract <contract-address> --network <rpc-url> --saveToFile <true|false> --localFile <file-path>
--name
(required): Name of the Token Ledger. --description, --desc (optional): Description of the Token Ledger.--uri
, -u (optional): Unique resource identifier (e.g., metadata URI template). Default is https://token-cdn-domain/{id}.json.- --type, -t (optional): Type of the Token Ledger. Choices are Regular or Locked. Default is Regular.
--from_address
(optional): Sender address, required if --from_privKey is set to "vault".--from_privKey
(required): Sender’s private key, or use 'vault' for vault-based signing, or 'file' for file-based private key signing.--userFile
(optional):Path to the user file, required if --from_privKey is "file".--from_name
(optional): Sender's name, required if --from_privKey is set to "vault".--memo
(optional): Memo for Token Ledger creation.--skusetFactoryContract
(required): Address of the Skuset Factory contract.--network
(required): Network details (e.g., RPC URL).--saveToFile
(optional): Toggle for saving the command output to a database. Default is false.--localFile
(optional): Path to a local file to save the output if --saveToFile is enabled.
Example
- Using Direct Private Key
sct tokenLedger create --name "MyTokenLedger" --description "A ledger for tracking token distribution" --uri "https://my-token-cdn/{id}.json" --type "Regular" --from_privKey "0xabc123..." --skusetFactoryContract "0x9abcdef..." --network "http://localhost:8545" --memo "Creating new token ledger" --saveToFile true --localFile "./tokenLedgerOutput.json"
Deposit:
The deposit command allows you to deposit tokens into a specified Token Ledger.
Usage
sct tokenLedger deposit --tokenAddress <token-address> --amount <amount> --tokenLedgerAddress <ledger-address> --from_privKey <private-key-or-vault> --network <rpc-url> [options]
--tokenAddress
(required): Address of the token contract that you want to deposit.--amount
, -amt (required): Amount of tokens to deposit, specified as a string. Can use decimal values.--tokenLedgerAddress
(required): Address of the Token Ledger where tokens will be deposited.--from_address
(optional): Sender address, required if --from_privKey is set to "vault".--from_privKey
(required): Sender’s private key, or use 'vault' for vault-based signing, or 'file' for file-based private key signing.--userFile
(optional):Path to the user file, required if --from_privKey is "file".--from_name
(optional): Sender's name, required when using "vault" as --from_privKey.--memo
(optional): Memo for the deposit transaction to the token ledger.--network
(required): Network details (e.g., RPC URL) to interact with.
Example
sct tokenLedger deposit --tokenAddress "0xabcdef1234567890..." --amount "100" --tokenLedgerAddress "0x1234567890abcdef..." --from_privKey "0xabc123..." --network "http://localhost:8545" --memo "Depositing tokens for ledger"
Add attachment:
The addAttachment command allows you to add an attachment to a Token Ledger, using a Content Identifier (CID) that points to the file.
Usage
sct tokenLedger addAttachment --tokenLedgerAddress <ledger-address> --from_privKey <private-key-or-vault> --cid <content-id> --network <rpc-url> [options]
--tokenLedgerAddress
(required): Address of the Token Ledger to which the attachment will be added.--from_address
(optional): Sender address, required if --from_privKey is set to "vault".--from_privKey
(required): Sender’s private key, or use 'vault' for vault-based signing, or 'file' for file-based private key signing.--userFile
(optional):Path to the user file, required if --from_privKey is "file".--from_name
(optional): Sender's name, required when using "vault" as --from_privKey.--cid
(required): Content Identifier (CID) of the file to be attached.--memo
(optional): Memo for the attachment action to the Token Ledger.--network
(required): Network details (e.g., RPC URL) to interact with.
Example
sct tokenLedger addAttachment --tokenLedgerAddress "0x1234567890abcdef..." --from_privKey "vault" --from_address "0x1234567890abcdef..." --from_name "VaultSigner" --cid "Qm...CID..." --network "http://localhost:8545" --memo "Vault-based attachment"
Withdraw:
The withdraw command allows you to withdraw tokens from the Token Ledger.
Usage
sct tokenLedger withdraw --tokenAddress "0xTokenAddress..." --amount "100" --tokenLedgerAddress "0xLedgerAddress..." --from_privKey "0xabc123..." --network "http://localhost:8545" --memo "Withdrawing tokens"
--tokenAddress
(required): The address of the token you want to withdraw.--amount
(required, alias --amt): The amount of tokens you want to withdraw.--tokenLedgerAddress
(required): The address of the Token Ledger.--from_address
(optional): The sender's address, required if --from_privKey is "vault".--from_privKey
(required): Sender’s private key, or use 'vault' for vault-based signing, or 'file' for file-based private key signing.--userFile
(optional):Path to the user file, required if --from_privKey is "file".--from_name
(optional): The sender's name, required when using "vault" as --from_privKey.--memo
(optional): A memo to attach to the transaction for reference.--network
(required): Network details (e.g., RPC URL) to interact with.
Example
sct tokenLedger withdraw --tokenAddress "0xTokenAddress..." --amount "100" --tokenLedgerAddress "0xLedgerAddress..." --from_privKey "0xabc123..." --network "http://localhost:8545" --memo "Withdrawing tokens"
Transfer Ownership:
The transferOwnership command allows you to transfer the ownership of a token ledger from one address to another.
Usage
sct tokenLedger transferOwnership --tokenLedgerAddress <ledger-address> --newOwnerAddress <new-owner-address> --from_privKey <private-key-or-vault> --network <rpc-url> [options]
--tokenLedgerAddress
(required): The address of the Token Ledger from which ownership will be transferred.--newOwnerAddress
(required, alias --na): The address of the new owner.--from_address
(optional): The sender’s address, required if --from_privKey is "vault".--from_privKey
(required): Sender’s private key, or use 'vault' for vault-based signing, or 'file' for file-based private key signing.--userFile
(optional):Path to the user file, required if --from_privKey is "file".--from_name
(optional): The sender’s name, required when using "vault" as --from_privKey.--memo
(optional): A memo for reference, attached to the transaction.--network
(required): Network details (RPC URL) to interact with.
Example
sct tokenLedger transferOwnership --tokenLedgerAddress "0xLedgerAddress..." --newOwnerAddress "0xNewOwnerAddress..." --from_privKey "vault" --from_address "0x1234567890abcdef..." --from_name "VaultSigner" --network "http://localhost:8545" --memo "Transferring ownership"
Details:
The details command retrieves details for a specific Token Ledger based on its address.
Usage
sct tokenLedger details --tokenLedgerAddress <tokenLedgerAddress> --network <rpc-url>
--tokenLedgerAddress
(required): The address of the Token Ledger to retrieve details for.--network
(required): Network details (RPC URL) to interact with.
Example
- Retrieving Token Ledger Details
sct tokenLedger details --tokenLedgerAddress "0x9..." --network "http://localhost:8545"