@verified-network/verified-sdk 1.4.4 → 1.4.6

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.
@@ -0,0 +1,71 @@
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 ERC20_json_1 = require("../../abi/payments/ERC20.json");
7
+ var FUNCTIONS;
8
+ (function (FUNCTIONS) {
9
+ FUNCTIONS["NAME"] = "name";
10
+ FUNCTIONS["SYMBOL"] = "symbol";
11
+ FUNCTIONS["TOTALSUPPLY"] = "totalSupply";
12
+ FUNCTIONS["BALANCE"] = "balanceOf";
13
+ FUNCTIONS["TRANSFER"] = "transfer";
14
+ FUNCTIONS["APPROVE"] = "approve";
15
+ FUNCTIONS["ALLOWANCE"] = "allowance";
16
+ FUNCTIONS["TRANSFERFROM"] = "transferFrom";
17
+ FUNCTIONS["INCREASEALLOWANCE"] = "increaseAllowance";
18
+ FUNCTIONS["DECREASEALLOWANCE"] = "decreaseAllowance";
19
+ })(FUNCTIONS || (FUNCTIONS = {}));
20
+ class ERC20 extends index_1.VerifiedContract {
21
+ constructor(signer, contractNetworkAddress) {
22
+ const address = contractNetworkAddress;
23
+ super(address, JSON.stringify(ERC20_json_1.abi), signer);
24
+ this.contractAddress = address;
25
+ }
26
+ async name() {
27
+ return this.callContract(FUNCTIONS.NAME);
28
+ }
29
+ async symbol() {
30
+ return this.callContract(FUNCTIONS.SYMBOL);
31
+ }
32
+ async totalSupply() {
33
+ return this.callContract(FUNCTIONS.TOTALSUPPLY);
34
+ }
35
+ async balanceOf(_account, options) {
36
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _account);
37
+ return this.callContract(FUNCTIONS.BALANCE, _account, options);
38
+ }
39
+ async transfer(_recipient, _amount, options) {
40
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _recipient);
41
+ await this.validateInput(index_1.DATATYPES.NUMBER, _amount);
42
+ return this.callContract(FUNCTIONS.TRANSFER, _recipient, _amount, options);
43
+ }
44
+ async approve(_spender, _amount, options) {
45
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _spender);
46
+ await this.validateInput(index_1.DATATYPES.NUMBER, _amount);
47
+ return this.callContract(FUNCTIONS.APPROVE, _spender, _amount, options);
48
+ }
49
+ async allowance(_owner, _spender, options) {
50
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _spender);
51
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _owner);
52
+ return this.callContract(FUNCTIONS.ALLOWANCE, _owner, _spender, options);
53
+ }
54
+ async increaseAllowance(_spender, _addedValue, options) {
55
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _spender);
56
+ await this.validateInput(index_1.DATATYPES.NUMBER, _addedValue);
57
+ return this.callContract(FUNCTIONS.INCREASEALLOWANCE, _spender, _addedValue, options);
58
+ }
59
+ async decreaseAllowance(_spender, _subtractedValue, options) {
60
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _spender);
61
+ await this.validateInput(index_1.DATATYPES.NUMBER, _subtractedValue);
62
+ return this.callContract(FUNCTIONS.DECREASEALLOWANCE, _spender, _subtractedValue, options);
63
+ }
64
+ async transferFrom(_senderAddress, _recieverAddress, _tokens, options) {
65
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _senderAddress);
66
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _recieverAddress);
67
+ await this.validateInput(index_1.DATATYPES.NUMBER, _tokens);
68
+ return this.callContract(FUNCTIONS.TRANSFERFROM, _senderAddress, _recieverAddress, _tokens, options);
69
+ }
70
+ }
71
+ exports.default = ERC20;
@@ -26,6 +26,12 @@ var FUNCTIONS;
26
26
  FUNCTIONS["PAYOUT"] = "payout";
27
27
  FUNCTIONS["PAUSE"] = "pause";
28
28
  FUNCTIONS["UNPAUSE"] = "unpause";
29
+ FUNCTIONS["WITHDRAWFUNDS"] = "withdrawFunds";
30
+ FUNCTIONS["PUSHFUNDS"] = "pushFunds";
31
+ FUNCTIONS["UPDATEFUNDSRECEIVED"] = "updateFundsReceived";
32
+ FUNCTIONS["WITHDRAWABLEFUNDSOF"] = "withdrawableFundsOf";
33
+ FUNCTIONS["WITHDRAWNFUNDSOF"] = "withdrawnFundsOf";
34
+ FUNCTIONS["ACCUMULATIVEFUNDSOF"] = "accumulativeFundsOf";
29
35
  })(FUNCTIONS || (FUNCTIONS = {}));
