Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] payprov2 #25

Open
wants to merge 190 commits into
base: feature/paypro-v2
Choose a base branch
from

Conversation

gabrielbazan7
Copy link

No description provided.

micahriggan and others added 30 commits August 13, 2019 10:45
Can now sync ETH and get wallet history for ERC20 tokens
ETH blocks were using the BTC transforms, fixed that
});
let rawBody, headers;

try {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we just re-throw the error, we can remove this try catch, and just use

let { rawBody, headers } = await PayProV2._asyncRequest({

});
}) {
let rawBody, headers;
try {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing here

})
});
let rawBody, headers;
try {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing here

})
});
let rawBody, headers;
try {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

@@ -246,8 +275,15 @@ export class PaymentProtocolV2Client {
throw new Error('Invalid JSON in response body');
}

let payProDetails;
try {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

// BTC Response - ETH Response
if (_.has(responseData, 'instructions[0].requiredFeeRate')) {
const requiredFeeRate = responseData.instructions[0].requiredFeeRate;
if (requiredFeeRate > MAX_FEE_PER_KB) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this currency specific?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to change it for:

MAX_FEE_PER_KB: {
   btc: 10000 * 1000, // 10k sat/b
   bch: 10000 * 1000, // 10k sat/b
   eth: 50000000000, // 50 Gwei
 },

Thanks

}

// ETH Response
if (_.has(responseData, 'instructions[0].value')) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're going to want to loop through the instructions and build a transaction per instruction, rather than get the first index.

@gabrielbazan7 gabrielbazan7 force-pushed the feat/payprov2 branch 11 times, most recently from 9e5eaf0 to bd53fa2 Compare October 7, 2019 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants