@verified-network/verified-sdk 2.4.9 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contract/amm/margin/index.d.ts +1 -1
- package/dist/contract/amm/margin/index.js +2 -2
- package/dist/contract/amm/primary/index.d.ts +1 -1
- package/dist/contract/amm/primary/index.js +2 -2
- package/dist/contract/amm/secondary/index.d.ts +1 -1
- package/dist/contract/amm/secondary/index.js +2 -2
- package/dist/contract/bond/index.d.ts +1 -1
- package/dist/contract/bond/index.js +2 -2
- package/dist/contract/cash/index.d.ts +1 -1
- package/dist/contract/cash/index.js +2 -2
- package/dist/contract/client/index.d.ts +1 -1
- package/dist/contract/client/index.js +2 -2
- package/dist/contract/custody/index.d.ts +1 -1
- package/dist/contract/custody/index.js +2 -2
- package/dist/contract/distribution/index.d.ts +1 -1
- package/dist/contract/distribution/index.js +2 -2
- package/dist/contract/erc20/index.d.ts +1 -1
- package/dist/contract/erc20/index.js +2 -2
- package/dist/contract/factory/index.d.ts +1 -1
- package/dist/contract/factory/index.js +2 -2
- package/dist/contract/index.d.ts +2 -1
- package/dist/contract/index.js +63 -26
- package/dist/contract/liquidity/index.d.ts +1 -1
- package/dist/contract/liquidity/index.js +2 -2
- package/dist/contract/loans/compound/index.d.ts +1 -1
- package/dist/contract/loans/compound/index.js +2 -2
- package/dist/contract/pool/index.d.ts +1 -1
- package/dist/contract/pool/index.js +2 -2
- package/dist/contract/rates/index.d.ts +1 -1
- package/dist/contract/rates/index.js +2 -2
- package/dist/contract/securitiesfactory/index.d.ts +1 -1
- package/dist/contract/securitiesfactory/index.js +2 -2
- package/dist/contract/security/index.d.ts +1 -1
- package/dist/contract/security/index.js +2 -2
- package/dist/contract/token/index.d.ts +1 -1
- package/dist/contract/token/index.js +2 -2
- package/dist/contractAddress/index.js +4 -4
- package/dist/lib/abi/boostrap.d.ts +878 -0
- package/dist/lib/abi/boostrap.js +1151 -0
- package/dist/lib/abi/boostrap.json +1150 -0
- package/dist/lib/abi/composability.d.ts +66 -0
- package/dist/lib/abi/composability.js +273 -0
- package/dist/lib/abi/entrypoint.d.ts +775 -0
- package/dist/lib/abi/entrypoint.js +660 -0
- package/dist/lib/abi/factory.json +325 -0
- package/dist/lib/biconomyRNFix.d.ts +20737 -0
- package/dist/lib/biconomyRNFix.js +974 -0
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@ import { VerifiedWallet } from "../../../wallet";
|
|
|
3
3
|
export default class MarginIssueManager extends VerifiedContract {
|
|
4
4
|
contractAddress: string;
|
|
5
5
|
constructor(signer: VerifiedWallet, contractNetworkAddress: string);
|
|
6
|
-
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string): Promise<{
|
|
6
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string, isReactNative?: boolean): Promise<{
|
|
7
7
|
tokenAddress: string;
|
|
8
8
|
amount: string;
|
|
9
9
|
amountInWei: string;
|
|
@@ -24,8 +24,8 @@ class MarginIssueManager extends index_1.VerifiedContract {
|
|
|
24
24
|
super(address, JSON.stringify(MarginIssueManager_json_1.abi), signer);
|
|
25
25
|
this.contractAddress = address;
|
|
26
26
|
}
|
|
27
|
-
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl) {
|
|
28
|
-
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey);
|
|
27
|
+
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl, isReactNative) {
|
|
28
|
+
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey, isReactNative);
|
|
29
29
|
}
|
|
30
30
|
async issueProduct(security, securityType, currency, cficode, securityAmount, minOrderSize, currencyAmount, margin, collateral, tradeFee, options) {
|
|
31
31
|
await this.validateInput(index_1.DATATYPES.ADDRESS, security);
|
|
@@ -3,7 +3,7 @@ import { VerifiedWallet } from "../../../wallet";
|
|
|
3
3
|
export default class PrimaryIssueManager extends VerifiedContract {
|
|
4
4
|
contractAddress: string;
|
|
5
5
|
constructor(signer: VerifiedWallet, platformAddress: string, platform: string);
|
|
6
|
-
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string): Promise<{
|
|
6
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string, isReactNative?: boolean): Promise<{
|
|
7
7
|
tokenAddress: string;
|
|
8
8
|
amount: string;
|
|
9
9
|
amountInWei: string;
|
|
@@ -29,8 +29,8 @@ class PrimaryIssueManager extends index_1.VerifiedContract {
|
|
|
29
29
|
super(address, JSON.stringify(abiKyber), signer);
|
|
30
30
|
this.contractAddress = address;
|
|
31
31
|
}
|
|
32
|
-
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl) {
|
|
33
|
-
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey);
|
|
32
|
+
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl, isReactNative) {
|
|
33
|
+
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey, isReactNative);
|
|
34
34
|
}
|
|
35
35
|
async offer(owned, isin, offered, tomatch, desired, min, issuer, docs, options) {
|
|
36
36
|
await this.validateInput(index_1.DATATYPES.ADDRESS, owned);
|
|
@@ -3,7 +3,7 @@ import { VerifiedWallet } from "../../../wallet";
|
|
|
3
3
|
export default class SecondaryIssueManager extends VerifiedContract {
|
|
4
4
|
contractAddress: string;
|
|
5
5
|
constructor(signer: VerifiedWallet, contractNetworkAddress: string);
|
|
6
|
-
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string): Promise<{
|
|
6
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string, isReactNative?: boolean): Promise<{
|
|
7
7
|
tokenAddress: string;
|
|
8
8
|
amount: string;
|
|
9
9
|
amountInWei: string;
|
|
@@ -22,8 +22,8 @@ class SecondaryIssueManager extends index_1.VerifiedContract {
|
|
|
22
22
|
super(address, JSON.stringify(SecondaryIssueManager_json_1.abi), signer);
|
|
23
23
|
this.contractAddress = address;
|
|
24
24
|
}
|
|
25
|
-
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl) {
|
|
26
|
-
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey);
|
|
25
|
+
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl, isReactNative) {
|
|
26
|
+
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey, isReactNative);
|
|
27
27
|
}
|
|
28
28
|
async issueSecondary(security, currency, securityOutstanding, securityAmount, minOrderSize, currencyAmount, options) {
|
|
29
29
|
await this.validateInput(index_1.DATATYPES.ADDRESS, security);
|
|
@@ -3,7 +3,7 @@ import { VerifiedWallet } from "../../wallet";
|
|
|
3
3
|
export default class Bond extends VerifiedContract {
|
|
4
4
|
contractAddress: string;
|
|
5
5
|
constructor(signer: VerifiedWallet, bondCurrencyAddress: string);
|
|
6
|
-
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string): Promise<{
|
|
6
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string, isReactNative?: boolean): Promise<{
|
|
7
7
|
tokenAddress: string;
|
|
8
8
|
amount: string;
|
|
9
9
|
amountInWei: string;
|
|
@@ -35,8 +35,8 @@ class Bond extends index_1.VerifiedContract {
|
|
|
35
35
|
super(address, JSON.stringify(Bond_json_1.abi), signer);
|
|
36
36
|
this.contractAddress = address;
|
|
37
37
|
}
|
|
38
|
-
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl) {
|
|
39
|
-
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey);
|
|
38
|
+
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl, isReactNative) {
|
|
39
|
+
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey, isReactNative);
|
|
40
40
|
}
|
|
41
41
|
async requestIssue(_amount, _payer, _payee, _currency, _cashContract, options) {
|
|
42
42
|
await this.validateInput(index_1.DATATYPES.NUMBER, _amount);
|
|
@@ -3,7 +3,7 @@ import { VerifiedWallet } from "../../wallet";
|
|
|
3
3
|
export default class Cash extends VerifiedContract {
|
|
4
4
|
contractAddress: string;
|
|
5
5
|
constructor(signer: VerifiedWallet, currencyAddress: string);
|
|
6
|
-
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string): Promise<{
|
|
6
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string, isReactNative?: boolean): Promise<{
|
|
7
7
|
tokenAddress: string;
|
|
8
8
|
amount: string;
|
|
9
9
|
amountInWei: string;
|
|
@@ -32,8 +32,8 @@ class Cash extends index_1.VerifiedContract {
|
|
|
32
32
|
super(address, JSON.stringify(Cash_json_1.abi), signer);
|
|
33
33
|
this.contractAddress = address;
|
|
34
34
|
}
|
|
35
|
-
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl) {
|
|
36
|
-
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey);
|
|
35
|
+
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl, isReactNative) {
|
|
36
|
+
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey, isReactNative);
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* Request pay out [callable by manager]
|
|
@@ -3,7 +3,7 @@ import { VerifiedWallet } from "../../wallet";
|
|
|
3
3
|
export default class Client extends VerifiedContract {
|
|
4
4
|
contractAddress: string;
|
|
5
5
|
constructor(signer: VerifiedWallet, contractNetworkAddress: string);
|
|
6
|
-
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string): Promise<{
|
|
6
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string, isReactNative?: boolean): Promise<{
|
|
7
7
|
tokenAddress: string;
|
|
8
8
|
amount: string;
|
|
9
9
|
amountInWei: string;
|
|
@@ -32,8 +32,8 @@ class Client extends index_1.VerifiedContract {
|
|
|
32
32
|
super(address, JSON.stringify(Client_json_1.abi), signer);
|
|
33
33
|
this.contractAddress = address;
|
|
34
34
|
}
|
|
35
|
-
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl) {
|
|
36
|
-
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey);
|
|
35
|
+
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl, isReactNative) {
|
|
36
|
+
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey, isReactNative);
|
|
37
37
|
}
|
|
38
38
|
async setSigner(_address, options) {
|
|
39
39
|
await this.validateInput(index_1.DATATYPES.ADDRESS, _address);
|
|
@@ -3,7 +3,7 @@ import { VerifiedWallet } from "../../wallet";
|
|
|
3
3
|
export default class Custody extends VerifiedContract {
|
|
4
4
|
contractAddress: string;
|
|
5
5
|
constructor(signer: VerifiedWallet, contractNetworkAddress: string);
|
|
6
|
-
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string): Promise<{
|
|
6
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string, isReactNative?: boolean): Promise<{
|
|
7
7
|
tokenAddress: string;
|
|
8
8
|
amount: string;
|
|
9
9
|
amountInWei: string;
|
|
@@ -35,8 +35,8 @@ class Custody extends index_1.VerifiedContract {
|
|
|
35
35
|
super(address, JSON.stringify(Vault_json_1.abi), signer);
|
|
36
36
|
this.contractAddress = address;
|
|
37
37
|
}
|
|
38
|
-
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl) {
|
|
39
|
-
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey);
|
|
38
|
+
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl, isReactNative) {
|
|
39
|
+
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey, isReactNative);
|
|
40
40
|
}
|
|
41
41
|
async createVault(_creator, options) {
|
|
42
42
|
await this.validateInput(index_1.DATATYPES.BYTE32, _creator);
|
|
@@ -3,7 +3,7 @@ import { VerifiedWallet } from "../../../wallet";
|
|
|
3
3
|
export default class Distribution extends VerifiedContract {
|
|
4
4
|
contractAddress: string;
|
|
5
5
|
constructor(signer: VerifiedWallet, contractNetworkAddress: string);
|
|
6
|
-
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string): Promise<{
|
|
6
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string, isReactNative?: boolean): Promise<{
|
|
7
7
|
tokenAddress: string;
|
|
8
8
|
amount: string;
|
|
9
9
|
amountInWei: string;
|
|
@@ -22,8 +22,8 @@ class Distribution extends index_1.VerifiedContract {
|
|
|
22
22
|
super(address, JSON.stringify(Distribution_json_1.abi), signer);
|
|
23
23
|
this.contractAddress = address;
|
|
24
24
|
}
|
|
25
|
-
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl) {
|
|
26
|
-
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey);
|
|
25
|
+
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl, isReactNative) {
|
|
26
|
+
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey, isReactNative);
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
Shares fee income with revenue shareholders
|
|
@@ -3,7 +3,7 @@ import { VerifiedWallet } from "../../wallet";
|
|
|
3
3
|
export default class ERC20 extends VerifiedContract {
|
|
4
4
|
contractAddress: string;
|
|
5
5
|
constructor(signer: VerifiedWallet, contractNetworkAddress: string);
|
|
6
|
-
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string): Promise<{
|
|
6
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string, isReactNative?: boolean): Promise<{
|
|
7
7
|
tokenAddress: string;
|
|
8
8
|
amount: string;
|
|
9
9
|
amountInWei: string;
|
|
@@ -24,8 +24,8 @@ class ERC20 extends index_1.VerifiedContract {
|
|
|
24
24
|
super(address, JSON.stringify(ERC20_json_1.abi), signer);
|
|
25
25
|
this.contractAddress = address;
|
|
26
26
|
}
|
|
27
|
-
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl) {
|
|
28
|
-
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey);
|
|
27
|
+
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl, isReactNative) {
|
|
28
|
+
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey, isReactNative);
|
|
29
29
|
}
|
|
30
30
|
async name() {
|
|
31
31
|
return this.callContract(FUNCTIONS.NAME);
|
|
@@ -3,7 +3,7 @@ import { VerifiedWallet } from "../../wallet";
|
|
|
3
3
|
export default class Factory extends VerifiedContract {
|
|
4
4
|
contractAddress: string;
|
|
5
5
|
constructor(signer: VerifiedWallet, contractNetworkAddress: string);
|
|
6
|
-
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string): Promise<{
|
|
6
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string, isReactNative?: boolean): Promise<{
|
|
7
7
|
tokenAddress: string;
|
|
8
8
|
amount: string;
|
|
9
9
|
amountInWei: string;
|
|
@@ -30,8 +30,8 @@ class Factory extends index_1.VerifiedContract {
|
|
|
30
30
|
super(address, JSON.stringify(Factory_json_1.abi), signer);
|
|
31
31
|
this.contractAddress = address;
|
|
32
32
|
}
|
|
33
|
-
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl) {
|
|
34
|
-
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey);
|
|
33
|
+
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl, isReactNative) {
|
|
34
|
+
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey, isReactNative);
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* Get number of tokens [callable by client]
|
package/dist/contract/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export type Options = {
|
|
|
26
26
|
paymentToken?: string;
|
|
27
27
|
apiKey?: string;
|
|
28
28
|
rpcUrl?: string;
|
|
29
|
+
isReactNative?: boolean;
|
|
29
30
|
};
|
|
30
31
|
export declare class VerifiedContract {
|
|
31
32
|
private signer;
|
|
@@ -61,7 +62,7 @@ export declare class VerifiedContract {
|
|
|
61
62
|
/** Constructs and call function using MEE client that allows gas payment in ERC20 tokens */
|
|
62
63
|
callFunctionWithMEEClient(nexusAccount: any, chainId: number, tx: any, paymentToken: `0x${string}`, _apiKey?: string): Promise<SCResponse>;
|
|
63
64
|
callContract(functionName: string, ...args: any): Promise<SCResponse>;
|
|
64
|
-
getQuote(paymentTokenAddress: string, functionName: string, args: any[], rpc?: string, _apiKey?: string): Promise<{
|
|
65
|
+
getQuote(paymentTokenAddress: string, functionName: string, args: any[], rpc?: string, _apiKey?: string, isReactNative?: boolean): Promise<{
|
|
65
66
|
tokenAddress: string;
|
|
66
67
|
amount: string;
|
|
67
68
|
amountInWei: string;
|
package/dist/contract/index.js
CHANGED
|
@@ -8,6 +8,7 @@ const constants_1 = require("../utils/constants");
|
|
|
8
8
|
const abstractjs_1 = require("@biconomy/abstractjs");
|
|
9
9
|
const chains_1 = require("viem/chains");
|
|
10
10
|
const viem_1 = require("viem");
|
|
11
|
+
const biconomyRNFix_1 = require("../lib/biconomyRNFix");
|
|
11
12
|
var STATUS;
|
|
12
13
|
(function (STATUS) {
|
|
13
14
|
STATUS[STATUS["SUCCESS"] = 0] = "SUCCESS";
|
|
@@ -414,6 +415,7 @@ class VerifiedContract {
|
|
|
414
415
|
account: nexusAccount,
|
|
415
416
|
apiKey: _apiKey || constants_1.PaymasterConstants.MEE_API_KEY,
|
|
416
417
|
});
|
|
418
|
+
console.log("meeClient created....");
|
|
417
419
|
const transactionInstruction = await nexusAccount.build({
|
|
418
420
|
type: "default",
|
|
419
421
|
data: {
|
|
@@ -435,8 +437,10 @@ class VerifiedContract {
|
|
|
435
437
|
console.log(`MEE transaction hash: ${hash}`);
|
|
436
438
|
// Wait for transaction to complete
|
|
437
439
|
const receipt = await meeClient.waitForSupertransactionReceipt({ hash });
|
|
438
|
-
|
|
439
|
-
|
|
440
|
+
// console.log("receipts: ", receipt);
|
|
441
|
+
// console.log("receipt: ", receipt?.receipts);
|
|
442
|
+
if (((_a = receipt === null || receipt === void 0 ? void 0 : receipt.receipts) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
443
|
+
//always pick last receipt????
|
|
440
444
|
const txReceipt = receipt === null || receipt === void 0 ? void 0 : receipt.receipts[((_b = receipt === null || receipt === void 0 ? void 0 : receipt.receipts) === null || _b === void 0 ? void 0 : _b.length) - 1];
|
|
441
445
|
if ((txReceipt === null || txReceipt === void 0 ? void 0 : txReceipt.status) === "success") {
|
|
442
446
|
res.status = STATUS.SUCCESS;
|
|
@@ -457,7 +461,7 @@ class VerifiedContract {
|
|
|
457
461
|
return res;
|
|
458
462
|
}
|
|
459
463
|
else {
|
|
460
|
-
console.error("MEE client transaction failed with error: ", "
|
|
464
|
+
console.error("MEE client transaction failed with error: ", "Invalid receipts length");
|
|
461
465
|
res.status = STATUS.ERROR;
|
|
462
466
|
res.response = {
|
|
463
467
|
hash: (_c = receipt === null || receipt === void 0 ? void 0 : receipt.receipts[0]) === null || _c === void 0 ? void 0 : _c.transactionHash,
|
|
@@ -479,7 +483,7 @@ class VerifiedContract {
|
|
|
479
483
|
}
|
|
480
484
|
}
|
|
481
485
|
async callContract(functionName, ...args) {
|
|
482
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
486
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
483
487
|
// Check if the function is a read function
|
|
484
488
|
if (this.isReadFunction(functionName)) {
|
|
485
489
|
console.log("read function will use ethers");
|
|
@@ -533,22 +537,36 @@ class VerifiedContract {
|
|
|
533
537
|
}
|
|
534
538
|
const prov = this.signer.provider;
|
|
535
539
|
const rpcUrl = (_e = prov === null || prov === void 0 ? void 0 : prov.connection) === null || _e === void 0 ? void 0 : _e.url;
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
(
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
540
|
+
let nexusAccount;
|
|
541
|
+
if ((_f = optionsRaw[0]) === null || _f === void 0 ? void 0 : _f.isReactNative) {
|
|
542
|
+
nexusAccount = await (0, biconomyRNFix_1.createMultiChainNexusAccount)({
|
|
543
|
+
chains: [chainToUse],
|
|
544
|
+
transports: [
|
|
545
|
+
(0, viem_1.http)(rpcUrl ||
|
|
546
|
+
((_g = optionsRaw[0]) === null || _g === void 0 ? void 0 : _g.rpcUrl) ||
|
|
547
|
+
((_h = constants_1.PaymasterConstants[Number(chainId)]) === null || _h === void 0 ? void 0 : _h.RPC_URL)),
|
|
548
|
+
],
|
|
549
|
+
signer: _signer,
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
else {
|
|
553
|
+
nexusAccount = await (0, abstractjs_1.toMultichainNexusAccount)({
|
|
554
|
+
chains: [chainToUse],
|
|
555
|
+
transports: [
|
|
556
|
+
(0, viem_1.http)(rpcUrl ||
|
|
557
|
+
((_j = optionsRaw[0]) === null || _j === void 0 ? void 0 : _j.rpcUrl) ||
|
|
558
|
+
((_k = constants_1.PaymasterConstants[Number(chainId)]) === null || _k === void 0 ? void 0 : _k.RPC_URL)),
|
|
559
|
+
],
|
|
560
|
+
signer: _signer,
|
|
561
|
+
});
|
|
562
|
+
}
|
|
545
563
|
const meeAddress = nexusAccount.addressOn(chainId);
|
|
546
564
|
// console.log("nexus account address: ", meeAddress);
|
|
547
|
-
return await this.callFunctionWithMEEClient(nexusAccount, chainId, tx1, (
|
|
565
|
+
return await this.callFunctionWithMEEClient(nexusAccount, chainId, tx1, (_l = optionsRaw[0]) === null || _l === void 0 ? void 0 : _l.paymentToken, (_m = optionsRaw[0]) === null || _m === void 0 ? void 0 : _m.apiKey);
|
|
548
566
|
}
|
|
549
567
|
else {
|
|
550
568
|
console.log("Using Userop since no payment token...");
|
|
551
|
-
const paymentToken = ((
|
|
569
|
+
const paymentToken = ((_o = options[0]) === null || _o === void 0 ? void 0 : _o.paymentToken) ||
|
|
552
570
|
constants_1.PaymasterConstants[`${chainId}`]["PAYMENT_TOKEN"] ||
|
|
553
571
|
"";
|
|
554
572
|
return await this.callFunctionAsUserOp(smartAccount, tx1, functionName, paymentToken, ...args);
|
|
@@ -560,8 +578,8 @@ class VerifiedContract {
|
|
|
560
578
|
return await this.callFunctionWithEthers(functionName, ...args);
|
|
561
579
|
}
|
|
562
580
|
}
|
|
563
|
-
async getQuote(paymentTokenAddress, functionName, args, rpc, _apiKey) {
|
|
564
|
-
var _a, _b, _c, _d;
|
|
581
|
+
async getQuote(paymentTokenAddress, functionName, args, rpc, _apiKey, isReactNative) {
|
|
582
|
+
var _a, _b, _c, _d, _e;
|
|
565
583
|
const chainId = await this.signer.getChainId();
|
|
566
584
|
if (this.supportsGasless(chainId)) {
|
|
567
585
|
const _signer = this.signer;
|
|
@@ -576,13 +594,32 @@ class VerifiedContract {
|
|
|
576
594
|
if (chainToUse) {
|
|
577
595
|
const prov = this.signer.provider;
|
|
578
596
|
const rpcUrl = (_a = prov.connection) === null || _a === void 0 ? void 0 : _a.url;
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
597
|
+
let nexusAccount;
|
|
598
|
+
if (isReactNative) {
|
|
599
|
+
nexusAccount = await (0, biconomyRNFix_1.createMultiChainNexusAccount)({
|
|
600
|
+
chains: [chainToUse],
|
|
601
|
+
transports: [
|
|
602
|
+
(0, viem_1.http)(rpcUrl || rpc || ((_b = constants_1.PaymasterConstants[Number(chainId)]) === null || _b === void 0 ? void 0 : _b.RPC_URL)),
|
|
603
|
+
],
|
|
604
|
+
signer: _signer,
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
else {
|
|
608
|
+
nexusAccount = await (0, abstractjs_1.toMultichainNexusAccount)({
|
|
609
|
+
chains: [chainToUse],
|
|
610
|
+
transports: [
|
|
611
|
+
(0, viem_1.http)(rpcUrl || rpc || ((_c = constants_1.PaymasterConstants[Number(chainId)]) === null || _c === void 0 ? void 0 : _c.RPC_URL)),
|
|
612
|
+
],
|
|
613
|
+
signer: _signer,
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
// const nexusAccount = await toMultichainNexusAccount({
|
|
617
|
+
// chains: [chainToUse],
|
|
618
|
+
// transports: [
|
|
619
|
+
// http(rpcUrl || rpc || PaymasterConstants[Number(chainId)]?.RPC_URL),
|
|
620
|
+
// ],
|
|
621
|
+
// signer: _signer,
|
|
622
|
+
// });
|
|
586
623
|
if (paymentTokenAddress) {
|
|
587
624
|
//construct calldata for function
|
|
588
625
|
try {
|
|
@@ -619,10 +656,10 @@ class VerifiedContract {
|
|
|
619
656
|
};
|
|
620
657
|
}
|
|
621
658
|
catch (err) {
|
|
622
|
-
if ((
|
|
659
|
+
if ((_d = err === null || err === void 0 ? void 0 : err.message) === null || _d === void 0 ? void 0 : _d.includes("fn is not a function")) {
|
|
623
660
|
console.error(`Function ${functionName} not found in contract's ABI`);
|
|
624
661
|
}
|
|
625
|
-
else if ((
|
|
662
|
+
else if ((_e = err === null || err === void 0 ? void 0 : err.message) === null || _e === void 0 ? void 0 : _e.includes("code=INVALID_ARGUMENT")) {
|
|
626
663
|
console.error(`Invalid arguments type`);
|
|
627
664
|
}
|
|
628
665
|
console.error((err === null || err === void 0 ? void 0 : err.message) || "getQuote failed.");
|
|
@@ -3,7 +3,7 @@ import { VerifiedWallet } from "../../wallet";
|
|
|
3
3
|
export default class LiquidityContract extends VerifiedContract {
|
|
4
4
|
contractAddress: string;
|
|
5
5
|
constructor(signer: VerifiedWallet, contractNetworkAddress: string);
|
|
6
|
-
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string): Promise<{
|
|
6
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string, isReactNative?: boolean): Promise<{
|
|
7
7
|
tokenAddress: string;
|
|
8
8
|
amount: string;
|
|
9
9
|
amountInWei: string;
|
|
@@ -37,8 +37,8 @@ class LiquidityContract extends index_1.VerifiedContract {
|
|
|
37
37
|
super(address, JSON.stringify(Liquidity_json_1.abi), signer);
|
|
38
38
|
this.contractAddress = address;
|
|
39
39
|
}
|
|
40
|
-
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl) {
|
|
41
|
-
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey);
|
|
40
|
+
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl, isReactNative) {
|
|
41
|
+
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey, isReactNative);
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
44
|
Creates supply of the Verified Liquidity token after initial issue with constructor defined parameters
|
|
@@ -3,7 +3,7 @@ import { VerifiedWallet } from "../../../wallet";
|
|
|
3
3
|
export default class Compound extends VerifiedContract {
|
|
4
4
|
contractAddress: string;
|
|
5
5
|
constructor(signer: VerifiedWallet, contractNetworkAddress: string);
|
|
6
|
-
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string): Promise<{
|
|
6
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string, isReactNative?: boolean): Promise<{
|
|
7
7
|
tokenAddress: string;
|
|
8
8
|
amount: string;
|
|
9
9
|
amountInWei: string;
|
|
@@ -19,8 +19,8 @@ class Compound extends index_1.VerifiedContract {
|
|
|
19
19
|
super(address, JSON.stringify(VerifiedMarkets_json_1.abi), signer);
|
|
20
20
|
this.contractAddress = address;
|
|
21
21
|
}
|
|
22
|
-
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl) {
|
|
23
|
-
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey);
|
|
22
|
+
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl, isReactNative) {
|
|
23
|
+
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey, isReactNative);
|
|
24
24
|
}
|
|
25
25
|
async setSigner(_address, options) {
|
|
26
26
|
await this.validateInput(index_1.DATATYPES.ADDRESS, _address);
|
|
@@ -24,7 +24,7 @@ type Funds = {
|
|
|
24
24
|
export default class PoolContract extends VerifiedContract {
|
|
25
25
|
contractAddress: string;
|
|
26
26
|
constructor(signer: VerifiedWallet);
|
|
27
|
-
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string): Promise<{
|
|
27
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string, isReactNative?: boolean): Promise<{
|
|
28
28
|
tokenAddress: string;
|
|
29
29
|
amount: string;
|
|
30
30
|
amountInWei: string;
|
|
@@ -21,8 +21,8 @@ class PoolContract extends index_1.VerifiedContract {
|
|
|
21
21
|
super(address, JSON.stringify(Vault_json_1.abi), signer);
|
|
22
22
|
this.contractAddress = address;
|
|
23
23
|
}
|
|
24
|
-
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl) {
|
|
25
|
-
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey);
|
|
24
|
+
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl, isReactNative) {
|
|
25
|
+
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey, isReactNative);
|
|
26
26
|
}
|
|
27
27
|
async swap(_swap, _funds, _limit, _deadline, options) {
|
|
28
28
|
const { poolId, kind, assetIn, assetOut, amount, userData } = _swap;
|
|
@@ -3,7 +3,7 @@ import { VerifiedWallet } from "../../wallet";
|
|
|
3
3
|
export default class Rates extends VerifiedContract {
|
|
4
4
|
contractAddress: string;
|
|
5
5
|
constructor(signer: VerifiedWallet, contractNetworkAddress: string);
|
|
6
|
-
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string): Promise<{
|
|
6
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string, isReactNative?: boolean): Promise<{
|
|
7
7
|
tokenAddress: string;
|
|
8
8
|
amount: string;
|
|
9
9
|
amountInWei: string;
|
|
@@ -19,8 +19,8 @@ class Rates extends index_1.VerifiedContract {
|
|
|
19
19
|
super(address, JSON.stringify(Rates_json_1.abi), signer);
|
|
20
20
|
this.contractAddress = address;
|
|
21
21
|
}
|
|
22
|
-
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl) {
|
|
23
|
-
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey);
|
|
22
|
+
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl, isReactNative) {
|
|
23
|
+
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey, isReactNative);
|
|
24
24
|
}
|
|
25
25
|
async setFeeTo(_feeTo, _fee, _feeType, options) {
|
|
26
26
|
await this.validateInput(index_1.DATATYPES.ADDRESS, _feeTo);
|
|
@@ -3,7 +3,7 @@ import { VerifiedWallet } from "../../../wallet";
|
|
|
3
3
|
export default class SecuritiesFactory extends VerifiedContract {
|
|
4
4
|
contractAddress: string;
|
|
5
5
|
constructor(signer: VerifiedWallet, contractNetworkAddress: string);
|
|
6
|
-
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string): Promise<{
|
|
6
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string, isReactNative?: boolean): Promise<{
|
|
7
7
|
tokenAddress: string;
|
|
8
8
|
amount: string;
|
|
9
9
|
amountInWei: string;
|
|
@@ -28,8 +28,8 @@ class SecuritiesFactory extends index_1.VerifiedContract {
|
|
|
28
28
|
super(address, JSON.stringify(SecuritiesFactory_json_1.abi), signer);
|
|
29
29
|
this.contractAddress = address;
|
|
30
30
|
}
|
|
31
|
-
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl) {
|
|
32
|
-
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey);
|
|
31
|
+
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl, isReactNative) {
|
|
32
|
+
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey, isReactNative);
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
Sets signer to verify bridge
|
|
@@ -3,7 +3,7 @@ import { VerifiedWallet } from "../../../wallet";
|
|
|
3
3
|
export default class Security extends VerifiedContract {
|
|
4
4
|
contractAddress: string;
|
|
5
5
|
constructor(signer: VerifiedWallet, tokenAddress: string);
|
|
6
|
-
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string): Promise<{
|
|
6
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string, isReactNative?: boolean): Promise<{
|
|
7
7
|
tokenAddress: string;
|
|
8
8
|
amount: string;
|
|
9
9
|
amountInWei: string;
|
|
@@ -40,8 +40,8 @@ class Security extends index_1.VerifiedContract {
|
|
|
40
40
|
super(address, JSON.stringify(Security_json_1.abi), signer);
|
|
41
41
|
this.contractAddress = address;
|
|
42
42
|
}
|
|
43
|
-
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl) {
|
|
44
|
-
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey);
|
|
43
|
+
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl, isReactNative) {
|
|
44
|
+
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey, isReactNative);
|
|
45
45
|
}
|
|
46
46
|
async whiteList(_spender, _amount, options) {
|
|
47
47
|
await this.validateInput(index_1.DATATYPES.ADDRESS, _spender);
|
|
@@ -3,7 +3,7 @@ import { VerifiedWallet } from "../../wallet";
|
|
|
3
3
|
export default class Token extends VerifiedContract {
|
|
4
4
|
contractAddress: string;
|
|
5
5
|
constructor(signer: VerifiedWallet, bondCurrencyAddress: string);
|
|
6
|
-
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string): Promise<{
|
|
6
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string, isReactNative?: boolean): Promise<{
|
|
7
7
|
tokenAddress: string;
|
|
8
8
|
amount: string;
|
|
9
9
|
amountInWei: string;
|
|
@@ -28,8 +28,8 @@ class Token extends index_1.VerifiedContract {
|
|
|
28
28
|
super(address, JSON.stringify(Token_json_1.abi), signer);
|
|
29
29
|
this.contractAddress = address;
|
|
30
30
|
}
|
|
31
|
-
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl) {
|
|
32
|
-
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey);
|
|
31
|
+
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl, isReactNative) {
|
|
32
|
+
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey, isReactNative);
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Lend by purchasing bond token against other cash token [callable by client]
|
|
@@ -323,12 +323,12 @@ const contractAddress = {
|
|
|
323
323
|
'Liquidity': '0xd022c237963576702Ed3FE8b11EcB556b30C634c',
|
|
324
324
|
'Distribution': '0x2C5718206b37b8744784ce44f374DE13dd7BC2d1',
|
|
325
325
|
'PrimaryIssuePoolFactory': '0xDA13BC71FEe08FfD523f10458B0e2c2D8427BBD5',
|
|
326
|
-
'BalancerPrimaryIssueManager': '
|
|
326
|
+
'BalancerPrimaryIssueManager': '0xcC211F54003aC3867Cb20938ddB72D1E545Bf7d6',
|
|
327
327
|
'SecondaryIssuePoolFactory': '0x4519148Cc4030c2e3573f1f886ed4071Fa35d62B',
|
|
328
|
-
'BalancerSecondaryIssueManager': '
|
|
328
|
+
'BalancerSecondaryIssueManager': '0x775979123aD2e6DA3074bB38116430FEAE26974f',
|
|
329
329
|
'MarginTradingPoolFactory': '0xB1ae3Fc5B16d3736bf0db20606fB9a10b435392c',
|
|
330
|
-
'BalancerMarginIssueManager': '
|
|
331
|
-
'Custody': '
|
|
330
|
+
'BalancerMarginIssueManager': '0x099EC82868A1636C9DE6C7E7014692382B3a793E',
|
|
331
|
+
'Custody': '0x3B3AD30e32fFef3dD598dd3EfDf6DCC392897786',
|
|
332
332
|
'Compound': '0x7FEC71327A33d59F293f4Db6dcDc4E6De2d407d6',
|
|
333
333
|
'CASH': {
|
|
334
334
|
'VCUSD': '0x2DDddbE71Ad0ffa4c62B2aEE408c5c4bDdD10A58',
|