30
36
  class Security extends index_1.VerifiedContract {
31
37
  constructor(signer, tokenAddress) {
@@ -129,5 +135,26 @@ class Security extends index_1.VerifiedContract {
129
135
  async unpause(options) {
130
136
  return this.callContract(FUNCTIONS.UNPAUSE, options);
131
137
  }
138
+ async withdrawableFundsOf(_holder, options) {
139
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _holder);
140
+ return this.callContract(FUNCTIONS.WITHDRAWABLEFUNDSOF, _holder, options);
141
+ }
142
+ async withdrawnFundsOf(_holder, options) {
143
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _holder);
144
+ return this.callContract(FUNCTIONS.WITHDRAWNFUNDSOF, _holder, options);
145
+ }
146
+ async accumulativeFundsOf(_holder, options) {
147
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _holder);
148
+ return this.callContract(FUNCTIONS.ACCUMULATIVEFUNDSOF, _holder, options);
149
+ }
150
+ async withdrawFunds(options) {
151
+ return this.callContract(FUNCTIONS.WITHDRAWFUNDS, options);
152
+ }
153
+ async pushFunds(_holder, options) {
154
+ return this.callContract(FUNCTIONS.PUSHFUNDS, _holder, options);
155
+ }
156
+ async updateFundsReceived(options) {
157
+ return this.callContract(FUNCTIONS.UPDATEFUNDSRECEIVED, options);
158
+ }
132
159
  }
133
160
  exports.default = Security;
@@ -9,6 +9,8 @@ var FUNCTIONS;
9
9
  FUNCTIONS["TRANSFERFROM"] = "transferFrom";
10
10
  FUNCTIONS["BALANCE"] = "balanceOf";
11
11
  FUNCTIONS["GETISSUER"] = "getIssuer";
12
+ FUNCTIONS["REQUESTTRANSACTION"] = "requestTransaction";
13
+ FUNCTIONS["REQUESTTRANSFER"] = "requestTransfer";
12
14
  })(FUNCTIONS || (FUNCTIONS = {}));
13
15
  class Token extends index_1.VerifiedContract {
14
16
  constructor(signer, bondCurrencyAddress) {
@@ -41,5 +43,17 @@ class Token extends index_1.VerifiedContract {
41
43
  async getIssuer() {
42
44
  return this.callContract(FUNCTIONS.GETISSUER);
43
45
  }
46
+ async requestTransfer(_recieverAddress, _tokens, options) {
47
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _recieverAddress);
48
+ await this.validateInput(index_1.DATATYPES.NUMBER, _tokens);
49
+ return this.callContract(FUNCTIONS.REQUESTTRANSFER, _recieverAddress, _tokens, options);
50
+ }
51
+ async requestTransaction(_amount, _payer, _collateralName, _collateralContract, options) {
52
+ await this.validateInput(index_1.DATATYPES.NUMBER, _amount);
53
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _payer);
54
+ await this.validateInput(index_1.DATATYPES.STRING, _collateralName);
55
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _collateralContract);
56
+ return this.callContract(FUNCTIONS.REQUESTTRANSACTION, _amount, _payer, this.sanitiseInput(index_1.DATATYPES.BYTE32, _collateralName), _collateralContract, options);
57
+ }
44
58
  }
45
59
  exports.default = Token;
@@ -19,7 +19,7 @@ const contractAddress = {
19
19
  'SecondaryIssuePoolFactory': '0xe3e79e4106327e6eAeFBD03C1fD3A4A531c59b10',
20
20
  'BalancerSecondaryIssueManager': '0xd99eaA9786050dab5c3332E1E6eD9d6C4fB6cb6e',
21
21
  'MarginTradingPoolFactory': '0x84766CE538613bb5f3a6E6bCe0Ed1dB650545208',
22
- 'BalancerMarginIssueManager': '0x41dC42e66031B3A08eFe21E37583A4C9a0e887fe',
22
+ 'BalancerMarginIssueManager': '0xaEE3e10512D74CEd30b73883f8C9cFd2627C1c32',
23
23
  'Custody': '0x5fafb140f86FFd21C2C772Ea4b23225faA00ecE6',
24
24
  'Compound': '0xe7da2f6c05040765660cd20f5defc69ce7df2309',
25
25
  'CASH': {
package/dist/index.js CHANGED
@@ -4,11 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.contractAddress = exports.utils = exports.Compound = exports.Client = exports.Distribution = exports.SecuritiesFactory = exports.Security = exports.MarginIssueManager = exports.SecondaryIssueManager = exports.PrimaryIssueManager = exports.Rates = exports.Liquidity = exports.Custody = exports.Pool = exports.Token = exports.Factory = exports.Cash = exports.Bond = exports.Provider = exports.VerifiedWallet = void 0;
7
+ exports.contractAddress = exports.utils = exports.Compound = exports.Client = exports.Distribution = exports.SecuritiesFactory = exports.Security = exports.MarginIssueManager = exports.SecondaryIssueManager = exports.PrimaryIssueManager = exports.Rates = exports.Liquidity = exports.Custody = exports.Pool = exports.Token = exports.Factory = exports.Cash = exports.Bond = exports.ERC20 = exports.Provider = exports.VerifiedWallet = void 0;
8
8
  const wallet_1 = require("./wallet");
9
9
  Object.defineProperty(exports, "VerifiedWallet", { enumerable: true, get: function () { return wallet_1.VerifiedWallet; } });
10
10
  const utils_1 = require("./utils");
11
11
  Object.defineProperty(exports, "Provider", { enumerable: true, get: function () { return utils_1.Provider; } });
12
+ const erc20_1 = __importDefault(require("./contract/erc20"));
13
+ exports.ERC20 = erc20_1.default;
12
14
  const bond_1 = __importDefault(require("./contract/bond"));
13
15
  exports.Bond = bond_1.default;
14
16
  const cash_1 = __importDefault(require("./contract/cash"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verified-network/verified-sdk",
3
- "version": "1.4.4",
3
+ "version": "1.4.6",
4
4
  "description": "An SDK to develop applications on the Verified Network",
5
5
  "repository": {
6
6
  "type": "git",