These functions are intended to be invoked from within the agent.
Creating a Keypair for your Agent
Generate a new keypair for a specified blockchain
defgen_keypair(self,blockchain:str) -> Tuple[str,str]:""" Args: blockchain (str): The blockchain for which to generate the keypair. Returns: Tuple[str, str]: The public key and private key. """
Authorize a keypair for blockchain transactions.
defauthorize_keypair(self,agent_id:str,blockchain:str,permissions:dict) -> Card:""" Args: agent_id (str): The ID of the agent. blockchain (str): The blockchain to authorize. permissions (dict): The permissions and limits for the keypair. Returns: Card: The authorized keypair object. """
Purchases
Retrieve cards authorized for a specific use case.
defretrieve_authorized_cards(self,use_case:str) -> List[Card]:""" Args: use_case (str): The use case for filtering the cards. Returns: List[Card]: The list of authorized cards. """
Describe an expense for a card
defdescribe_expense(self,card: Card,estimated_txn_size:float,txn_description:str) ->str:""" Args: card (Card): The card to use for the expense. estimated_txn_size (float): The estimated size of the transaction. txn_description (str): The description of the transaction. Returns: str: The transaction ID. """
Screen a vendor to assess the likelihood of fraud
defscreen_vendor(vendor_id:str,transaction_amount:int,vendor_info:dict=None) ->dict:""" Returns: VendorScreen: The result of screening the vendor. """
Report an issue with a purchase.
defreport_purchase_issue(self,card_id:str,transaction_id:str,issue_description:str) -> IssueReport:""" Args: card_id (str): The ID of the card. transaction_id (str): The ID of the transaction. issue_description (str): The description of the issue. Returns: IssueReport: The issue report object. """
Initiate a buyer dispute for a transaction
definitiate_buyer_dispute(self,card_id:str,transaction_id:str,dispute_reason:str) -> DisputeResult:""" Args: card_id (str): The ID of the card. transaction_id (str): The ID of the transaction. dispute_reason (str): The reason for the dispute. Returns: DisputeResult: The result of the dispute initiation. """