Skip to content

Commit

Permalink
yarn dist and version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrichina committed Aug 29, 2019
1 parent ce23775 commit 09127f9
Show file tree
Hide file tree
Showing 72 changed files with 409 additions and 375 deletions.
36 changes: 18 additions & 18 deletions dist/nearlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ function sleep(millis) {
return new Promise(resolve => setTimeout(resolve, millis));
}
class Account {
get ready() {
return this._ready || (this._ready = Promise.resolve(this.fetchState()));
}
constructor(connection, accountId) {
this.connection = connection;
this.accountId = accountId;
}
get ready() {
return this._ready || (this._ready = Promise.resolve(this.fetchState()));
}
async fetchState() {
this._state = await this.connection.provider.query(`account/${this.accountId}`, '');
try {
Expand Down Expand Up @@ -76,7 +76,7 @@ class Account {
if (this._accessKey === null) {
throw new Error(`Can not sign transactions, initialize account with available public key in Signer.`);
}
let status = await this.connection.provider.status();
const status = await this.connection.provider.status();
const [txHash, signedTx] = await transaction_1.signTransaction(receiverId, ++this._accessKey.nonce, actions, serialize_1.base_decode(status.sync_info.latest_block_hash), this.connection.signer, this.accountId, this.connection.networkId);
let result;
try {
Expand Down Expand Up @@ -411,8 +411,8 @@ class InMemoryKeyStore extends keystore_1.KeyStore {
const result = new Array();
Object.keys(this.keys).forEach((key) => {
const parts = key.split(':');
if (parts[1] === networkId) {
result.push(parts[0]);
if (parts[parts.length - 1] === networkId) {
result.push(parts.slice(0, parts.length - 1).join(':'));
}
});
return result;
Expand Down Expand Up @@ -1035,16 +1035,16 @@ var KeyType;
(function (KeyType) {
KeyType[KeyType["ED25519"] = 0] = "ED25519";
})(KeyType = exports.KeyType || (exports.KeyType = {}));
function key_type_to_str(key_type) {
switch (key_type) {
case KeyType.ED25519: return 'ED25519';
default: throw new Error(`Unknown key type ${key_type}`);
function key_type_to_str(keyType) {
switch (keyType) {
case KeyType.ED25519: return 'ed25519';
default: throw new Error(`Unknown key type ${keyType}`);
}
}
function str_to_key_type(key_type) {
switch (key_type.toUpperCase()) {
case 'ED25519': return KeyType.ED25519;
default: throw new Error(`Unknown key type ${key_type}`);
function str_to_key_type(keyType) {
switch (keyType.toLowerCase()) {
case 'ed25519': return KeyType.ED25519;
default: throw new Error(`Unknown key type ${keyType}`);
}
}
/**
Expand All @@ -1063,10 +1063,10 @@ class PublicKey {
}
static fromString(encodedKey) {
const parts = encodedKey.split(':');
if (parts.length == 1) {
if (parts.length === 1) {
return new PublicKey(KeyType.ED25519, serialize_1.base_decode(parts[0]));
}
else if (parts.length == 2) {
else if (parts.length === 2) {
return new PublicKey(str_to_key_type(parts[0]), serialize_1.base_decode(parts[1]));
}
else {
Expand All @@ -1087,10 +1087,10 @@ class KeyPair {
}
static fromString(encodedKey) {
const parts = encodedKey.split(':');
if (parts.length == 1) {
if (parts.length === 1) {
return new KeyPairEd25519(parts[0]);
}
else if (parts.length == 2) {
else if (parts.length === 2) {
switch (parts[0].toUpperCase()) {
case 'ED25519': return new KeyPairEd25519(parts[1]);
default: throw new Error(`Unknown curve: ${parts[0]}`);
Expand Down
6 changes: 3 additions & 3 deletions dist/nearlib.min.js

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions docs/classes/_account_.account.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/classes/_account_creator_.accountcreator.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions docs/classes/_account_creator_.localaccountcreator.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions docs/classes/_account_creator_.urlaccountcreator.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 09127f9

Please sign in to comment.