@verified-network/verified-sdk 2.0.0 → 2.0.1
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/README.md +1 -1
- package/dist/contract/amm/margin/index.d.ts +20 -45
- package/dist/contract/amm/margin/index.js +20 -17
- package/dist/contract/amm/primary/index.d.ts +22 -53
- package/dist/contract/amm/primary/index.js +3 -0
- package/dist/contract/amm/secondary/index.d.ts +16 -29
- package/dist/contract/amm/secondary/index.js +3 -0
- package/dist/contract/bond/index.d.ts +24 -31
- package/dist/contract/bond/index.js +25 -22
- package/dist/contract/cash/index.d.ts +21 -28
- package/dist/contract/cash/index.js +19 -16
- package/dist/contract/client/index.d.ts +33 -73
- package/dist/contract/client/index.js +11 -8
- package/dist/contract/custody/index.d.ts +20 -45
- package/dist/contract/custody/index.js +3 -0
- package/dist/contract/distribution/index.d.ts +32 -42
- package/dist/contract/distribution/index.js +20 -17
- package/dist/contract/erc20/index.d.ts +16 -29
- package/dist/contract/erc20/index.js +3 -0
- package/dist/contract/factory/index.d.ts +32 -66
- package/dist/contract/factory/index.js +14 -11
- package/dist/contract/index.d.ts +15 -0
- package/dist/contract/index.js +172 -16
- package/dist/contract/liquidity/index.d.ts +98 -144
- package/dist/contract/liquidity/index.js +63 -60
- package/dist/contract/loans/compound/index.d.ts +17 -21
- package/dist/contract/loans/compound/index.js +7 -4
- package/dist/contract/pool/index.d.ts +12 -13
- package/dist/contract/pool/index.js +4 -1
- package/dist/contract/rates/index.d.ts +13 -17
- package/dist/contract/rates/index.js +3 -0
- package/dist/contract/securitiesfactory/index.d.ts +23 -48
- package/dist/contract/securitiesfactory/index.js +6 -3
- package/dist/contract/security/index.d.ts +36 -109
- package/dist/contract/security/index.js +3 -0
- package/dist/contract/token/index.d.ts +19 -35
- package/dist/contract/token/index.js +7 -4
- package/dist/utils/constants.js +1 -0
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -125,7 +125,7 @@ It has the logic to validate the Input, Sanitise the Input and Output, call the
|
|
|
125
125
|
All the contracts trigger smart contract calls and go through the callContract function.
|
|
126
126
|
|
|
127
127
|
Optionally, all the contractCalls take in an additional parameter:
|
|
128
|
-
`options?: { gasPrice
|
|
128
|
+
`options?: { gasPrice?: number, gasLimit?: number, paymentToken?: string }`
|
|
129
129
|
You can configure the gasPrice and gasLimit using this parameter as the last parameter to the contractCall function.
|
|
130
130
|
Example: `this.callContract(FUNCTIONS.GETORDERS, originator, options)`
|
|
131
131
|
Where, options = {gasPrice: XXX, gasLimit: YYY}
|
|
@@ -1,50 +1,25 @@
|
|
|
1
|
-
import { VerifiedContract } from
|
|
1
|
+
import { VerifiedContract, Options } from "../../index";
|
|
2
2
|
import { VerifiedWallet } from "../../../wallet";
|
|
3
3
|
export default class MarginIssueManager extends VerifiedContract {
|
|
4
4
|
contractAddress: string;
|
|
5
5
|
constructor(signer: VerifiedWallet, contractNetworkAddress: string);
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}): any;
|
|
26
|
-
getUserCollateral(party: string, currency: string, options?: {
|
|
27
|
-
gasPrice: any;
|
|
28
|
-
gasLimit: any;
|
|
29
|
-
}): any;
|
|
30
|
-
getPool(poolId: string, options?: {
|
|
31
|
-
gasPrice: any;
|
|
32
|
-
gasLimit: any;
|
|
33
|
-
}): any;
|
|
34
|
-
onMatch(party: string, counterparty: string, orderRef: string, security: string, securityTraded: string, currency: string, cashTraded: string, options?: {
|
|
35
|
-
gasPrice: any;
|
|
36
|
-
gasLimit: any;
|
|
37
|
-
}): any;
|
|
38
|
-
onTrade(ref: string, cref: string, security: string, securityTraded: string, currency: string, currencyTraded: string, executionTime: string, options?: {
|
|
39
|
-
gasPrice: any;
|
|
40
|
-
gasLimit: any;
|
|
41
|
-
}): any;
|
|
42
|
-
onSettle(security: string, currency: string, financingBid: string, financingOffer: string, dividendBid: string, dividendOffer: string, swapLong: string, swapShort: string, settlementTime: string, options?: {
|
|
43
|
-
gasPrice: any;
|
|
44
|
-
gasLimit: any;
|
|
45
|
-
}): any;
|
|
46
|
-
withdraw(security: string, currency: string, amount: string, options?: {
|
|
47
|
-
gasPrice: any;
|
|
48
|
-
gasLimit: any;
|
|
49
|
-
}): any;
|
|
6
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[]): Promise<{
|
|
7
|
+
tokenAddress: string;
|
|
8
|
+
amount: string;
|
|
9
|
+
amountInWei: string;
|
|
10
|
+
amouuntValue: string;
|
|
11
|
+
chainId: number;
|
|
12
|
+
functionName: string;
|
|
13
|
+
}>;
|
|
14
|
+
issueProduct(security: string, securityType: string, currency: string, cficode: string, securityAmount: string, minOrderSize: string, currencyAmount: string, margin: string, collateral: string, tradeFee: string, options?: Options): any;
|
|
15
|
+
close(security: string, currency: string, options?: Options): any;
|
|
16
|
+
offerCollateral(currency: string, amount: string, security: string, options?: Options): any;
|
|
17
|
+
sendCollateral(currency: string, amount: string, security: string, options?: Options): any;
|
|
18
|
+
getCollateral(poolId: string, currency: string, options?: Options): any;
|
|
19
|
+
getUserCollateral(party: string, currency: string, options?: Options): any;
|
|
20
|
+
getPool(poolId: string, options?: Options): any;
|
|
21
|
+
onMatch(party: string, counterparty: string, orderRef: string, security: string, securityTraded: string, currency: string, cashTraded: string, options?: Options): any;
|
|
22
|
+
onTrade(ref: string, cref: string, security: string, securityTraded: string, currency: string, currencyTraded: string, executionTime: string, options?: Options): any;
|
|
23
|
+
onSettle(security: string, currency: string, financingBid: string, financingOffer: string, dividendBid: string, dividendOffer: string, swapLong: string, swapShort: string, settlementTime: string, options?: Options): any;
|
|
24
|
+
withdraw(security: string, currency: string, amount: string, options?: Options): any;
|
|
50
25
|
}
|
|
@@ -24,6 +24,9 @@ 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) {
|
|
28
|
+
return await this.getQuote(paymentTokenAddress, functionName, args);
|
|
29
|
+
}
|
|
27
30
|
async issueProduct(security, securityType, currency, cficode, securityAmount, minOrderSize, currencyAmount, margin, collateral, tradeFee, options) {
|
|
28
31
|
await this.validateInput(index_1.DATATYPES.ADDRESS, security);
|
|
29
32
|
await this.validateInput(index_1.DATATYPES.STRING, securityType);
|
|
@@ -89,23 +92,23 @@ class MarginIssueManager extends index_1.VerifiedContract {
|
|
|
89
92
|
return this.callContract(FUNCTIONS.ONTRADE, ref, cref, security, securityTraded, currency, currencyTraded, executionTime, options);
|
|
90
93
|
}
|
|
91
94
|
/*public async onSettle(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
95
|
+
security: string,
|
|
96
|
+
currency: string,
|
|
97
|
+
financingPerSec:string,
|
|
98
|
+
charge: string,
|
|
99
|
+
dividendPerSec:string,
|
|
100
|
+
payout: string,
|
|
101
|
+
settlementTime:string,
|
|
102
|
+
options?: Options): any {
|
|
103
|
+
await this.validateInput(DATATYPES.ADDRESS, security);
|
|
104
|
+
await this.validateInput(DATATYPES.ADDRESS, currency);
|
|
105
|
+
await this.validateInput(DATATYPES.NUMBER, financingPerSec);
|
|
106
|
+
await this.validateInput(DATATYPES.BOOLEAN, charge);
|
|
107
|
+
await this.validateInput(DATATYPES.NUMBER, dividendPerSec);
|
|
108
|
+
await this.validateInput(DATATYPES.BOOLEAN, payout);
|
|
109
|
+
await this.validateInput(DATATYPES.NUMBER, settlementTime);
|
|
110
|
+
return this.callContract(FUNCTIONS.ONSETTLE, security, currency, financingPerSec, charge, dividendPerSec, payout, settlementTime, options);
|
|
111
|
+
}*/
|
|
109
112
|
async onSettle(security, currency, financingBid, financingOffer, dividendBid, dividendOffer, swapLong, swapShort, settlementTime, options) {
|
|
110
113
|
await this.validateInput(index_1.DATATYPES.ADDRESS, security);
|
|
111
114
|
await this.validateInput(index_1.DATATYPES.ADDRESS, currency);
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { VerifiedContract } from
|
|
1
|
+
import { VerifiedContract } from "../../index";
|
|
2
2
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[]): Promise<{
|
|
7
|
+
tokenAddress: string;
|
|
8
|
+
amount: string;
|
|
9
|
+
amountInWei: string;
|
|
10
|
+
amouuntValue: string;
|
|
11
|
+
chainId: number;
|
|
12
|
+
functionName: string;
|
|
13
|
+
}>;
|
|
14
|
+
offer(owned: string, isin: string, offered: string, tomatch: string, desired: string, min: string, issuer: string, docs: string, options?: Options): any;
|
|
10
15
|
/**
|
|
11
16
|
* Lets issuer or manager set minimum order size for issue
|
|
12
17
|
* @param owner address of issuer
|
|
@@ -16,24 +21,15 @@ export default class PrimaryIssueManager extends VerifiedContract {
|
|
|
16
21
|
* @param options
|
|
17
22
|
* @returns
|
|
18
23
|
*/
|
|
19
|
-
setOfferTerms(owner: string, offered: string, tomatch: string, ordersize: string, options?:
|
|
20
|
-
|
|
21
|
-
gasLimit: any;
|
|
22
|
-
}): any;
|
|
23
|
-
setIssuingFee(owner: string, offered: string, tomatch: string, swapfee: string, options?: {
|
|
24
|
-
gasPrice: any;
|
|
25
|
-
gasLimit: any;
|
|
26
|
-
}): any;
|
|
24
|
+
setOfferTerms(owner: string, offered: string, tomatch: string, ordersize: string, options?: Options): any;
|
|
25
|
+
setIssuingFee(owner: string, offered: string, tomatch: string, swapfee: string, options?: Options): any;
|
|
27
26
|
/**
|
|
28
27
|
* Gets security tokens offered for passed token parameter
|
|
29
28
|
* @param offered address of liquidity token offered by asset manager
|
|
30
29
|
* @param options
|
|
31
30
|
* @returns array of structs of security tokens matching with offered liquidity token
|
|
32
31
|
*/
|
|
33
|
-
getOffered(offered: string, options?:
|
|
34
|
-
gasPrice: any;
|
|
35
|
-
gasLimit: any;
|
|
36
|
-
}): any;
|
|
32
|
+
getOffered(offered: string, options?: Options): any;
|
|
37
33
|
/**
|
|
38
34
|
* Gets offer made previously with offered token and token to match
|
|
39
35
|
* @param offered address of offered token
|
|
@@ -41,51 +37,24 @@ export default class PrimaryIssueManager extends VerifiedContract {
|
|
|
41
37
|
* @param options
|
|
42
38
|
* @returns token struct
|
|
43
39
|
*/
|
|
44
|
-
getOfferMade(offered: string, tomatch: string, options?:
|
|
45
|
-
gasPrice: any;
|
|
46
|
-
gasLimit: any;
|
|
47
|
-
}): any;
|
|
40
|
+
getOfferMade(offered: string, tomatch: string, options?: Options): any;
|
|
48
41
|
/**
|
|
49
42
|
* Gets allotted liquidity stake for caller (asset manager) that is available to invest
|
|
50
43
|
* @param options
|
|
51
44
|
* @returns amount of available liquidity for caller (asset manager)
|
|
52
45
|
*/
|
|
53
|
-
getAllotedStake(offered: string, options?:
|
|
54
|
-
gasPrice: any;
|
|
55
|
-
gasLimit: any;
|
|
56
|
-
}): any;
|
|
46
|
+
getAllotedStake(offered: string, options?: Options): any;
|
|
57
47
|
/**
|
|
58
48
|
* Gets liquidity providers for a security token offering
|
|
59
49
|
* @param security address of security token
|
|
60
50
|
* @param options
|
|
61
51
|
* @returns array of structs of liquidity providers
|
|
62
52
|
*/
|
|
63
|
-
getLiquidityProviders(security: string, options?:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}): any;
|
|
71
|
-
getSubscribers(poolId: string, options?: {
|
|
72
|
-
gasPrice: any;
|
|
73
|
-
gasLimit: any;
|
|
74
|
-
}): any;
|
|
75
|
-
close(security: string, options?: {
|
|
76
|
-
gasPrice: any;
|
|
77
|
-
gasLimit: any;
|
|
78
|
-
}): any;
|
|
79
|
-
accept(poolid: string, investor: string, amnt: string, asset: string, options?: {
|
|
80
|
-
gasPrice: any;
|
|
81
|
-
gasLimit: any;
|
|
82
|
-
}): any;
|
|
83
|
-
reject(poolid: string, investor: string, options?: {
|
|
84
|
-
gasPrice: any;
|
|
85
|
-
gasLimit: any;
|
|
86
|
-
}): any;
|
|
87
|
-
settle(poolId: string, options?: {
|
|
88
|
-
gasPrice: any;
|
|
89
|
-
gasLimit: any;
|
|
90
|
-
}): any;
|
|
53
|
+
getLiquidityProviders(security: string, options?: Options): any;
|
|
54
|
+
issue(security: string, cutoffTime: string, issuer: string, options?: Options): any;
|
|
55
|
+
getSubscribers(poolId: string, options?: Options): any;
|
|
56
|
+
close(security: string, options?: Options): any;
|
|
57
|
+
accept(poolid: string, investor: string, amnt: string, asset: string, options?: Options): any;
|
|
58
|
+
reject(poolid: string, investor: string, options?: Options): any;
|
|
59
|
+
settle(poolId: string, options?: Options): any;
|
|
91
60
|
}
|
|
@@ -29,6 +29,9 @@ 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) {
|
|
33
|
+
return await this.getQuote(paymentTokenAddress, functionName, args);
|
|
34
|
+
}
|
|
32
35
|
async offer(owned, isin, offered, tomatch, desired, min, issuer, docs, options) {
|
|
33
36
|
await this.validateInput(index_1.DATATYPES.ADDRESS, owned);
|
|
34
37
|
await this.validateInput(index_1.DATATYPES.ADDRESS, tomatch);
|
|
@@ -1,34 +1,21 @@
|
|
|
1
|
-
import { VerifiedContract } from
|
|
1
|
+
import { VerifiedContract } from "../../index";
|
|
2
2
|
import { VerifiedWallet } from "../../../wallet";
|
|
3
3
|
export default class SecondaryIssueManager extends VerifiedContract {
|
|
4
4
|
contractAddress: string;
|
|
5
5
|
constructor(signer: VerifiedWallet, contractNetworkAddress: string);
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}): any;
|
|
22
|
-
setSettlementStatus(ref: string, status: string, options?: {
|
|
23
|
-
gasPrice: any;
|
|
24
|
-
gasLimit: any;
|
|
25
|
-
}): any;
|
|
26
|
-
getSubscribers(poolId: string, options?: {
|
|
27
|
-
gasPrice: any;
|
|
28
|
-
gasLimit: any;
|
|
29
|
-
}): any;
|
|
30
|
-
close(poolId: string, options?: {
|
|
31
|
-
gasPrice: any;
|
|
32
|
-
gasLimit: any;
|
|
33
|
-
}): any;
|
|
6
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[]): Promise<{
|
|
7
|
+
tokenAddress: string;
|
|
8
|
+
amount: string;
|
|
9
|
+
amountInWei: string;
|
|
10
|
+
amouuntValue: string;
|
|
11
|
+
chainId: number;
|
|
12
|
+
functionName: string;
|
|
13
|
+
}>;
|
|
14
|
+
issueSecondary(security: string, currency: string, securityOutstanding: string, securityAmount: string, minOrderSize: string, currencyAmount: string, options?: Options): any;
|
|
15
|
+
setIssuingFee(security: string, currency: string, swapfee: string, options?: Options): any;
|
|
16
|
+
getSettlementRequests(dpid: string, poolid: string, options?: Options): any;
|
|
17
|
+
getSettlementRequest(ref: string, options?: Options): any;
|
|
18
|
+
setSettlementStatus(ref: string, status: string, options?: Options): any;
|
|
19
|
+
getSubscribers(poolId: string, options?: Options): any;
|
|
20
|
+
close(poolId: string, options?: Options): any;
|
|
34
21
|
}
|
|
@@ -22,6 +22,9 @@ 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) {
|
|
26
|
+
return await this.getQuote(paymentTokenAddress, functionName, args);
|
|
27
|
+
}
|
|
25
28
|
async issueSecondary(security, currency, securityOutstanding, securityAmount, minOrderSize, currencyAmount, options) {
|
|
26
29
|
await this.validateInput(index_1.DATATYPES.ADDRESS, security);
|
|
27
30
|
await this.validateInput(index_1.DATATYPES.ADDRESS, currency);
|
|
@@ -1,41 +1,34 @@
|
|
|
1
|
-
import { VerifiedContract } from
|
|
1
|
+
import { VerifiedContract, Options } from "../index";
|
|
2
2
|
import { VerifiedWallet } from "../../wallet";
|
|
3
3
|
export default class Bond extends VerifiedContract {
|
|
4
4
|
contractAddress: string;
|
|
5
5
|
constructor(signer: VerifiedWallet, bondCurrencyAddress: string);
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}): any;
|
|
6
|
+
_getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[]): Promise<{
|
|
7
|
+
tokenAddress: string;
|
|
8
|
+
amount: string;
|
|
9
|
+
amountInWei: string;
|
|
10
|
+
amouuntValue: string;
|
|
11
|
+
chainId: number;
|
|
12
|
+
functionName: string;
|
|
13
|
+
}>;
|
|
14
|
+
requestIssue(_amount: string, _payer: string, _currency: string, _cashContract: string, options?: Options): any;
|
|
15
|
+
requestPurchase(_amount: string, _payer: string, _currency: string, _cashContract: string, options?: Options): any;
|
|
16
|
+
requestRedemption(_amount: string, _payer: string, _currency: string, _tokenContract: string, options?: Options): any;
|
|
18
17
|
getBonds(): any;
|
|
19
18
|
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
getBondIssues(_issuer: string, _bond: string, options?:
|
|
26
|
-
gasPrice: number;
|
|
27
|
-
gasLimit: number;
|
|
28
|
-
}): any;
|
|
19
|
+
* Fetch bonds issued with their balance amounts to redeem [callable by client]
|
|
20
|
+
* entries is count of results to return. Address[] has issued bond addresses, and uint[] has issued amount
|
|
21
|
+
* @param ()
|
|
22
|
+
* @returns (bytes16 parValue, bytes16 paidInAmount, bytes32 paidInCurrency, uint256 timeIssuedSubscribed)
|
|
23
|
+
*/
|
|
24
|
+
getBondIssues(_issuer: string, _bond: string, options?: Options): any;
|
|
29
25
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
getBondPurchases(_issuer: string, _bond: string, options?:
|
|
36
|
-
gasPrice: number;
|
|
37
|
-
gasLimit: number;
|
|
38
|
-
}): any;
|
|
26
|
+
* Fetch bonds purchased with their purchased amounts [callable by client]
|
|
27
|
+
* entries is count of results to return. Address[] has purchased bond addresses, and uint[] has purchased amount
|
|
28
|
+
* @param ()
|
|
29
|
+
* @returns (bytes16 parValue, bytes16 paidInAmount, bytes32 paidInCurrency, uint256 timeIssuedSubscribed)
|
|
30
|
+
*/
|
|
31
|
+
getBondPurchases(_issuer: string, _bond: string, options?: Options): any;
|
|
39
32
|
notifyBondIssue(callback: any): object;
|
|
40
33
|
notifyBondRedemption(callback: any): object;
|
|
41
34
|
notifyBondPurchase(callback: any): object;
|
|
@@ -23,6 +23,9 @@ class Bond extends index_1.VerifiedContract {
|
|
|
23
23
|
super(address, JSON.stringify(Bond_json_1.abi), signer);
|
|
24
24
|
this.contractAddress = address;
|
|
25
25
|
}
|
|
26
|
+
async _getMeeQuote(paymentTokenAddress, functionName, args) {
|
|
27
|
+
return await this.getQuote(paymentTokenAddress, functionName, args);
|
|
28
|
+
}
|
|
26
29
|
async requestIssue(_amount, _payer, _currency, _cashContract, options) {
|
|
27
30
|
await this.validateInput(index_1.DATATYPES.NUMBER, _amount);
|
|
28
31
|
await this.validateInput(index_1.DATATYPES.ADDRESS, _payer);
|
|
@@ -45,56 +48,56 @@ class Bond extends index_1.VerifiedContract {
|
|
|
45
48
|
return this.callContract(FUNCTIONS.REQUESTREDEMPTION, _amount, _payer, this.sanitiseInput(index_1.DATATYPES.BYTE32, _currency), _tokenContract, options);
|
|
46
49
|
}
|
|
47
50
|
/*
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
* Gets bond issued address
|
|
52
|
+
* @param ()
|
|
53
|
+
* @returns address[] memory
|
|
54
|
+
*/
|
|
52
55
|
async getBonds() {
|
|
53
56
|
return this.callContract(FUNCTIONS.GETBONDS);
|
|
54
57
|
}
|
|
55
58
|
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
* Fetch bonds issued with their balance amounts to redeem [callable by client]
|
|
60
|
+
* entries is count of results to return. Address[] has issued bond addresses, and uint[] has issued amount
|
|
61
|
+
* @param ()
|
|
62
|
+
* @returns (bytes16 parValue, bytes16 paidInAmount, bytes32 paidInCurrency, uint256 timeIssuedSubscribed)
|
|
63
|
+
*/
|
|
61
64
|
async getBondIssues(_issuer, _bond, options) {
|
|
62
65
|
await this.validateInput(index_1.DATATYPES.ADDRESS, _issuer);
|
|
63
66
|
await this.validateInput(index_1.DATATYPES.ADDRESS, _bond);
|
|
64
67
|
return this.callContract(FUNCTIONS.GETBONDISSUES, _issuer, _bond, options);
|
|
65
68
|
}
|
|
66
69
|
/**
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
* Fetch bonds purchased with their purchased amounts [callable by client]
|
|
71
|
+
* entries is count of results to return. Address[] has purchased bond addresses, and uint[] has purchased amount
|
|
72
|
+
* @param ()
|
|
73
|
+
* @returns (bytes16 parValue, bytes16 paidInAmount, bytes32 paidInCurrency, uint256 timeIssuedSubscribed)
|
|
74
|
+
*/
|
|
72
75
|
async getBondPurchases(_issuer, _bond, options) {
|
|
73
76
|
await this.validateInput(index_1.DATATYPES.ADDRESS, _issuer);
|
|
74
77
|
await this.validateInput(index_1.DATATYPES.ADDRESS, _bond);
|
|
75
78
|
return this.callContract(FUNCTIONS.GETBONDPURCHASES, _issuer, _bond, options);
|
|
76
79
|
}
|
|
77
80
|
/*
|
|
78
|
-
|
|
79
|
-
|
|
81
|
+
emits event BondIssued(address indexed _token, address issuer, uint256 issuedAmount, bytes32 collateralCurrency, uint256 collateralValue);
|
|
82
|
+
*/
|
|
80
83
|
notifyBondIssue(callback) {
|
|
81
84
|
this.getEvent(FUNCTIONS.ISSUE, callback);
|
|
82
85
|
}
|
|
83
86
|
/*
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
emits event BondRedeemed(address indexed _token, address redeemedBy, uint256 redemptionAmount, bytes32 redemptionCurrency);
|
|
88
|
+
*/
|
|
86
89
|
notifyBondRedemption(callback) {
|
|
87
90
|
this.getEvent(FUNCTIONS.REDEEM, callback);
|
|
88
91
|
}
|
|
89
92
|
/*
|
|
90
|
-
|
|
91
|
-
|
|
93
|
+
emits event BondPurchased(address indexed _token, address purchaser, uint256 purchasedAmount, bytes32 paidInCurrency, uint256 paidInAmount);
|
|
94
|
+
*/
|
|
92
95
|
notifyBondPurchase(callback) {
|
|
93
96
|
this.getEvent(FUNCTIONS.PURCHASE, callback);
|
|
94
97
|
}
|
|
95
98
|
/*
|
|
96
|
-
|
|
97
|
-
|
|
99
|
+
emits event BondLiquidated(address indexed _token, address redeemedBy, uint256 redemptionAmount, bytes32 redemptionCurrency);
|
|
100
|
+
*/
|
|
98
101
|
notifyBondLiquidation(callback) {
|
|
99
102
|
this.getEvent(FUNCTIONS.LIQUIDATE, callback);
|
|
100
103
|
}
|
|
@@ -1,41 +1,34 @@
|
|
|
1
|
-
import { VerifiedContract } from
|
|
1
|
+
import { VerifiedContract, Options } from "../index";
|
|
2
2
|
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[]): Promise<{
|
|
7
|
+
tokenAddress: string;
|
|
8
|
+
amount: string;
|
|
9
|
+
amountInWei: string;
|
|
10
|
+
amouuntValue: string;
|
|
11
|
+
chainId: number;
|
|
12
|
+
functionName: string;
|
|
13
|
+
}>;
|
|
6
14
|
/**
|
|
7
15
|
* Request pay out [callable by manager]
|
|
8
16
|
* @param (uint256 _tokens, address _payer, bytes32 _currency, address _sender)
|
|
9
17
|
* @returns boolean
|
|
10
18
|
*/
|
|
11
|
-
payIn(_tokens: string, _payer: string, _currency: string, options?:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}): any;
|
|
15
|
-
requestIssue(_amount: string, _buyer: string, _currency: string, options?: {
|
|
16
|
-
gasPrice: number;
|
|
17
|
-
gasLimit: number;
|
|
18
|
-
}): any;
|
|
19
|
-
burnCashTokens(_tokens: string, _payer: string, _currency: string, options?: {
|
|
20
|
-
gasPrice: number;
|
|
21
|
-
gasLimit: number;
|
|
22
|
-
}): any;
|
|
19
|
+
payIn(_tokens: string, _payer: string, _currency: string, options?: Options): any;
|
|
20
|
+
requestIssue(_amount: string, _buyer: string, _currency: string, options?: Options): any;
|
|
21
|
+
burnCashTokens(_tokens: string, _payer: string, _currency: string, options?: Options): any;
|
|
23
22
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
transferFrom(_senderAddress: string, _recieverAddress: string, _tokens: string, options?:
|
|
32
|
-
|
|
33
|
-
gasLimit: number;
|
|
34
|
-
}): any;
|
|
35
|
-
balanceOf(_wallet: string, options?: {
|
|
36
|
-
gasPrice: number;
|
|
37
|
-
gasLimit: number;
|
|
38
|
-
}): any;
|
|
23
|
+
* An investor can also request cash tokens from Verified by paying in another cash token.
|
|
24
|
+
* For example, an investor can request a USD cash token by paying in a EUR cash token.
|
|
25
|
+
* where, the sender is the address of cash token paid in, the receiver is the address of the cash token converted to
|
|
26
|
+
* and the tokens parameter is a numeric specifying number of cash tokens paid in.
|
|
27
|
+
* @param (address sender, address receiver, uint256 tokens)
|
|
28
|
+
* @returns boolean
|
|
29
|
+
*/
|
|
30
|
+
transferFrom(_senderAddress: string, _recieverAddress: string, _tokens: string, options?: Options): any;
|
|
31
|
+
balanceOf(_wallet: string, options?: Options): any;
|
|
39
32
|
notifyCashIssue(callback: any): object;
|
|
40
33
|
notifyCashRedemption(callback: any): object;
|
|
41
34
|
notifyCashTransfer(callback: any): object;
|
|
@@ -22,6 +22,9 @@ class Cash extends index_1.VerifiedContract {
|
|
|
22
22
|
super(address, JSON.stringify(Cash_json_1.abi), signer);
|
|
23
23
|
this.contractAddress = address;
|
|
24
24
|
}
|
|
25
|
+
async _getMeeQuote(paymentTokenAddress, functionName, args) {
|
|
26
|
+
return await this.getQuote(paymentTokenAddress, functionName, args);
|
|
27
|
+
}
|
|
25
28
|
/**
|
|
26
29
|
* Request pay out [callable by manager]
|
|
27
30
|
* @param (uint256 _tokens, address _payer, bytes32 _currency, address _sender)
|
|
@@ -46,13 +49,13 @@ class Cash extends index_1.VerifiedContract {
|
|
|
46
49
|
return this.callContract(FUNCTIONS.BURNCASHTOKENS, _tokens, _payer, this.sanitiseInput(index_1.DATATYPES.BYTE32, _currency), options);
|
|
47
50
|
}
|
|
48
51
|
/**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
* An investor can also request cash tokens from Verified by paying in another cash token.
|
|
53
|
+
* For example, an investor can request a USD cash token by paying in a EUR cash token.
|
|
54
|
+
* where, the sender is the address of cash token paid in, the receiver is the address of the cash token converted to
|
|
55
|
+
* and the tokens parameter is a numeric specifying number of cash tokens paid in.
|
|
56
|
+
* @param (address sender, address receiver, uint256 tokens)
|
|
57
|
+
* @returns boolean
|
|
58
|
+
*/
|
|
56
59
|
async transferFrom(_senderAddress, _recieverAddress, _tokens, options) {
|
|
57
60
|
await this.validateInput(index_1.DATATYPES.ADDRESS, _senderAddress);
|
|
58
61
|
await this.validateInput(index_1.DATATYPES.ADDRESS, _recieverAddress);
|
|
@@ -60,32 +63,32 @@ class Cash extends index_1.VerifiedContract {
|
|
|
60
63
|
return this.callContract(FUNCTIONS.TRANSFERFROM, _senderAddress, _recieverAddress, _tokens, options);
|
|
61
64
|
}
|
|
62
65
|
/* Request balance of wallet in contract
|
|
63
|
-
|
|
66
|
+
*/
|
|
64
67
|
async balanceOf(_wallet, options) {
|
|
65
68
|
await this.validateInput(index_1.DATATYPES.ADDRESS, _wallet);
|
|
66
69
|
return this.callContract(FUNCTIONS.BALANCE, _wallet, options);
|
|
67
70
|
}
|
|
68
71
|
/*
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
emits event CashIssued(address indexed _party, bytes32 currency, uint256 amount);
|
|
73
|
+
*/
|
|
71
74
|
notifyCashIssue(callback) {
|
|
72
75
|
this.getEvent(FUNCTIONS.ISSUE, callback);
|
|
73
76
|
}
|
|
74
77
|
/*
|
|
75
|
-
|
|
76
|
-
|
|
78
|
+
emits event CashRedeemed(address indexed _party, bytes32 currency, bytes16 amount);
|
|
79
|
+
*/
|
|
77
80
|
notifyCashRedemption(callback) {
|
|
78
81
|
this.getEvent(FUNCTIONS.REDEEM, callback);
|
|
79
82
|
}
|
|
80
83
|
/*
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
emits event CashTransfer(address indexed from, address indexed to, uint tokens);
|
|
85
|
+
*/
|
|
83
86
|
notifyCashTransfer(callback) {
|
|
84
87
|
this.getEvent(FUNCTIONS.TRANSFER, callback);
|
|
85
88
|
}
|
|
86
89
|
/*
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
emits event CashDeposits(address indexed depositor, bytes32 currency, bytes16 amount);
|
|
91
|
+
*/
|
|
89
92
|
notifyCashExchange(callback) {
|
|
90
93
|
this.getEvent(FUNCTIONS.EXCHANGE, callback);
|
|
91
94
|
}
|