@verified-network/verified-sdk 2.1.8 → 2.2.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.
@@ -29,6 +29,16 @@ export default class Bond extends VerifiedContract {
29
29
  * @returns (bytes16 parValue, bytes16 paidInAmount, bytes32 paidInCurrency, uint256 timeIssuedSubscribed)
30
30
  */
31
31
  getBondPurchases(_issuer: string, _bond: string, options?: Options): any;
32
+ balanceOf(_wallet: string, options?: Options): any;
33
+ name(): any;
34
+ symbol(): any;
35
+ decimals(): any;
36
+ totalSupply(): any;
37
+ transfer(_recipient: string, _amount: string, options?: Options): any;
38
+ approve(_spender: string, _amount: string, options?: Options): any;
39
+ allowance(_owner: string, _spender: string, options?: Options): any;
40
+ increaseAllowance(_spender: string, _addedValue: string, options?: Options): any;
41
+ decreaseAllowance(_spender: string, _subtractedValue: string, options?: Options): any;
32
42
  notifyBondIssue(callback: any): object;
33
43
  notifyBondRedemption(callback: any): object;
34
44
  notifyBondPurchase(callback: any): object;
@@ -16,6 +16,18 @@ var FUNCTIONS;
16
16
  FUNCTIONS["REDEEM"] = "BondRedeemed";
17
17
  FUNCTIONS["PURCHASE"] = "BondPurchased";
18
18
  FUNCTIONS["LIQUIDATE"] = "BondLiquidated";
19
+ FUNCTIONS["TRANSFERFROM"] = "transferFrom";
20
+ FUNCTIONS["NAME"] = "name";
21
+ FUNCTIONS["SYMBOL"] = "symbol";
22
+ FUNCTIONS["TOTALSUPPLY"] = "totalSupply";
23
+ FUNCTIONS["BALANCE"] = "balanceOf";
24
+ FUNCTIONS["DECIMALS"] = "decimals";
25
+ FUNCTIONS["TRANSFER"] = "transfer";
26
+ FUNCTIONS["APPROVE"] = "approve";
27
+ FUNCTIONS["ALLOWANCE"] = "allowance";
28
+ FUNCTIONS["TRANSFERFROM"] = "transferFrom";
29
+ FUNCTIONS["INCREASEALLOWANCE"] = "increaseAllowance";
30
+ FUNCTIONS["DECREASEALLOWANCE"] = "decreaseAllowance";
19
31
  })(FUNCTIONS || (FUNCTIONS = {}));
20
32
  class Bond extends index_1.VerifiedContract {
21
33
  constructor(signer, bondCurrencyAddress) {
@@ -77,6 +89,47 @@ class Bond extends index_1.VerifiedContract {
77
89
  await this.validateInput(index_1.DATATYPES.ADDRESS, _bond);
78
90
  return this.callContract(FUNCTIONS.GETBONDPURCHASES, _issuer, _bond, options);
79
91
  }
92
+ async balanceOf(_wallet, options) {
93
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _wallet);
94
+ return this.callContract(FUNCTIONS.BALANCE, _wallet, options);
95
+ }
96
+ async name() {
97
+ return this.callContract(FUNCTIONS.NAME);
98
+ }
99
+ async symbol() {
100
+ return this.callContract(FUNCTIONS.SYMBOL);
101
+ }
102
+ async decimals() {
103
+ return this.callContract(FUNCTIONS.DECIMALS);
104
+ }
105
+ async totalSupply() {
106
+ return this.callContract(FUNCTIONS.TOTALSUPPLY);
107
+ }
108
+ async transfer(_recipient, _amount, options) {
109
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _recipient);
110
+ await this.validateInput(index_1.DATATYPES.NUMBER, _amount);
111
+ return this.callContract(FUNCTIONS.TRANSFER, _recipient, _amount, options);
112
+ }
113
+ async approve(_spender, _amount, options) {
114
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _spender);
115
+ await this.validateInput(index_1.DATATYPES.NUMBER, _amount);
116
+ return this.callContract(FUNCTIONS.APPROVE, _spender, _amount, options);
117
+ }
118
+ async allowance(_owner, _spender, options) {
119
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _spender);
120
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _owner);
121
+ return this.callContract(FUNCTIONS.ALLOWANCE, _owner, _spender, options);
122
+ }
123
+ async increaseAllowance(_spender, _addedValue, options) {
124
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _spender);
125
+ await this.validateInput(index_1.DATATYPES.NUMBER, _addedValue);
126
+ return this.callContract(FUNCTIONS.INCREASEALLOWANCE, _spender, _addedValue, options);
127
+ }
128
+ async decreaseAllowance(_spender, _subtractedValue, options) {
129
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _spender);
130
+ await this.validateInput(index_1.DATATYPES.NUMBER, _subtractedValue);
131
+ return this.callContract(FUNCTIONS.DECREASEALLOWANCE, _spender, _subtractedValue, options);
132
+ }
80
133
  /*
81
134
  emits event BondIssued(address indexed _token, address issuer, uint256 issuedAmount, bytes32 collateralCurrency, uint256 collateralValue);
82
135
  */
@@ -29,6 +29,15 @@ export default class Cash extends VerifiedContract {
29
29
  */
30
30
  transferFrom(_senderAddress: string, _recieverAddress: string, _tokens: string, options?: Options): any;
31
31
  balanceOf(_wallet: string, options?: Options): any;
32
+ name(): any;
33
+ symbol(): any;
34
+ decimals(): any;
35
+ totalSupply(): any;
36
+ transfer(_recipient: string, _amount: string, options?: Options): any;
37
+ approve(_spender: string, _amount: string, options?: Options): any;
38
+ allowance(_owner: string, _spender: string, options?: Options): any;
39
+ increaseAllowance(_spender: string, _addedValue: string, options?: Options): any;
40
+ decreaseAllowance(_spender: string, _subtractedValue: string, options?: Options): any;
32
41
  notifyCashIssue(callback: any): object;
33
42
  notifyCashRedemption(callback: any): object;
34
43
  notifyCashTransfer(callback: any): object;
@@ -10,7 +10,17 @@ var FUNCTIONS;
10
10
  FUNCTIONS["REQUESTISSUE"] = "requestIssue";
11
11
  FUNCTIONS["BURNCASHTOKENS"] = "burnCashTokens";
12
12
  FUNCTIONS["TRANSFERFROM"] = "transferFrom";
13
+ FUNCTIONS["NAME"] = "name";
14
+ FUNCTIONS["SYMBOL"] = "symbol";
15
+ FUNCTIONS["TOTALSUPPLY"] = "totalSupply";
13
16
  FUNCTIONS["BALANCE"] = "balanceOf";
17
+ FUNCTIONS["DECIMALS"] = "decimals";
18
+ FUNCTIONS["TRANSFER"] = "transfer";
19
+ FUNCTIONS["APPROVE"] = "approve";
20
+ FUNCTIONS["ALLOWANCE"] = "allowance";
21
+ FUNCTIONS["TRANSFERFROM"] = "transferFrom";
22
+ FUNCTIONS["INCREASEALLOWANCE"] = "increaseAllowance";
23
+ FUNCTIONS["DECREASEALLOWANCE"] = "decreaseAllowance";
14
24
  FUNCTIONS["ISSUE"] = "CashIssued";
15
25
  FUNCTIONS["REDEEM"] = "CashRedeemed";
16
26
  FUNCTIONS["TRANSFER"] = "CashTransfer";
@@ -68,6 +78,43 @@ class Cash extends index_1.VerifiedContract {
68
78
  await this.validateInput(index_1.DATATYPES.ADDRESS, _wallet);
69
79
  return this.callContract(FUNCTIONS.BALANCE, _wallet, options);
70
80
  }
81
+ async name() {
82
+ return this.callContract(FUNCTIONS.NAME);
83
+ }
84
+ async symbol() {
85
+ return this.callContract(FUNCTIONS.SYMBOL);
86
+ }
87
+ async decimals() {
88
+ return this.callContract(FUNCTIONS.DECIMALS);
89
+ }
90
+ async totalSupply() {
91
+ return this.callContract(FUNCTIONS.TOTALSUPPLY);
92
+ }
93
+ async transfer(_recipient, _amount, options) {
94
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _recipient);
95
+ await this.validateInput(index_1.DATATYPES.NUMBER, _amount);
96
+ return this.callContract(FUNCTIONS.TRANSFER, _recipient, _amount, options);
97
+ }
98
+ async approve(_spender, _amount, options) {
99
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _spender);
100
+ await this.validateInput(index_1.DATATYPES.NUMBER, _amount);
101
+ return this.callContract(FUNCTIONS.APPROVE, _spender, _amount, options);
102
+ }
103
+ async allowance(_owner, _spender, options) {
104
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _spender);
105
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _owner);
106
+ return this.callContract(FUNCTIONS.ALLOWANCE, _owner, _spender, options);
107
+ }
108
+ async increaseAllowance(_spender, _addedValue, options) {
109
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _spender);
110
+ await this.validateInput(index_1.DATATYPES.NUMBER, _addedValue);
111
+ return this.callContract(FUNCTIONS.INCREASEALLOWANCE, _spender, _addedValue, options);
112
+ }
113
+ async decreaseAllowance(_spender, _subtractedValue, options) {
114
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _spender);
115
+ await this.validateInput(index_1.DATATYPES.NUMBER, _subtractedValue);
116
+ return this.callContract(FUNCTIONS.DECREASEALLOWANCE, _spender, _subtractedValue, options);
117
+ }
71
118
  /*
72
119
  emits event CashIssued(address indexed _party, bytes32 currency, uint256 amount);
73
120
  */
