@verified-network/verified-sdk 2.5.2 → 2.5.4
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/abi/loans/compound/Comet.json +1967 -0
- package/dist/contract/comet/index.d.ts +16 -0
- package/dist/contract/comet/index.js +32 -0
- package/dist/contract/index.d.ts +10 -1
- package/dist/contract/index.js +313 -141
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/utils/constants.js +8 -41
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { VerifiedContract, Options } from "../index";
|
|
2
|
+
import { VerifiedWallet } from "../../wallet";
|
|
3
|
+
export default class Comet extends VerifiedContract {
|
|
4
|
+
contractAddress: string;
|
|
5
|
+
constructor(signer: VerifiedWallet, contractNetworkAddress: string);
|
|
6
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[], apiKey?: string, rpcUrl?: string, isReactNative?: boolean): Promise<{
|
|
7
|
+
tokenAddress: string;
|
|
8
|
+
amount: string;
|
|
9
|
+
amountInWei: string;
|
|
10
|
+
amouuntValue: string;
|
|
11
|
+
chainId: number;
|
|
12
|
+
functionName: string;
|
|
13
|
+
}>;
|
|
14
|
+
allow(manager: string, isAllowed: string, options?: Options): any;
|
|
15
|
+
hasPermission(owner: string, manager: string): any;
|
|
16
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// SPDX-License-Identifier: BUSL-1.1
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
const index_1 = require("../index");
|
|
6
|
+
const Comet_json_1 = require("../../abi/loans/compound/Comet.json");
|
|
7
|
+
var FUNCTIONS;
|
|
8
|
+
(function (FUNCTIONS) {
|
|
9
|
+
FUNCTIONS["ALLOW"] = "allow";
|
|
10
|
+
FUNCTIONS["HASPERMISSION"] = "hasPermission";
|
|
11
|
+
})(FUNCTIONS || (FUNCTIONS = {}));
|
|
12
|
+
class Comet extends index_1.VerifiedContract {
|
|
13
|
+
constructor(signer, contractNetworkAddress) {
|
|
14
|
+
const address = contractNetworkAddress;
|
|
15
|
+
super(address, JSON.stringify(Comet_json_1.abi), signer);
|
|
16
|
+
this.contractAddress = address;
|
|
17
|
+
}
|
|
18
|
+
async _getMeeQuote(paymentTokenAddress, functionName, args, apiKey, rpcUrl, isReactNative) {
|
|
19
|
+
return await this.getQuote(paymentTokenAddress, functionName, args, rpcUrl, apiKey, isReactNative);
|
|
20
|
+
}
|
|
21
|
+
async allow(manager, isAllowed, options) {
|
|
22
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, manager);
|
|
23
|
+
await this.validateInput(index_1.DATATYPES.BOOLEAN, isAllowed);
|
|
24
|
+
return this.callContract(FUNCTIONS.ALLOW, manager, isAllowed, options);
|
|
25
|
+
}
|
|
26
|
+
async hasPermission(owner, manager) {
|
|
27
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, owner);
|
|
28
|
+
await this.validateInput(index_1.DATATYPES.ADDRESS, manager);
|
|
29
|
+
return this.callContract(FUNCTIONS.HASPERMISSION, owner, manager);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.default = Comet;
|
package/dist/contract/index.d.ts
CHANGED
|
@@ -60,15 +60,24 @@ export declare class VerifiedContract {
|
|
|
60
60
|
/** Constructs and call function as userop for biconomy gassless(sponsored/erc20 mode) */
|
|
61
61
|
callFunctionAsUserOp(smartAccount: any, tx: any, functionName: string, paymentToken: string, ...args: any): Promise<SCResponse>;
|
|
62
62
|
/** Constructs and call function using MEE client that allows gas payment in ERC20 tokens */
|
|
63
|
-
callFunctionWithMEEClient(nexusAccount: any, chainId: number, tx: any, paymentToken: `0x${string}`, _apiKey?: string): Promise<SCResponse>;
|
|
63
|
+
callFunctionWithMEEClient(nexusAccount: any, chainId: number, tx: any, functionName: string, paymentToken: `0x${string}`, isSponsor?: boolean, _apiKey?: string, ...args: any): Promise<SCResponse>;
|
|
64
64
|
callContract(functionName: string, ...args: any): Promise<SCResponse>;
|
|
65
65
|
getQuote(paymentTokenAddress: string, functionName: string, args: any[], rpc?: string, _apiKey?: string, isReactNative?: boolean): Promise<{
|
|
66
|
+
tokenAddress: string;
|
|
67
|
+
amount: string;
|
|
68
|
+
amountInWei: string;
|
|
69
|
+
amountValue: string;
|
|
70
|
+
chainId: number;
|
|
71
|
+
functionName: string;
|
|
72
|
+
amouuntValue?: undefined;
|
|
73
|
+
} | {
|
|
66
74
|
tokenAddress: string;
|
|
67
75
|
amount: string;
|
|
68
76
|
amountInWei: string;
|
|
69
77
|
amouuntValue: string;
|
|
70
78
|
chainId: number;
|
|
71
79
|
functionName: string;
|
|
80
|
+
amountValue?: undefined;
|
|
72
81
|
}>;
|
|
73
82
|
protected getEvent(eventName: string, callback: any): void;
|
|
74
83
|
}
|