entropyxyz / sdk

Official JavaScript SDK for Entropy blockchain.
GNU Affero General Public License v3.0
8 stars 0 forks source link

[NayNay] Improving build system for SDK #333

Closed rh0delta closed 5 months ago

rh0delta commented 5 months ago

Description

Users were unable to import the individual methods from the subfolders within the package dist. This update provides the ability to perform these individual imports, rather than having to import in the full package.

Changes

GitHub Issue or Linear Task

How Has This Been Tested?

  1. created new npm project
  2. linked @entropyxyz/sdk to new project
  3. imported in new package and logged contents Code: import Entropy from '@entropyxyz/sdk'; import { getWallet } from '@entropyxyz/sdk/keys'; import * as crypto from '@entropyxyz/sdk/cypto-utils'; import * as utils from '@entropyxyz/sdk/gen-utils'; console.log(Entropy); console.log(getWallet); console.log(crypto); console.log(utils); Result: [class Entropy] [AsyncFunction (anonymous)] [Module: null prototype] { crypto: {}, cryptoIsLoaded: Promise { <pending> }, loadCryptoLib: [AsyncFunction: loadCryptoLib] } [Module: null prototype] { buf2hex: [Function: buf2hex], hex2buf: [Function: hex2buf], isValidSubstrateAddress: [Function: isValidSubstrateAddress], sendHttpPost: [AsyncFunction: sendHttpPost], stripHexPrefix: [Function: stripHexPrefix], typeofthing: [Function: typeofthing] }