@locuschain/lib 0.1.4 → 0.1.5

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.
@@ -660,7 +660,8 @@ function load() {
660
660
  const callWasm = (cmd, params) => {
661
661
  // @ts-ignore
662
662
  let callLclib = globalThis["CallLclib"];
663
- if (namespace) {
663
+ // @ts-ignore
664
+ if (namespace && globalThis[namespace]) {
664
665
  // @ts-ignore
665
666
  callLclib = globalThis[namespace]['CallLclib'];
666
667
  }
@@ -662,7 +662,8 @@ function load() {
662
662
  const callWasm = (cmd, params) => {
663
663
  // @ts-ignore
664
664
  let callLclib = globalThis["CallLclib"];
665
- if (namespace) {
665
+ // @ts-ignore
666
+ if (namespace && globalThis[namespace]) {
666
667
  // @ts-ignore
667
668
  callLclib = globalThis[namespace]['CallLclib'];
668
669
  }
@@ -662,7 +662,8 @@ define(['exports'], (function (exports) { 'use strict';
662
662
  const callWasm = (cmd, params) => {
663
663
  // @ts-ignore
664
664
  let callLclib = globalThis["CallLclib"];
665
- if (namespace) {
665
+ // @ts-ignore
666
+ if (namespace && globalThis[namespace]) {
666
667
  // @ts-ignore
667
668
  callLclib = globalThis[namespace]['CallLclib'];
668
669
  }
package/dist/index.amd.js CHANGED
@@ -1,4 +1,4 @@
1
- define(['exports', './constant/index.amd', './utils/index.amd', './web3/index.amd', './chunks/rpc-BAmVbBAy', './chunks/address-class-Dp7aNQb2', './chunks/tx-type-BeeK7Ci3', 'lodash'], (function (exports, constant, utils, web3, rpc, addressClass, txType, _) { 'use strict';
1
+ define(['exports', './constant/index.amd', './utils/index.amd', './web3/index.amd', './chunks/rpc-djBJaB9B', './chunks/address-class-Dp7aNQb2', './chunks/tx-type-BeeK7Ci3', 'lodash'], (function (exports, constant, utils, web3, rpc, addressClass, txType, _) { 'use strict';
2
2
 
3
3
 
4
4
 
@@ -3,7 +3,7 @@
3
3
  var constant = require('./constant/index.cjs.cjs');
4
4
  var utils = require('./utils/index.cjs.cjs');
5
5
  var web3 = require('./web3/index.cjs.cjs');
6
- var rpc = require('./chunks/rpc-BAsBB-qv.cjs');
6
+ var rpc = require('./chunks/rpc-BbwIyILT.cjs');
7
7
  require('./chunks/address-class-Cjy48Uqk.cjs');
8
8
  require('./chunks/tx-type-jR5Owltc.cjs');
9
9
  require('lodash');
package/dist/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export { AddressClass, Currency, FeeType, GRANT_COST_PER_TX, MaxVMRewardsCount, TxType, TxTypes } from './constant/index.esm.js';
2
2
  export { checkAddressType, isAccount, isContract, isSystemToken, isToken, loadLocusWasm, loadLocusWasmSync, txValidator, verifyTxParams } from './utils/index.esm.js';
3
3
  export { Account, AccountProvider, HttpRpcProvider, RpcProvider, Web3 } from './web3/index.esm.js';
4
- export { R as Rpc, T as TX_CREATION_RPC_LIST, c as calculateTxLinkHash, a as compileCoreScript, b as convertAddressToData, d as convertAddressToHex, e as convertBase32ToData, f as convertBase32ToHex, g as convertCurrency, h as convertDataTo, i as convertDataToAddress, j as convertDataToBase32, k as convertDataToHex, l as convertDataToString, m as convertHexToAddress, n as convertHexToBase32, o as convertHexToData, p as convertStringToData, q as convertToData, r as createAccountAndKeystore, s as createMasterKeystore, t as createNormalKey, u as createNormalKeystore, v as decodeTxs, w as deriveKeysFromMnemonic, x as disCompileCoreScript, y as encodeTxCurrency, z as encodeTxNumber, A as generateMnemonic, B as generateMnemonicBySeed, C as getDefFromCoreScript, D as getHomeShard, E as getLibraryVersions, F as gzipAndEncode, G as hash, H as isGrantConsumingTx, I as loadMasterKeystore, J as loadNormalKeystore, K as makeCurrency, L as sign, M as signByMasterKey, N as testCoreScript, O as verify, P as verifyByMasterKey, Q as verifyMerkleProof, S as verifyTx } from './chunks/rpc-Cigm_4T9.js';
4
+ export { R as Rpc, T as TX_CREATION_RPC_LIST, c as calculateTxLinkHash, a as compileCoreScript, b as convertAddressToData, d as convertAddressToHex, e as convertBase32ToData, f as convertBase32ToHex, g as convertCurrency, h as convertDataTo, i as convertDataToAddress, j as convertDataToBase32, k as convertDataToHex, l as convertDataToString, m as convertHexToAddress, n as convertHexToBase32, o as convertHexToData, p as convertStringToData, q as convertToData, r as createAccountAndKeystore, s as createMasterKeystore, t as createNormalKey, u as createNormalKeystore, v as decodeTxs, w as deriveKeysFromMnemonic, x as disCompileCoreScript, y as encodeTxCurrency, z as encodeTxNumber, A as generateMnemonic, B as generateMnemonicBySeed, C as getDefFromCoreScript, D as getHomeShard, E as getLibraryVersions, F as gzipAndEncode, G as hash, H as isGrantConsumingTx, I as loadMasterKeystore, J as loadNormalKeystore, K as makeCurrency, L as sign, M as signByMasterKey, N as testCoreScript, O as verify, P as verifyByMasterKey, Q as verifyMerkleProof, S as verifyTx } from './chunks/rpc-B_0_w7Tl.js';
5
5
  import './chunks/address-class-CHAZYhdZ.js';
6
6
  import './chunks/tx-type-nyLU5xv5.js';
7
7
  import 'lodash';
@@ -0,0 +1,2 @@
1
+ export declare const erc20Abi: any[];
2
+ export default erc20Abi;
@@ -1,4 +1,4 @@
1
- define(['exports', '../utils/index.amd', '../chunks/rpc-BAmVbBAy', 'lodash', '../chunks/address-class-Dp7aNQb2'], (function (exports, utils$2, rpc, _, addressClass) { 'use strict';
1
+ define(['exports', '../utils/index.amd', '../chunks/rpc-djBJaB9B', 'lodash', '../chunks/address-class-Dp7aNQb2'], (function (exports, utils$2, rpc, _, addressClass) { 'use strict';
2
2
 
3
3
  function _interopNamespaceDefault(e) {
4
4
  var n = Object.create(null);
@@ -19574,67 +19574,232 @@ define(['exports', '../utils/index.amd', '../chunks/rpc-BAmVbBAy', 'lodash', '..
19574
19574
  return { to, amount };
19575
19575
  };
19576
19576
 
19577
- const locusVmeBaseAbi = [
19577
+ const erc20Abi = [
19578
19578
  {
19579
19579
  constant: true,
19580
19580
  inputs: [],
19581
- name: 'creator',
19582
- outputs: [{ name: '', type: 'address' }],
19581
+ name: "name",
19582
+ outputs: [
19583
+ {
19584
+ name: "",
19585
+ type: "string"
19586
+ }
19587
+ ],
19588
+ payable: false,
19589
+ stateMutability: "view",
19590
+ type: "function"
19591
+ },
19592
+ {
19593
+ constant: false,
19594
+ inputs: [
19595
+ {
19596
+ name: "_spender",
19597
+ type: "address"
19598
+ },
19599
+ {
19600
+ name: "_value",
19601
+ type: "uint256"
19602
+ }
19603
+ ],
19604
+ name: "approve",
19605
+ outputs: [
19606
+ {
19607
+ name: "",
19608
+ type: "bool"
19609
+ }
19610
+ ],
19583
19611
  payable: false,
19584
- stateMutability: 'view',
19585
- type: 'function'
19612
+ stateMutability: "nonpayable",
19613
+ type: "function"
19586
19614
  },
19587
19615
  {
19588
19616
  constant: true,
19589
19617
  inputs: [],
19590
- name: 'name',
19591
- outputs: [{ name: '', type: 'string' }],
19618
+ name: "totalSupply",
19619
+ outputs: [
19620
+ {
19621
+ name: "",
19622
+ type: "uint256"
19623
+ }
19624
+ ],
19592
19625
  payable: false,
19593
- stateMutability: 'view',
19594
- type: 'function'
19626
+ stateMutability: "view",
19627
+ type: "function"
19595
19628
  },
19596
19629
  {
19597
19630
  constant: false,
19598
- inputs: [{ name: 'value', type: 'uint256' }],
19599
- name: 'withdraw',
19600
- outputs: [],
19601
- payable: true,
19602
- stateMutability: 'payable',
19603
- type: 'function'
19631
+ inputs: [
19632
+ {
19633
+ name: "_from",
19634
+ type: "address"
19635
+ },
19636
+ {
19637
+ name: "_to",
19638
+ type: "address"
19639
+ },
19640
+ {
19641
+ name: "_value",
19642
+ type: "uint256"
19643
+ }
19644
+ ],
19645
+ name: "transferFrom",
19646
+ outputs: [
19647
+ {
19648
+ name: "",
19649
+ type: "bool"
19650
+ }
19651
+ ],
19652
+ payable: false,
19653
+ stateMutability: "nonpayable",
19654
+ type: "function"
19604
19655
  },
19605
19656
  {
19606
19657
  constant: true,
19607
19658
  inputs: [],
19608
- name: 'getExtBalance',
19609
- outputs: [{ name: '', type: 'uint256' }],
19659
+ name: "decimals",
19660
+ outputs: [
19661
+ {
19662
+ name: "",
19663
+ type: "uint8"
19664
+ }
19665
+ ],
19610
19666
  payable: false,
19611
- stateMutability: 'view',
19612
- type: 'function'
19667
+ stateMutability: "view",
19668
+ type: "function"
19613
19669
  },
19614
19670
  {
19615
19671
  constant: true,
19616
- inputs: [{ name: 'addr', type: 'address' }],
19617
- name: 'checkBalance',
19618
- outputs: [{ name: '', type: 'uint256' }],
19672
+ inputs: [
19673
+ {
19674
+ name: "_owner",
19675
+ type: "address"
19676
+ }
19677
+ ],
19678
+ name: "balanceOf",
19679
+ outputs: [
19680
+ {
19681
+ name: "balance",
19682
+ type: "uint256"
19683
+ }
19684
+ ],
19619
19685
  payable: false,
19620
- stateMutability: 'view',
19621
- type: 'function'
19686
+ stateMutability: "view",
19687
+ type: "function"
19622
19688
  },
19623
19689
  {
19624
- constant: false,
19690
+ constant: true,
19625
19691
  inputs: [],
19626
- name: 'deposit',
19627
- outputs: [],
19692
+ name: "symbol",
19693
+ outputs: [
19694
+ {
19695
+ name: "",
19696
+ type: "string"
19697
+ }
19698
+ ],
19699
+ payable: false,
19700
+ stateMutability: "view",
19701
+ type: "function"
19702
+ },
19703
+ {
19704
+ constant: false,
19705
+ inputs: [
19706
+ {
19707
+ name: "_to",
19708
+ type: "address"
19709
+ },
19710
+ {
19711
+ name: "_value",
19712
+ type: "uint256"
19713
+ }
19714
+ ],
19715
+ name: "transfer",
19716
+ outputs: [
19717
+ {
19718
+ name: "",
19719
+ type: "bool"
19720
+ }
19721
+ ],
19722
+ payable: false,
19723
+ stateMutability: "nonpayable",
19724
+ type: "function"
19725
+ },
19726
+ {
19727
+ constant: true,
19728
+ inputs: [
19729
+ {
19730
+ name: "_owner",
19731
+ type: "address"
19732
+ },
19733
+ {
19734
+ name: "_spender",
19735
+ type: "address"
19736
+ }
19737
+ ],
19738
+ name: "allowance",
19739
+ outputs: [
19740
+ {
19741
+ name: "",
19742
+ type: "uint256"
19743
+ }
19744
+ ],
19745
+ payable: false,
19746
+ stateMutability: "view",
19747
+ type: "function"
19748
+ },
19749
+ {
19628
19750
  payable: true,
19629
- stateMutability: 'payable',
19630
- type: 'function'
19751
+ stateMutability: "payable",
19752
+ type: "fallback"
19631
19753
  },
19632
- { inputs: [], payable: false, stateMutability: 'nonpayable', type: 'constructor' }
19754
+ {
19755
+ anonymous: false,
19756
+ inputs: [
19757
+ {
19758
+ indexed: true,
19759
+ name: "owner",
19760
+ type: "address"
19761
+ },
19762
+ {
19763
+ indexed: true,
19764
+ name: "spender",
19765
+ type: "address"
19766
+ },
19767
+ {
19768
+ indexed: false,
19769
+ name: "value",
19770
+ type: "uint256"
19771
+ }
19772
+ ],
19773
+ name: "Approval",
19774
+ type: "event"
19775
+ },
19776
+ {
19777
+ anonymous: false,
19778
+ inputs: [
19779
+ {
19780
+ indexed: true,
19781
+ name: "from",
19782
+ type: "address"
19783
+ },
19784
+ {
19785
+ indexed: true,
19786
+ name: "to",
19787
+ type: "address"
19788
+ },
19789
+ {
19790
+ indexed: false,
19791
+ name: "value",
19792
+ type: "uint256"
19793
+ }
19794
+ ],
19795
+ name: "Transfer",
19796
+ type: "event"
19797
+ }
19633
19798
  ];
19634
19799
 
19635
19800
  class ERC20Helper {
19636
19801
  constructor(abi) {
19637
- this.abi = locusVmeBaseAbi;
19802
+ this.abi = erc20Abi;
19638
19803
  if (abi)
19639
19804
  this.abi = abi;
19640
19805
  }
@@ -19818,10 +19983,10 @@ define(['exports', '../utils/index.amd', '../chunks/rpc-BAmVbBAy', 'lodash', '..
19818
19983
  exports.convertJsonToFuncString = convertJsonToFuncString;
19819
19984
  exports.decodeResult = decodeResult;
19820
19985
  exports.encodeArgHex = encodeArgHex;
19986
+ exports.erc20Abi = erc20Abi;
19821
19987
  exports.getFunc = getFunc;
19822
19988
  exports.getFuncHex = getFuncHex;
19823
19989
  exports.getTransferFuncArgs = getTransferFuncArgs;
19824
- exports.locusVmeBaseAbi = locusVmeBaseAbi;
19825
19990
  exports.removeHexPrefix = removeHexPrefix;
19826
19991
 
19827
19992
  }));
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  require('../utils/index.cjs.cjs');
4
- var rpc = require('../chunks/rpc-BAsBB-qv.cjs');
4
+ var rpc = require('../chunks/rpc-BbwIyILT.cjs');
5
5
  var _ = require('lodash');
6
6
  require('../chunks/address-class-Cjy48Uqk.cjs');
7
7
 
@@ -19579,67 +19579,232 @@ const getTransferFuncArgs = (func) => {
19579
19579
  return { to, amount };
19580
19580
  };
19581
19581
 
19582
- const locusVmeBaseAbi = [
19582
+ const erc20Abi = [
19583
19583
  {
19584
19584
  constant: true,
19585
19585
  inputs: [],
19586
- name: 'creator',
19587
- outputs: [{ name: '', type: 'address' }],
19586
+ name: "name",
19587
+ outputs: [
19588
+ {
19589
+ name: "",
19590
+ type: "string"
19591
+ }
19592
+ ],
19593
+ payable: false,
19594
+ stateMutability: "view",
19595
+ type: "function"
19596
+ },
19597
+ {
19598
+ constant: false,
19599
+ inputs: [
19600
+ {
19601
+ name: "_spender",
19602
+ type: "address"
19603
+ },
19604
+ {
19605
+ name: "_value",
19606
+ type: "uint256"
19607
+ }
19608
+ ],
19609
+ name: "approve",
19610
+ outputs: [
19611
+ {
19612
+ name: "",
19613
+ type: "bool"
19614
+ }
19615
+ ],
19588
19616
  payable: false,
19589
- stateMutability: 'view',
19590
- type: 'function'
19617
+ stateMutability: "nonpayable",
19618
+ type: "function"
19591
19619
  },
19592
19620
  {
19593
19621
  constant: true,
19594
19622
  inputs: [],
19595
- name: 'name',
19596
- outputs: [{ name: '', type: 'string' }],
19623
+ name: "totalSupply",
19624
+ outputs: [
19625
+ {
19626
+ name: "",
19627
+ type: "uint256"
19628
+ }
19629
+ ],
19597
19630
  payable: false,
19598
- stateMutability: 'view',
19599
- type: 'function'
19631
+ stateMutability: "view",
19632
+ type: "function"
19600
19633
  },
19601
19634
  {
19602
19635
  constant: false,
19603
- inputs: [{ name: 'value', type: 'uint256' }],
19604
- name: 'withdraw',
19605
- outputs: [],
19606
- payable: true,
19607
- stateMutability: 'payable',
19608
- type: 'function'
19636
+ inputs: [
19637
+ {
19638
+ name: "_from",
19639
+ type: "address"
19640
+ },
19641
+ {
19642
+ name: "_to",
19643
+ type: "address"
19644
+ },
19645
+ {
19646
+ name: "_value",
19647
+ type: "uint256"
19648
+ }
19649
+ ],
19650
+ name: "transferFrom",
19651
+ outputs: [
19652
+ {
19653
+ name: "",
19654
+ type: "bool"
19655
+ }
19656
+ ],
19657
+ payable: false,
19658
+ stateMutability: "nonpayable",
19659
+ type: "function"
19609
19660
  },
19610
19661
  {
19611
19662
  constant: true,
19612
19663
  inputs: [],
19613
- name: 'getExtBalance',
19614
- outputs: [{ name: '', type: 'uint256' }],
19664
+ name: "decimals",
19665
+ outputs: [
19666
+ {
19667
+ name: "",
19668
+ type: "uint8"
19669
+ }
19670
+ ],
19615
19671
  payable: false,
19616
- stateMutability: 'view',
19617
- type: 'function'
19672
+ stateMutability: "view",
19673
+ type: "function"
19618
19674
  },
19619
19675
  {
19620
19676
  constant: true,
19621
- inputs: [{ name: 'addr', type: 'address' }],
19622
- name: 'checkBalance',
19623
- outputs: [{ name: '', type: 'uint256' }],
19677
+ inputs: [
19678
+ {
19679
+ name: "_owner",
19680
+ type: "address"
19681
+ }
19682
+ ],
19683
+ name: "balanceOf",
19684
+ outputs: [
19685
+ {
19686
+ name: "balance",
19687
+ type: "uint256"
19688
+ }
19689
+ ],
19624
19690
  payable: false,
19625
- stateMutability: 'view',
19626
- type: 'function'
19691
+ stateMutability: "view",
19692
+ type: "function"
19627
19693
  },
19628
19694
  {
19629
- constant: false,
19695
+ constant: true,
19630
19696
  inputs: [],
19631
- name: 'deposit',
19632
- outputs: [],
19697
+ name: "symbol",
19698
+ outputs: [
19699
+ {
19700
+ name: "",
19701
+ type: "string"
19702
+ }
19703
+ ],
19704
+ payable: false,
19705
+ stateMutability: "view",
19706
+ type: "function"
19707
+ },
19708
+ {
19709
+ constant: false,
19710
+ inputs: [
19711
+ {
19712
+ name: "_to",
19713
+ type: "address"
19714
+ },
19715
+ {
19716
+ name: "_value",
19717
+ type: "uint256"
19718
+ }
19719
+ ],
19720
+ name: "transfer",
19721
+ outputs: [
19722
+ {
19723
+ name: "",
19724
+ type: "bool"
19725
+ }
19726
+ ],
19727
+ payable: false,
19728
+ stateMutability: "nonpayable",
19729
+ type: "function"
19730
+ },
19731
+ {
19732
+ constant: true,
19733
+ inputs: [
19734
+ {
19735
+ name: "_owner",
19736
+ type: "address"
19737
+ },
19738
+ {
19739
+ name: "_spender",
19740
+ type: "address"
19741
+ }
19742
+ ],
19743
+ name: "allowance",
19744
+ outputs: [
19745
+ {
19746
+ name: "",
19747
+ type: "uint256"
19748
+ }
19749
+ ],
19750
+ payable: false,
19751
+ stateMutability: "view",
19752
+ type: "function"
19753
+ },
19754
+ {
19633
19755
  payable: true,
19634
- stateMutability: 'payable',
19635
- type: 'function'
19756
+ stateMutability: "payable",
19757
+ type: "fallback"
19636
19758
  },
19637
- { inputs: [], payable: false, stateMutability: 'nonpayable', type: 'constructor' }
19759
+ {
19760
+ anonymous: false,
19761
+ inputs: [
19762
+ {
19763
+ indexed: true,
19764
+ name: "owner",
19765
+ type: "address"
19766
+ },
19767
+ {
19768
+ indexed: true,
19769
+ name: "spender",
19770
+ type: "address"
19771
+ },
19772
+ {
19773
+ indexed: false,
19774
+ name: "value",
19775
+ type: "uint256"
19776
+ }
19777
+ ],
19778
+ name: "Approval",
19779
+ type: "event"
19780
+ },
19781
+ {
19782
+ anonymous: false,
19783
+ inputs: [
19784
+ {
19785
+ indexed: true,
19786
+ name: "from",
19787
+ type: "address"
19788
+ },
19789
+ {
19790
+ indexed: true,
19791
+ name: "to",
19792
+ type: "address"
19793
+ },
19794
+ {
19795
+ indexed: false,
19796
+ name: "value",
19797
+ type: "uint256"
19798
+ }
19799
+ ],
19800
+ name: "Transfer",
19801
+ type: "event"
19802
+ }
19638
19803
  ];
19639
19804
 
19640
19805
  class ERC20Helper {
19641
19806
  constructor(abi) {
19642
- this.abi = locusVmeBaseAbi;
19807
+ this.abi = erc20Abi;
19643
19808
  if (abi)
19644
19809
  this.abi = abi;
19645
19810
  }
@@ -19823,8 +19988,8 @@ exports.TokenInfo = TokenInfo;
19823
19988
  exports.convertJsonToFuncString = convertJsonToFuncString;
19824
19989
  exports.decodeResult = decodeResult;
19825
19990
  exports.encodeArgHex = encodeArgHex;
19991
+ exports.erc20Abi = erc20Abi;
19826
19992
  exports.getFunc = getFunc;
19827
19993
  exports.getFuncHex = getFuncHex;
19828
19994
  exports.getTransferFuncArgs = getTransferFuncArgs;
19829
- exports.locusVmeBaseAbi = locusVmeBaseAbi;
19830
19995
  exports.removeHexPrefix = removeHexPrefix;
@@ -1,4 +1,4 @@
1
1
  export * from './erc20-helper/abi.mjs';
2
2
  export * from './erc20-helper/index.mjs';
3
- export * from './erc20-helper/locus-vme-base-abi.mjs';
3
+ export * from './erc20-helper/erc20.mjs';
4
4
  export * as LocusEthers from '../libs/ethers.js-5.5.4-24bytes-addr/ethers.esm.min.js';
@@ -1,4 +1,4 @@
1
1
  export * from './erc20-helper/abi.mjs';
2
2
  export * from './erc20-helper/index.mjs';
3
- export * from './erc20-helper/locus-vme-base-abi.mjs';
3
+ export * from './erc20-helper/erc20.mjs';
4
4
  export * as LocusEthers from '../libs/ethers.js-5.5.4-24bytes-addr/ethers.esm.min.js';
@@ -1,5 +1,5 @@
1
1
  import '../utils/index.esm.js';
2
- import { k as convertDataToHex, m as convertHexToAddress, d as convertAddressToHex, o as convertHexToData, _ as __awaiter } from '../chunks/rpc-Cigm_4T9.js';
2
+ import { k as convertDataToHex, m as convertHexToAddress, d as convertAddressToHex, o as convertHexToData, _ as __awaiter } from '../chunks/rpc-B_0_w7Tl.js';
3
3
  import * as _ from 'lodash';
4
4
  import '../chunks/address-class-CHAZYhdZ.js';
5
5
 
@@ -19558,67 +19558,232 @@ const getTransferFuncArgs = (func) => {
19558
19558
  return { to, amount };
19559
19559
  };
19560
19560
 
19561
- const locusVmeBaseAbi = [
19561
+ const erc20Abi = [
19562
19562
  {
19563
19563
  constant: true,
19564
19564
  inputs: [],
19565
- name: 'creator',
19566
- outputs: [{ name: '', type: 'address' }],
19565
+ name: "name",
19566
+ outputs: [
19567
+ {
19568
+ name: "",
19569
+ type: "string"
19570
+ }
19571
+ ],
19572
+ payable: false,
19573
+ stateMutability: "view",
19574
+ type: "function"
19575
+ },
19576
+ {
19577
+ constant: false,
19578
+ inputs: [
19579
+ {
19580
+ name: "_spender",
19581
+ type: "address"
19582
+ },
19583
+ {
19584
+ name: "_value",
19585
+ type: "uint256"
19586
+ }
19587
+ ],
19588
+ name: "approve",
19589
+ outputs: [
19590
+ {
19591
+ name: "",
19592
+ type: "bool"
19593
+ }
19594
+ ],
19567
19595
  payable: false,
19568
- stateMutability: 'view',
19569
- type: 'function'
19596
+ stateMutability: "nonpayable",
19597
+ type: "function"
19570
19598
  },
19571
19599
  {
19572
19600
  constant: true,
19573
19601
  inputs: [],
19574
- name: 'name',
19575
- outputs: [{ name: '', type: 'string' }],
19602
+ name: "totalSupply",
19603
+ outputs: [
19604
+ {
19605
+ name: "",
19606
+ type: "uint256"
19607
+ }
19608
+ ],
19576
19609
  payable: false,
19577
- stateMutability: 'view',
19578
- type: 'function'
19610
+ stateMutability: "view",
19611
+ type: "function"
19579
19612
  },
19580
19613
  {
19581
19614
  constant: false,
19582
- inputs: [{ name: 'value', type: 'uint256' }],
19583
- name: 'withdraw',
19584
- outputs: [],
19585
- payable: true,
19586
- stateMutability: 'payable',
19587
- type: 'function'
19615
+ inputs: [
19616
+ {
19617
+ name: "_from",
19618
+ type: "address"
19619
+ },
19620
+ {
19621
+ name: "_to",
19622
+ type: "address"
19623
+ },
19624
+ {
19625
+ name: "_value",
19626
+ type: "uint256"
19627
+ }
19628
+ ],
19629
+ name: "transferFrom",
19630
+ outputs: [
19631
+ {
19632
+ name: "",
19633
+ type: "bool"
19634
+ }
19635
+ ],
19636
+ payable: false,
19637
+ stateMutability: "nonpayable",
19638
+ type: "function"
19588
19639
  },
19589
19640
  {
19590
19641
  constant: true,
19591
19642
  inputs: [],
19592
- name: 'getExtBalance',
19593
- outputs: [{ name: '', type: 'uint256' }],
19643
+ name: "decimals",
19644
+ outputs: [
19645
+ {
19646
+ name: "",
19647
+ type: "uint8"
19648
+ }
19649
+ ],
19594
19650
  payable: false,
19595
- stateMutability: 'view',
19596
- type: 'function'
19651
+ stateMutability: "view",
19652
+ type: "function"
19597
19653
  },
19598
19654
  {
19599
19655
  constant: true,
19600
- inputs: [{ name: 'addr', type: 'address' }],
19601
- name: 'checkBalance',
19602
- outputs: [{ name: '', type: 'uint256' }],
19656
+ inputs: [
19657
+ {
19658
+ name: "_owner",
19659
+ type: "address"
19660
+ }
19661
+ ],
19662
+ name: "balanceOf",
19663
+ outputs: [
19664
+ {
19665
+ name: "balance",
19666
+ type: "uint256"
19667
+ }
19668
+ ],
19603
19669
  payable: false,
19604
- stateMutability: 'view',
19605
- type: 'function'
19670
+ stateMutability: "view",
19671
+ type: "function"
19606
19672
  },
19607
19673
  {
19608
- constant: false,
19674
+ constant: true,
19609
19675
  inputs: [],
19610
- name: 'deposit',
19611
- outputs: [],
19676
+ name: "symbol",
19677
+ outputs: [
19678
+ {
19679
+ name: "",
19680
+ type: "string"
19681
+ }
19682
+ ],
19683
+ payable: false,
19684
+ stateMutability: "view",
19685
+ type: "function"
19686
+ },
19687
+ {
19688
+ constant: false,
19689
+ inputs: [
19690
+ {
19691
+ name: "_to",
19692
+ type: "address"
19693
+ },
19694
+ {
19695
+ name: "_value",
19696
+ type: "uint256"
19697
+ }
19698
+ ],
19699
+ name: "transfer",
19700
+ outputs: [
19701
+ {
19702
+ name: "",
19703
+ type: "bool"
19704
+ }
19705
+ ],
19706
+ payable: false,
19707
+ stateMutability: "nonpayable",
19708
+ type: "function"
19709
+ },
19710
+ {
19711
+ constant: true,
19712
+ inputs: [
19713
+ {
19714
+ name: "_owner",
19715
+ type: "address"
19716
+ },
19717
+ {
19718
+ name: "_spender",
19719
+ type: "address"
19720
+ }
19721
+ ],
19722
+ name: "allowance",
19723
+ outputs: [
19724
+ {
19725
+ name: "",
19726
+ type: "uint256"
19727
+ }
19728
+ ],
19729
+ payable: false,
19730
+ stateMutability: "view",
19731
+ type: "function"
19732
+ },
19733
+ {
19612
19734
  payable: true,
19613
- stateMutability: 'payable',
19614
- type: 'function'
19735
+ stateMutability: "payable",
19736
+ type: "fallback"
19615
19737
  },
19616
- { inputs: [], payable: false, stateMutability: 'nonpayable', type: 'constructor' }
19738
+ {
19739
+ anonymous: false,
19740
+ inputs: [
19741
+ {
19742
+ indexed: true,
19743
+ name: "owner",
19744
+ type: "address"
19745
+ },
19746
+ {
19747
+ indexed: true,
19748
+ name: "spender",
19749
+ type: "address"
19750
+ },
19751
+ {
19752
+ indexed: false,
19753
+ name: "value",
19754
+ type: "uint256"
19755
+ }
19756
+ ],
19757
+ name: "Approval",
19758
+ type: "event"
19759
+ },
19760
+ {
19761
+ anonymous: false,
19762
+ inputs: [
19763
+ {
19764
+ indexed: true,
19765
+ name: "from",
19766
+ type: "address"
19767
+ },
19768
+ {
19769
+ indexed: true,
19770
+ name: "to",
19771
+ type: "address"
19772
+ },
19773
+ {
19774
+ indexed: false,
19775
+ name: "value",
19776
+ type: "uint256"
19777
+ }
19778
+ ],
19779
+ name: "Transfer",
19780
+ type: "event"
19781
+ }
19617
19782
  ];
19618
19783
 
19619
19784
  class ERC20Helper {
19620
19785
  constructor(abi) {
19621
- this.abi = locusVmeBaseAbi;
19786
+ this.abi = erc20Abi;
19622
19787
  if (abi)
19623
19788
  this.abi = abi;
19624
19789
  }
@@ -19796,4 +19961,4 @@ class ERC20Helper {
19796
19961
  }
19797
19962
  }
19798
19963
 
19799
- export { ERC20Helper, ethers_esm_min as LocusEthers, TokenInfo, convertJsonToFuncString, decodeResult, encodeArgHex, getFunc, getFuncHex, getTransferFuncArgs, locusVmeBaseAbi, removeHexPrefix };
19964
+ export { ERC20Helper, ethers_esm_min as LocusEthers, TokenInfo, convertJsonToFuncString, decodeResult, encodeArgHex, erc20Abi, getFunc, getFuncHex, getTransferFuncArgs, removeHexPrefix };
@@ -1,4 +1,4 @@
1
- define(['exports', '../chunks/address-class-Dp7aNQb2', '../chunks/rpc-BAmVbBAy', 'lodash'], (function (exports, addressClass, rpc, _) { 'use strict';
1
+ define(['exports', '../chunks/address-class-Dp7aNQb2', '../chunks/rpc-djBJaB9B', 'lodash'], (function (exports, addressClass, rpc, _) { 'use strict';
2
2
 
3
3
  class TxValidator {
4
4
  constructor() {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var addressClass = require('../chunks/address-class-Cjy48Uqk.cjs');
4
- var rpc = require('../chunks/rpc-BAsBB-qv.cjs');
4
+ var rpc = require('../chunks/rpc-BbwIyILT.cjs');
5
5
  var _ = require('lodash');
6
6
 
7
7
  class TxValidator {
@@ -1,6 +1,6 @@
1
1
  import { A as AddressClass } from '../chunks/address-class-CHAZYhdZ.js';
2
- import { S as verifyTx, a as compileCoreScript, U as load, V as loadSync, d as convertAddressToHex } from '../chunks/rpc-Cigm_4T9.js';
3
- export { R as Rpc, T as TX_CREATION_RPC_LIST, c as calculateTxLinkHash, b as convertAddressToData, e as convertBase32ToData, f as convertBase32ToHex, g as convertCurrency, h as convertDataTo, i as convertDataToAddress, j as convertDataToBase32, k as convertDataToHex, l as convertDataToString, m as convertHexToAddress, n as convertHexToBase32, o as convertHexToData, p as convertStringToData, q as convertToData, r as createAccountAndKeystore, s as createMasterKeystore, t as createNormalKey, u as createNormalKeystore, v as decodeTxs, w as deriveKeysFromMnemonic, x as disCompileCoreScript, y as encodeTxCurrency, z as encodeTxNumber, A as generateMnemonic, B as generateMnemonicBySeed, C as getDefFromCoreScript, D as getHomeShard, E as getLibraryVersions, F as gzipAndEncode, G as hash, H as isGrantConsumingTx, I as loadMasterKeystore, J as loadNormalKeystore, K as makeCurrency, L as sign, M as signByMasterKey, N as testCoreScript, O as verify, P as verifyByMasterKey, Q as verifyMerkleProof } from '../chunks/rpc-Cigm_4T9.js';
2
+ import { S as verifyTx, a as compileCoreScript, U as load, V as loadSync, d as convertAddressToHex } from '../chunks/rpc-B_0_w7Tl.js';
3
+ export { R as Rpc, T as TX_CREATION_RPC_LIST, c as calculateTxLinkHash, b as convertAddressToData, e as convertBase32ToData, f as convertBase32ToHex, g as convertCurrency, h as convertDataTo, i as convertDataToAddress, j as convertDataToBase32, k as convertDataToHex, l as convertDataToString, m as convertHexToAddress, n as convertHexToBase32, o as convertHexToData, p as convertStringToData, q as convertToData, r as createAccountAndKeystore, s as createMasterKeystore, t as createNormalKey, u as createNormalKeystore, v as decodeTxs, w as deriveKeysFromMnemonic, x as disCompileCoreScript, y as encodeTxCurrency, z as encodeTxNumber, A as generateMnemonic, B as generateMnemonicBySeed, C as getDefFromCoreScript, D as getHomeShard, E as getLibraryVersions, F as gzipAndEncode, G as hash, H as isGrantConsumingTx, I as loadMasterKeystore, J as loadNormalKeystore, K as makeCurrency, L as sign, M as signByMasterKey, N as testCoreScript, O as verify, P as verifyByMasterKey, Q as verifyMerkleProof } from '../chunks/rpc-B_0_w7Tl.js';
4
4
  import ___default from 'lodash';
5
5
 
6
6
  class TxValidator {
@@ -1,4 +1,4 @@
1
- define(['exports', '../chunks/rpc-BAmVbBAy', '../chunks/tx-type-BeeK7Ci3'], (function (exports, rpc, txType) { 'use strict';
1
+ define(['exports', '../chunks/rpc-djBJaB9B', '../chunks/tx-type-BeeK7Ci3'], (function (exports, rpc, txType) { 'use strict';
2
2
 
3
3
  class Account {
4
4
  constructor({ address, nsk }) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var rpc = require('../chunks/rpc-BAsBB-qv.cjs');
3
+ var rpc = require('../chunks/rpc-BbwIyILT.cjs');
4
4
  var txType = require('../chunks/tx-type-jR5Owltc.cjs');
5
5
 
6
6
  class Account {
@@ -1,4 +1,4 @@
1
- import { L as sign, _ as __awaiter, R as Rpc, T as TX_CREATION_RPC_LIST } from '../chunks/rpc-Cigm_4T9.js';
1
+ import { L as sign, _ as __awaiter, R as Rpc, T as TX_CREATION_RPC_LIST } from '../chunks/rpc-B_0_w7Tl.js';
2
2
  import { T as TxType } from '../chunks/tx-type-nyLU5xv5.js';
3
3
 
4
4
  class Account {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@locuschain/lib",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "author": "bloomtechnology",
6
6
  "license": "MIT",
@@ -1,2 +0,0 @@
1
- export declare const locusVmeBaseAbi: any[];
2
- export default locusVmeBaseAbi;