@cityofzion/blockchain-service 1.15.1 → 1.15.3

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.
@@ -1,6 +1,7 @@
1
- import { Account, BlockchainService, BSCalculableFee, BSClaimable, BSWithExplorerService, BSWithLedger, BSWithNameService, BSWithNft, UntilIndexRecord } from './interfaces';
1
+ import { Account, BlockchainService, BSCalculableFee, BSClaimable, BSMigrationNeo3, BSWithExplorerService, BSWithLedger, BSWithNameService, BSWithNft, UntilIndexRecord } from './interfaces';
2
2
  export declare function hasNameService<BSName extends string = string>(service: BlockchainService<BSName>): service is BlockchainService<BSName> & BSWithNameService;
3
3
  export declare function isClaimable<BSName extends string = string>(service: BlockchainService<BSName>): service is BlockchainService<BSName> & BSClaimable<BSName>;
4
+ export declare function hasMigrationNeo3<BSName extends string = string>(service: BlockchainService<BSName>): service is BlockchainService<BSName> & BSMigrationNeo3<BSName>;
4
5
  export declare function isCalculableFee<BSName extends string = string>(service: BlockchainService<BSName>): service is BlockchainService<BSName> & BSCalculableFee<BSName>;
5
6
  export declare function hasNft<BSName extends string = string>(service: BlockchainService<BSName>): service is BlockchainService<BSName> & BSWithNft;
6
7
  export declare function hasExplorerService<BSName extends string = string>(service: BlockchainService<BSName>): service is BlockchainService<BSName> & BSWithExplorerService;
package/dist/functions.js CHANGED
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.formatNumber = exports.countDecimals = exports.denormalizeHash = exports.normalizeHash = exports.generateAccountForBlockchainService = exports.generateAccount = exports.fetchAccounts = exports.waitForAccountTransaction = exports.waitForTransaction = exports.wait = exports.hasLedger = exports.hasExplorerService = exports.hasNft = exports.isCalculableFee = exports.isClaimable = exports.hasNameService = void 0;
12
+ exports.formatNumber = exports.countDecimals = exports.denormalizeHash = exports.normalizeHash = exports.generateAccountForBlockchainService = exports.generateAccount = exports.fetchAccounts = exports.waitForAccountTransaction = exports.waitForTransaction = exports.wait = exports.hasLedger = exports.hasExplorerService = exports.hasNft = exports.isCalculableFee = exports.hasMigrationNeo3 = exports.isClaimable = exports.hasNameService = void 0;
13
13
  function hasNameService(service) {
14
14
  return 'resolveNameServiceDomain' in service && 'validateNameServiceDomainFormat' in service;
15
15
  }
@@ -18,6 +18,10 @@ function isClaimable(service) {
18
18
  return 'claim' in service && 'claimToken' in service && 'getUnclaimed' in service.blockchainDataService;
19
19
  }
20
20
  exports.isClaimable = isClaimable;
21
+ function hasMigrationNeo3(service) {
22
+ return 'migrateToNeo3' in service && 'calculateToMigrateToNeo3Values' in service;
23
+ }
24
+ exports.hasMigrationNeo3 = hasMigrationNeo3;
21
25
  function isCalculableFee(service) {
22
26
  return 'calculateTransferFee' in service;
23
27
  }
@@ -61,6 +61,23 @@ export interface BSClaimable<BSName extends string = string> {
61
61
  blockchainDataService: BlockchainDataService & BDSClaimable;
62
62
  claim(account: Account<BSName>): Promise<string>;
63
63
  }
64
+ export type MigrateToNeo3Params<BSName extends string = string> = {
65
+ account: Account<BSName>;
66
+ address: string;
67
+ };
68
+ export type CalculateToMigrateToNeo3ValuesParams<BSName extends string = string> = {
69
+ account: Account<BSName>;
70
+ };
71
+ export type CalculateToMigrateToNeo3ValuesResponse = {
72
+ gasMigrationTotalFees?: string;
73
+ neoMigrationTotalFees?: string;
74
+ gasMigrationAmount?: string;
75
+ neoMigrationAmount?: string;
76
+ };
77
+ export interface BSMigrationNeo3<BSName extends string = string> {
78
+ migrateToNeo3(params: MigrateToNeo3Params<BSName>): Promise<string>;
79
+ calculateToMigrateToNeo3Values(params: CalculateToMigrateToNeo3ValuesParams<BSName>): Promise<CalculateToMigrateToNeo3ValuesResponse>;
80
+ }
64
81
  export interface BSWithNameService {
65
82
  resolveNameServiceDomain(domainName: string): Promise<string>;
66
83
  validateNameServiceDomainFormat(domainName: string): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/blockchain-service",
3
- "version": "1.15.1",
3
+ "version": "1.15.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": "https://github.com/CityOfZion/blockchain-services",