def update_registration_data(app: App, registration_field: str, payload: dict, user_private_key: str) -> dict: path = endPoints["updateRegistrationData"] + registration_field msg_type = "update_registration_data_msg" response = message.postRequest(app, path, msg_type, payload, user_private_key) return response
def get_transactions(app: App, payload: dict, user_private_key: str) -> dict: path = endPoints["getTransactions"] msg_type = "get_transaction_msg" response = message.postRequest(app, path, msg_type, payload, user_private_key) return response
def check_instant_ach(app: App, payload: dict, user_private_key: str) -> dict: path = '/check_instant_ach' msg_type = "check_instant_ach" response = message.postRequest(app, path, msg_type, payload, user_private_key) return response
def plaid_link_token(app: App, user_handle: str, android_package_name: str = None) -> dict: path = endPoints["plaid_link_token"] msg_type = "plaid_link_token_msg" payload = {"user_handle": user_handle} if android_package_name is not None: payload["android_package_name"] = android_package_name response = message.postRequest(app, path, msg_type, payload) return response
def getBusinessRoles(self): """Retrieves the list of pre-defined business roles. Args: Returns: dict: response body (business roles) """ path = endPoints["getBusinessRoles"] msg_type = "business_roles_msg" payload = {} response = message.postRequest(self, path, msg_type, payload) return response
def getBusinessTypes(self): """Gets a list of valid business types that can be registered. Args: Returns: dict: response body (business types) """ path = endPoints["getBusinessTypes"] msg_type = "business_types_msg" payload = {} response = message.postRequest(self, path, msg_type, payload) return response
def registerWallet(self, payload, user_private_key): """Register a new wallet Args: payload : Required user_handle to check if its available Returns: dict: response body (a confirmation message) """ path = endPoints["registerWallet"] msg_type = "register_wallet_msg" response = message.postRequest(self, path, msg_type, payload, user_private_key) return response
def deleteWallet(self, payload, user_private_key): """Delete a wallet Args: payload : Required user_handle to check if its available Returns: dict: response body (a confirmation message) """ path = endPoints["deleteWallet"] msg_type = "no_content_msg" response = message.postRequest(self, path, msg_type, payload, user_private_key) return response
def getWallets(self, payload, user_private_key): """Get wallet list Args: payload : Required user_handle to check if its available Returns: dict: response body (a confirmation message) """ path = endPoints["getWallets"] msg_type = "get_wallets_msg" response = message.postRequest(self, path, msg_type, payload, user_private_key) return response
def getNaicsCategories(self): """ Args: Returns: dict: response body (business roles) """ path = endPoints["getNaicsCategories"] msg_type = "naics_categories_msg" payload = {} response = message.postRequest(self, path, msg_type, payload) return response
def get_transactions(app: App, payload: dict, user_private_key: str = '') -> dict: if user_private_key != '': warnings.warn( 'user_private_key is no longer needed, this will be removed in future versions.', DeprecationWarning) path = endPoints["getTransactions"] msg_type = "get_transaction_msg" response = message.postRequest(app, path, msg_type, payload) return response
def reverseTransaction(self, payload, user_private_key): """ Reverse transaction under certain circumstances Args: payload : user handle and transaction id user_private_key: users ethereum private key Returns: dict: response body (a confirmation message) """ path = endPoints["reverseTransaction"] msg_type = "reverse_transaction_msg" response = postRequest(self, path, msg_type, payload, user_private_key) return response
def checkHandle(self, payload): """Check if the user handle is available. These endpoint returns the validity of a user handle Args: payload : Required user_handle to check if its available Returns: dict: response body (a confirmation message) """ path = endPoints["checkHandle"] msg_type = "header_msg" response = message.postRequest(self, path, msg_type, payload) return response
def register(self, payload): """Register a new user. This user will be kyced and ethereum address will be registered with sila Args: payload : info about user like name,ssn, dob,ethereum address, ethereum handle etc Returns: dict: response body (a confirmation message) """ path = endPoints["register"] msg_type = "entity_msg" response = message.postRequest(self, path, msg_type, payload) return response
def checkKyc(self, payload, user_private_key): """check if the user has been kyced. The user will be checked if the they have been kyced Args: payload : includes Returns: dict: response body (a confirmation message) """ path = endPoints["checkKyc"] msg_type = "header_msg" response = message.postRequest(self, path, msg_type, payload, user_private_key) return response
def requestKyc(self, payload, user_private_key): """Request kyc for a user by handle This user will be kyced and ethereum address will be registered with sila Args: payload : info about user like name,ssn, dob,ethereum address, ethereum handle etc Returns: dict: response body (a confirmation message) """ path = endPoints["requestKyc"] msg_type = "header_msg" response = message.postRequest(self, path, msg_type, payload, user_private_key) return response
def getAccountBalance(self, payload, user_private_key): """get the account balance of a user registered with sila Args: user_hanlde: users handle registered with app user_private_key: user private key asscoicated with crypto address Returns: dict: response body (a confirmation message) """ path = endPoints["getAccountBalance"] msg_type = "account_name_msg" response = message.postRequest(self, path, msg_type, payload, user_private_key) return response
def plaidSamedayAuth(self, payload, user_private_key): """ Handle a request for a Plaid public_token in order to complete Plaid's Same Day Microdeposit Authentication Args: payload : user handle and amount user_private_key: users ethereum private key Returns: dict: response body (a confirmation message) """ path = endPoints["plaidSameDayAuth"] msg_type = "account_name_msg" response = message.postRequest(self, path, msg_type, payload, user_private_key) return response
def transferSila(self, payload, user_private_key, use_destination_address=False): """ transfer sila from one ethereum address to another using sila api the handle address signatures need to be verified Args: payload : user handle and amount user_private_key: users ethereum private key Returns: dict: response body (a confirmation message) """ path = endPoints["transferSila"] msg_type = "transfer_msg" response = message.postRequest(self, path, msg_type, payload, user_private_key) return response
def issueSila(self, payload, user_private_key): """issues sila erc20token for dollar amount on ethereum blockchain to kyced ethereum addresses (price one cent per token) the handle address signatures need to be verified Args: payload : includes user handle and amount user_private_key: users ethereum private key Returns: dict: response body (a confirmation message) """ path = endPoints["issueSila"] msg_type = "issue_msg" response = message.postRequest(self, path, msg_type, payload, user_private_key) return response
def getSilaBalance(self, address): """get sila balance of the addresses registered with sila The user will be checked if they have been kyced, along with app Args: address: requires valid ethereum address Returns: dict: response body (a confirmation message) """ payload = {"address": str(address)} path = endPoints["getSilaBalance"] msg_type = "sila_balance_msg" response = message.postRequest(self, path, msg_type, payload) return response
def certifyBusiness(self, payload, user_private_key, business_private_key): """ Args: payload: includes business information. user_private_key: business_private_key: Returns: dict: response body (confirmation message) """ path = endPoints["certifyBusiness"] msg_type = "certify_business_msg" response = message.postRequest(self, path, msg_type, payload, user_private_key, business_private_key) return response
def linkBusinessMember(self, payload, user_private_key, business_private_key): """ Args: payload: includes member information. user_private_key: business_private_key: Returns: dict: response body (confirmation message) """ path = endPoints["linkBusinessMember"] msg_type = "link_business_member_msg" response = message.postRequest(self, path, msg_type, payload, user_private_key, business_private_key) return response
def linkAccount(self, payload, user_private_key): """link the bank account of user using plad This users bank account will be linked Args: payload : need user handle and plad token user_private_key: users ethereum private key Returns: dict: response body (a confirmation message) """ path = endPoints["linkAccount"] msg_type = "link_account_msg" response = message.postRequest(self, path, msg_type, payload, user_private_key) return response
def getTransactions(self, payload, user_private_key): """get the users transactions registered with ur app The user will be checked if they have been kyced, along with app Args: user_hanlde: users handle registered with app user_private_key: user private key asscoicated with crypto address Returns: dict: response body (a confirmation message) """ path = endPoints["getTransactions"] msg_type = "header_msg" response = message.postRequest(self, path, msg_type, payload, user_private_key) return response
def deleteRegistrationData(self, registration_field, payload, user_private_key): """ Args: payload: registration data user_private_key Returns: dict: response body (entity information) """ path = endPoints["deleteRegistrationData"] + registration_field msg_type = "delete_registration_data_msg" response = message.postRequest(self, path, msg_type, payload, user_private_key) return response
def getPaymentMethods(self, payload, user_private_key): """get the accounts of users registered with sila The user will be checked if they have been kyced, along with app Args: user_hanlde: users handle registered with app user_private_key: user private key asscoicated with crypto address Returns: dict: response body (a confirmation message) """ path = endPoints["getPaymentMethods"] msg_type = "get_payment_methods" response = message.postRequest(self, path, msg_type, payload, user_private_key) return response
def addCrypto(self, payload, user_private_key): """check if the user has been kyced. The used will be checked if the they have been kyced Args: payload : includes the crypto adddress, handle etc that need to be added user_private_key: users ethereum private key Returns: dict: response body (a confirmation message) """ path = endPoints["addCrypto"] msg_type = "crypto_msg" response = message.postRequest(self, path, crypto, payload, user_private_key) return response
def addIdentity(self, payload, user_private_key): """change the info about user like change ssn, email ,etc. The used will be checked if the they have been kyced Args: payload : includes information to be edited and usee handle user_private_key: users ethereum private key Returns: dict: response body (a confirmation message) """ path = endPoints["addIdentity"] msg_type = "identity_msg" response = message.postRequest(self, path, msg_type, payload, user_private_key) return response
def update_wallet(app: App, payload: dict, user_private_key: str) -> dict: """Update a wallet Args: app (App): The app configuration object payload (dict) : Required user_handle to check if its available user_private_key (str): The user handle's private key to sign the request Returns: dict: response body (a confirmation message) """ path = endPoints["updateWallet"] msg_type = "update_wallet_msg" response = message.postRequest(app, path, msg_type, payload, user_private_key) return response