Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

create custom instructions to take funds from this account

Satinder Rawal answered on April 23, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers


create custom instructions to take funds from this account

0

The get_balance_timeseries function will return a BalanceTimeseries object which in turn uses the function latest() to return a dictionary made up of 4-tuple keys, and Balance object values. These keys are formed of account address, asset, denomination, and phase, the first three of which we have already covered. The Phase specifies the status of the money we are interested in - where PENDING_IN would be money that has been authorised to enter the account, but not yet settled, and PENDING_OUT would be money that has been authorised to leave the account, but not yet settled. The COMMITTED phase denotes the balance of the account (and address and denomination) where only settled postings are considered. Once we have the necessary balance, we can then request its debit, credit, or net values to perform whatever calculation we need to - in this example we use .net to check if it is less than -overdraft_limit.

In order to use Vault objects in non-hook functions, vault must be passed in as a parameter. Here we use this to get the denomination parameter as well as the overdraft_fee. We then create custom instructions to take funds from this account and move them to the internal account that we defined earlier, and finally use instruct posting batch to create a new batch of PostingInstructions. 

Popularity 1/10 Helpfulness 1/10 Language python
Source: Grepper
Link to this answer
Share Copy Link
Contributed on Apr 23 2023
Satinder Rawal
0 Answers  Avg Quality 2/10


X

Continue with Google

By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
X
Grepper Account Login Required

Oops, You will need to install Grepper and log-in to perform this action.