@@ -3,7 +3,6 @@ import { VerifiedWallet } from "../../wallet";
3
3
  export default class Client extends VerifiedContract {
4
4
  contractAddress: string;
5
5
  constructor(signer: VerifiedWallet, contractNetworkAddress: string);
6
- setSigner(_address: string): any;
7
6
  _getMeeQuote(paymentTokenAddress: string, functionName: string, args: any[]): Promise<{
8
7
  tokenAddress: string;
9
8
  amount: string;
@@ -12,6 +11,7 @@ export default class Client extends VerifiedContract {
12
11
  chainId: number;
13
12
  functionName: string;
14
13
  }>;
14
+ setSigner(_address: string, options?: Options): any;
15
15
  /**
16
16
  * Get sub-managers for role [callable only by manager]
17
17
  * @params (address _submanager, bytes32 _country)
@@ -32,12 +32,13 @@ 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
- setSigner(_address) {
36
- return this.callContract(FUNCTIONS.SETSIGNER, _address);
37
- }
38
35
  async _getMeeQuote(paymentTokenAddress, functionName, args) {
39
36
  return await this.getQuote(paymentTokenAddress, functionName, args);
40
37
  }
38
+ setSigner(_address, options) {
39
+ await this.validateInput(index_1.DATATYPES.ADDRESS, _address);
40
+ return this.callContract(FUNCTIONS.SETSIGNER, _address, options);
41
+ }
41
42
  /**
42
43
  * Get sub-managers for role [callable only by manager]
43
44
  * @params (address _submanager, bytes32 _country)
@@ -501,8 +501,8 @@ class VerifiedContract {
501
501
  console.log("Using Mee client with paymentToken of: ", (_b = optionsRaw[0]) === null || _b === void 0 ? void 0 : _b.paymentToken);
502
502
  const _signer = this.signer;
503
503
  const nexusAccount = await (0, abstractjs_1.toMultichainNexusAccount)({
504
- chains: [chains_1.base, chains_1.mainnet, chains_1.sepolia, chains_1.gnosis, chains_1.baseSepolia, chains_1.polygon],
505
- transports: [(0, viem_1.http)(), (0, viem_1.http)(), (0, viem_1.http)(), (0, viem_1.http)(), (0, viem_1.http)(), (0, viem_1.http)()],
504
+ chains: [chains_1.base, chains_1.mainnet, chains_1.gnosis, chains_1.polygon],
505
+ transports: [(0, viem_1.http)(), (0, viem_1.http)(), (0, viem_1.http)(), (0, viem_1.http)()],
506
506
  signer: _signer,
507
507
  });
508
508
  const meeAddress = nexusAccount.addressOn(chainId);
@@ -529,8 +529,8 @@ class VerifiedContract {
529
529
  if (this.supportsGasless(chainId)) {
530
530
  const _signer = this.signer;
531
531
  const nexusAccount = await (0, abstractjs_1.toMultichainNexusAccount)({
532
- chains: [chains_1.base, chains_1.mainnet, chains_1.sepolia, chains_1.gnosis, chains_1.baseSepolia, chains_1.polygon],
533
- transports: [(0, viem_1.http)(), (0, viem_1.http)(), (0, viem_1.http)(), (0, viem_1.http)(), (0, viem_1.http)(), (0, viem_1.http)()],
532
+ chains: [chains_1.base, chains_1.mainnet, chains_1.gnosis, chains_1.polygon],
533
+ transports: [(0, viem_1.http)(), (0, viem_1.http)(), (0, viem_1.http)(), (0, viem_1.http)()],
534
534
  signer: _signer,
535
535
  });
536
536
  if (paymentTokenAddress) {
@@ -30,7 +30,7 @@ export default class SecuritiesFactory extends VerifiedContract {
30
30
  notifySecuritiesAdded(callback: any): object;
31
31
  setCustodian(_securityToken: string, _issuer: string, _custodian: string, options?: Options): any;
32
32
  getCustodian(_securityToken: string, _issuer: string, options?: Options): any;
33
- restrictCountry(_security: string, _countries: string, options?: Options): any;
33
+ restrictCountry(_security: string, _countries: any, options?: Options): any;
34
34
  getRestrictedCountries(_security: string, options?: Options): any;
35
35
  getDP(_securityToken: string, options?: Options): any;
36
36
  }
@@ -90,7 +90,6 @@ class SecuritiesFactory extends index_1.VerifiedContract {
90
90
  }
91
91
  async restrictCountry(_security, _countries, options) {
92
92
  await this.validateInput(index_1.DATATYPES.ADDRESS, _security);
93
- await this.validateInput(index_1.DATATYPES.STRING, _countries);
94
93
  return this.callContract(FUNCTIONS.RESTRICTCOUNTRY, _security, _countries, options);
95
94
  }
96
95
  async getRestrictedCountries(_security, options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verified-network/verified-sdk",
3
- "version": "2.1.8",
3
+ "version": "2.2.0",
4
4
  "description": "An SDK to develop applications on the Verified Network",
5
5
  "repository": {
6
6
  "type": "git",