Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

Commit

Permalink
Merge pull request #3 from argoapp-live/biconomy
Browse files Browse the repository at this point in the history
Added Biconomy support
  • Loading branch information
rekpero authored Jun 11, 2021
2 parents 4e3d694 + 2933660 commit b15c2bb
Show file tree
Hide file tree
Showing 28 changed files with 7,477 additions and 5,887 deletions.
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,34 @@
| $$ \$$ $$ \$$ $$
\$$ \$$$$$$ \$$$$$$
```
#### Javascript library for working with the Payment Contracts in ArGo
#### Typescript library for working with the Payment Contracts in ArGo

> Important Notice: ArGo is in its Alpha stage. If you have a suggestion, idea, or find a bug, please report it! The ArGo team will not be held accountable for any funds lost.
## About ArGo
ArGo is a simple & powerful platform to deploy your frontend app to Decentralised Storage Protocols where your app will live for eternity.

## Build argo-payments-js
Follow below steps to build argo-payments-js in local

> Note: Our current latest stable branch is Master. After clone make sure you are on master branch
- Clone argo-payments-js code into your local by using `git clone https://github.com/argoapp-live/argo-payments-js.git`
- Install packages using either yarn or npm from root folder `yarn` or `npm install`
- Run `yarn build` or `npm run dev`


## Run argo-payments-js tests
- Clone argo-payments-js code into your local by using `git clone https://github.com/argoapp-live/argo-payments-js.git`
- Install packages using either yarn or npm from root folder `yarn` or `npm install`
- Make sure you add all the values in `.env` file before running tests.
- Run `yarn test` or `npm test`.
- A sample env file would look like
```
COINMARKETCAP_KEY="COINMARKET_CAP_API_KEY"
BICONOMY_KEY="BICONOMY_API_KEY"
MNEMONIC_TEST="MNEMONIC_FOR_ACCOUNT"
RPC_ENDPOINT="JSON_RPC_ENDPOINT_FOR_ETHEREUM_NETWORK"
```
> Note: you can ping us on discord and we will be happy to share our .env file with you

3 changes: 2 additions & 1 deletion build/abstracts/deployed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export default abstract class implements Keyed {
vendor: Vendor;
paymentsContract?: Contract;
erc20Contract?: Contract;
biconomyERC20Contract?: Contract;
services: Services;
protected constructor(v: Vendor, a: Abi, e: Abi);
at(a: string, e: string, o?: TransactOpts): boolean;
at(a: string, e: string, o?: TransactOpts): Promise<boolean>;
}
22 changes: 18 additions & 4 deletions build/abstracts/deployed.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Expand All @@ -12,10 +21,15 @@ class default_1 {
this.services = new services_1.default();
}
at(a, e, o) {
this.paymentsContract = this.vendor.contract(a, this.paymentsAbi, o);
this.erc20Contract = this.vendor.contract(e, this.erc20Abi);
this.services = new services_1.default();
return !!this.paymentsContract;
return __awaiter(this, void 0, void 0, function* () {
this.paymentsContract = this.vendor.contract(a, this.paymentsAbi, o);
this.erc20Contract = this.vendor.contract(e, this.erc20Abi);
this.services = new services_1.default();
if (this.vendor.biconomy !== undefined) {
this.biconomyERC20Contract = this.vendor.contract(e, this.erc20Abi, this.vendor.biconomy.getSignerByAddress(yield this.vendor.signer.getAddress()));
}
return !!this.paymentsContract && !!this.erc20Contract;
});
}
}
exports.default = default_1;
6 changes: 5 additions & 1 deletion build/abstracts/vendor.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import { Keyed, Contract, TransactOpts } from '../interfaces';
import { Keyed, Contract, TransactOpts, SignatureParams } from '../interfaces';
import { Abi } from '../@types';
export default abstract class implements Keyed {
[key: string]: any;
provider: any;
signer: any;
biconomy: any;
abstract contract(address: string, abi: Abi, o?: TransactOpts): Contract;
abstract convertToBN(amount: string): any;
abstract convertToWei(amount: string): any;
abstract convertStringArrayToBigNumberArray(array: Array<string>): Array<any>;
abstract convertWeiToEth(wei: any): any;
abstract verifySignedMessage(m: string, s: string): any;
abstract signMessage(m: string): Promise<string>;
abstract getSignatureParameters(signature: string): SignatureParams;
abstract abiEncodeErc20Functions(f: string, p: Array<any>): string;
abstract signedMessageForTx(u: string, n: number, f: string, a: string, c: number): Promise<string>;
}
47 changes: 26 additions & 21 deletions build/constants/payment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,41 +38,46 @@ export declare const PAYMENT_ABI: ({
anonymous?: undefined;
})[];
export declare const ERC20_ABI: ({
inputs: {
internalType: string;
name: string;
type: string;
}[];
stateMutability: string;
type: string;
anonymous?: undefined;
stateMutability: string;
inputs: never[];
name?: undefined;
anonymous?: undefined;
outputs?: undefined;
} | {
anonymous: boolean;
type: string;
name: string;
inputs: {
indexed: boolean;
internalType: string;
name: string;
type: string;
name: string;
internalType: string;
indexed: boolean;
}[];
name: string;
type: string;
anonymous: boolean;
stateMutability?: undefined;
outputs?: undefined;
} | {
inputs: {
internalType: string;
name: string;
type: string;
stateMutability: string;
outputs: {
type: string;
name: string;
internalType: string;
}[];
name: string;
outputs: {
internalType: string;
name: string;
inputs: {
type: string;
name: string;
internalType: string;
}[];
stateMutability: string;
type: string;
anonymous?: undefined;
})[];
export declare const metaTransactionType: {
name: string;
type: string;
}[];
export declare const domainType: {
name: string;
type: string;
}[];
export declare const ERC20Interface: string[];
Loading

0 comments on commit b15c2bb

Please sign in to comment.