@tatumio/egld 2.0.1-alpha.374 → 2.0.1-alpha.376

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@tatumio/egld",
3
- "version": "2.0.1-alpha.374",
3
+ "version": "2.0.1-alpha.376",
4
4
  "license": "MIT",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
7
7
  "dependencies": {
8
- "@tatumio/api-client": "2.0.1-alpha.374",
8
+ "@tatumio/api-client": "2.0.1-alpha.376",
9
9
  "axios": "^0.26.0",
10
10
  "form-data": "^4.0.0",
11
- "@tatumio/shared-testing-common": "2.0.1-alpha.374",
12
- "@tatumio/shared-core": "2.0.1-alpha.374",
13
- "@tatumio/shared-abstract-sdk": "2.0.1-alpha.374",
11
+ "@tatumio/shared-testing-common": "2.0.1-alpha.376",
12
+ "@tatumio/shared-core": "2.0.1-alpha.376",
13
+ "@tatumio/shared-abstract-sdk": "2.0.1-alpha.376",
14
14
  "bignumber.js": "^9.0.2",
15
15
  "lodash": "^4.17.21",
16
- "@tatumio/shared-blockchain-abstract": "2.0.1-alpha.374",
16
+ "@tatumio/shared-blockchain-abstract": "2.0.1-alpha.376",
17
17
  "ed25519-hd-key": "^1.2.0",
18
18
  "web3-core": "^1.7.4",
19
19
  "@elrondnetwork/erdjs": "^9.2.4",
@@ -7,11 +7,11 @@ const api_client_1 = require("@tatumio/api-client");
7
7
  const egld_record_1 = require("./services/egld.record");
8
8
  const egld_wallet_1 = require("./services/egld.wallet");
9
9
  const egld_tx_1 = require("./services/egld.tx");
10
- const egld_offchain_1 = require("./services/egld.offchain");
10
+ const egld_virtualAccount_1 = require("./services/egld.virtualAccount");
11
11
  const egld_kms_1 = require("./services/egld.kms");
12
12
  const blockchain = shared_core_1.Blockchain.EGLD;
13
13
  const TatumEgldSDK = (args) => {
14
- return Object.assign(Object.assign({}, (0, shared_blockchain_abstract_1.abstractBlockchainSdk)(Object.assign(Object.assign({}, args), { blockchain }))), { record: (0, egld_record_1.egldRecord)(), wallet: (0, egld_wallet_1.egldWallet)(), transaction: (0, egld_tx_1.egldTransactionService)(), virtualAccount: (0, egld_offchain_1.egldOffchainService)({ blockchain }), kms: (0, egld_kms_1.egldKmsService)({ blockchain }), blockchain: {
14
+ return Object.assign(Object.assign({}, (0, shared_blockchain_abstract_1.abstractBlockchainSdk)(Object.assign(Object.assign({}, args), { blockchain }))), { record: (0, egld_record_1.egldRecord)(), wallet: (0, egld_wallet_1.egldWallet)(), transaction: (0, egld_tx_1.egldTransactionService)(), virtualAccount: (0, egld_virtualAccount_1.egldVirtualAccountService)({ blockchain }), kms: (0, egld_kms_1.egldKmsService)({ blockchain }), blockchain: {
15
15
  broadcast: api_client_1.ElrondService.egldBroadcast,
16
16
  getBlock: api_client_1.ElrondService.egldGetBlock,
17
17
  getCurrentBlock: api_client_1.ElrondService.eGldGetCurrentBlock,
@@ -1 +1 @@
1
- {"version":3,"file":"egld.sdk.js","sourceRoot":"","sources":["../../../../../../packages/blockchain/egld/src/lib/egld.sdk.ts"],"names":[],"mappings":";;;AAAA,sDAAiD;AAEjD,oFAA2E;AAC3E,oDAAmD;AACnD,wDAAmD;AACnD,wDAAmD;AACnD,gDAA2D;AAC3D,4DAA8D;AAC9D,kDAAoD;AAEpD,MAAM,UAAU,GAAG,wBAAU,CAAC,IAAI,CAAA;AAE3B,MAAM,YAAY,GAAG,CAAC,IAAkB,EAAE,EAAE;IACjD,uCACK,IAAA,kDAAqB,kCAAM,IAAI,KAAE,UAAU,IAAG,KACjD,MAAM,EAAE,IAAA,wBAAU,GAAE,EACpB,MAAM,EAAE,IAAA,wBAAU,GAAE,EACpB,WAAW,EAAE,IAAA,gCAAsB,GAAE,EACrC,cAAc,EAAE,IAAA,mCAAmB,EAAC,EAAE,UAAU,EAAE,CAAC,EACnD,GAAG,EAAE,IAAA,yBAAc,EAAC,EAAE,UAAU,EAAE,CAAC,EACnC,UAAU,EAAE;YACV,SAAS,EAAE,0BAAa,CAAC,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;YACpC,eAAe,EAAE,0BAAa,CAAC,mBAAmB;YAClD,cAAc,EAAE,0BAAa,CAAC,kBAAkB;YAChD,eAAe,EAAE,0BAAa,CAAC,mBAAmB;YAClD,2BAA2B,EAAE,0BAAa,CAAC,6BAA6B;YACxE,UAAU,EAAE,0BAAa,CAAC,cAAc;YACxC,cAAc,EAAE,0BAAa,CAAC,kBAAkB;YAChD,8BAA8B,EAAE,0BAAa,CAAC,yBAAyB;YACvE,oCAAoC,EAAE,0BAAa,CAAC,uBAAuB;SAC5E,EACD,IAAI,EAAE;YACJ,IAAI,EAAE,0BAAa,CAAC,YAAY;YAChC,GAAG,EAAE,0BAAa,CAAC,WAAW;SAC/B,IACF;AACH,CAAC,CAAA;AAzBY,QAAA,YAAY,gBAyBxB"}
@@ -1,6 +1,6 @@
1
1
  import { OffchainTransactionResult, OffchainTransactionSignatureResult, TransferEth, TransferEthKMS, TransferEthMnemonic } from '@tatumio/api-client';
2
2
  import { Blockchain } from '@tatumio/shared-core';
3
- export declare const egldOffchainService: (args: {
3
+ export declare const egldVirtualAccountService: (args: {
4
4
  blockchain: Blockchain;
5
5
  }) => {
6
6
  /**
@@ -9,7 +9,7 @@ export declare const egldOffchainService: (args: {
9
9
  * @param body content of the transaction to broadcast
10
10
  * @returns transaction id of the transaction in the blockchain or id of the withdrawal, if it was not cancelled automatically
11
11
  */
12
- send: (body: EgldOffchain) => Promise<SendOffchainResponse>;
12
+ send: (body: EgldVirtualAccountTx) => Promise<SendVirtualAccountTxResponse>;
13
13
  depositAddress: {
14
14
  checkExists: (address: string, index?: number) => Promise<any>;
15
15
  create: any;
@@ -26,9 +26,9 @@ export declare const egldOffchainService: (args: {
26
26
  };
27
27
  storeTokenAddress: any;
28
28
  };
29
- declare type EgldOffchain = TransferEth | TransferEthMnemonic | TransferEthKMS;
30
- declare type SendOffchainResponse = OffchainTransactionResult | OffchainTransactionSignatureResult | {
29
+ declare type EgldVirtualAccountTx = TransferEth | TransferEthMnemonic | TransferEthKMS;
30
+ declare type SendVirtualAccountTxResponse = OffchainTransactionResult | OffchainTransactionSignatureResult | {
31
31
  id?: string;
32
32
  } | void;
33
- export declare const send: (body: EgldOffchain) => Promise<SendOffchainResponse>;
33
+ export declare const send: (body: EgldVirtualAccountTx) => Promise<SendVirtualAccountTxResponse>;
34
34
  export {};
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.send = exports.egldOffchainService = void 0;
3
+ exports.send = exports.egldVirtualAccountService = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const api_client_1 = require("@tatumio/api-client");
6
6
  const shared_blockchain_abstract_1 = require("@tatumio/shared-blockchain-abstract");
7
7
  const bignumber_js_1 = tslib_1.__importDefault(require("bignumber.js"));
8
8
  const egld_tx_1 = require("./egld.tx");
9
- const egldOffchainService = (args) => {
9
+ const egldVirtualAccountService = (args) => {
10
10
  return Object.assign(Object.assign({}, (0, shared_blockchain_abstract_1.abstractBlockchainVirtualAccount)(args)), {
11
11
  /**
12
12
  * Send EGLD transaction from Tatum Ledger account to the blockchain. This method broadcasts signed transaction to the blockchain.
@@ -16,10 +16,10 @@ const egldOffchainService = (args) => {
16
16
  */
17
17
  send: exports.send });
18
18
  };
19
- exports.egldOffchainService = egldOffchainService;
19
+ exports.egldVirtualAccountService = egldVirtualAccountService;
20
20
  const send = (body) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
21
21
  if ('signatureId' in body) {
22
- return yield api_client_1.ApiServices.offChain.blockchain.egldTransfer(body);
22
+ return yield api_client_1.ApiServices.virtualAccount.blockchain.egldTransfer(body);
23
23
  }
24
24
  const { gasLimit, gasPrice } = body, withdrawal = tslib_1.__rest(body, ["gasLimit", "gasPrice"]);
25
25
  let fromPriv;
@@ -42,9 +42,9 @@ const send = (body) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
42
42
  to: body.address,
43
43
  from: '',
44
44
  });
45
- const { id } = yield api_client_1.ApiServices.offChain.withdrawal.storeWithdrawal(Object.assign(Object.assign({}, withdrawal), { fee: new bignumber_js_1.default(fee.gasLimit).multipliedBy(fee.gasPrice).toString() }));
45
+ const { id } = yield api_client_1.ApiServices.virtualAccount.withdrawal.storeWithdrawal(Object.assign(Object.assign({}, withdrawal), { fee: new bignumber_js_1.default(fee.gasLimit).multipliedBy(fee.gasPrice).toString() }));
46
46
  try {
47
- return Object.assign(Object.assign({}, (yield api_client_1.ApiServices.offChain.withdrawal.broadcastBlockchainTransaction({
47
+ return Object.assign(Object.assign({}, (yield api_client_1.ApiServices.virtualAccount.withdrawal.broadcastBlockchainTransaction({
48
48
  txData,
49
49
  withdrawalId: id,
50
50
  currency: api_client_1.Currency.EGLD,
@@ -52,7 +52,7 @@ const send = (body) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
52
52
  }
53
53
  catch (e) {
54
54
  try {
55
- return yield api_client_1.ApiServices.offChain.withdrawal.cancelInProgressWithdrawal(id);
55
+ return yield api_client_1.ApiServices.virtualAccount.withdrawal.cancelInProgressWithdrawal(id);
56
56
  }
57
57
  catch (e1) {
58
58
  return { id };
@@ -60,4 +60,4 @@ const send = (body) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
60
60
  }
61
61
  });
62
62
  exports.send = send;
63
- //# sourceMappingURL=egld.offchain.js.map
63
+ //# sourceMappingURL=egld.virtualAccount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"egld.virtualAccount.js","sourceRoot":"","sources":["../../../../../../../packages/blockchain/egld/src/lib/services/egld.virtualAccount.ts"],"names":[],"mappings":";;;;AAAA,oDAQ4B;AAC5B,oFAAsF;AAEtF,wEAAoC;AACpC,uCAAoD;AAE7C,MAAM,yBAAyB,GAAG,CAAC,IAAgC,EAAE,EAAE;IAC5E,uCACK,IAAA,6DAAgC,EAAC,IAAI,CAAC;QACzC;;;;;WAKG;QACH,IAAI,EAAJ,YAAI,IACL;AACH,CAAC,CAAA;AAXY,QAAA,yBAAyB,6BAWrC;AASM,MAA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7E,MAAM;YACN,YAAY,EAAE,EAAE;YAChB,QAAQ,EAAE,qBAAQ,CAAC,IAAI;SACxB,CAAC,CAAC,KACH,EAAE,IACH;KACF;IAAC,OAAO,CAAC,EAAE;QACV,IAAI;YACF,OAAO,MAAM,wBAAW,CAAC,cAAc,CAAC,UAAU,CAAC,0BAA0B,CAAC,EAAG,CAAC,CAAA;SACnF;QAAC,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,EAAE,EAAE,CAAA;SACd;KACF;AACH,CAAC,CAAA,CAAA;AAjDY,QAAA,IAAI,QAiDhB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"egld.offchain.js","sourceRoot":"","sources":["../../../../../../../packages/blockchain/egld/src/lib/services/egld.offchain.ts"],"names":[],"mappings":";;;;AAAA,oDAQ4B;AAC5B,oFAAsF;AAEtF,wEAAoC;AACpC,uCAAoD;AAE7C,MAAM,mBAAmB,GAAG,CAAC,IAAgC,EAAE,EAAE;IACtE,uCACK,IAAA,6DAAgC,EAAC,IAAI,CAAC;QACzC;;;;;WAKG;QACH,IAAI,EAAJ,YAAI,IACL;AACH,CAAC,CAAA;AAXY,QAAA,mBAAmB,uBAW/B;AASM,MAAM,IAAI,GAAG,CAAO,IAAkB,EAAiC,EAAE;IAC9E,IAAI,aAAa,IAAI,IAAI,EAAE;QACzB,OAAO,MAAM,wBAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC,IAAsB,CAAC,CAAA;KAClF;IAED,MAAM,EAAE,QAAQ,EAAE,QAAQ,KAAoB,IAAI,EAAnB,UAAU,kBAAK,IAAI,EAA5C,wBAAqC,CAAO,CAAA;IAClD,IAAI,QAAgB,CAAA;IAEpB,IAAI,UAAU,IAAI,IAAI,EAAE;QACtB,QAAQ,GAAG,CAAC,MAAM,wBAAW,CAAC,UAAU,CAAC,IAAI,CAAC,6BAA6B,CAAC;YAC1E,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK,EAAE,IAAI,CAAC,KA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