From 35a03694a46679dfc4a12916a1f0242eca0bb0bf Mon Sep 17 00:00:00 2001 From: Jane Date: Wed, 18 Dec 2019 12:40:26 -0500 Subject: [PATCH 1/2] Update constants for account balance to use yoctonear --- dist/nearlib.js | 103 ++++++++++-------- dist/nearlib.min.js | 4 +- docs/nearlib/classes/_account_.account.md | 65 +++++++---- .../_account_creator_.accountcreator.md | 2 +- .../_account_creator_.localaccountcreator.md | 8 +- .../_account_creator_.urlaccountcreator.md | 8 +- .../classes/_connection_.connection.md | 10 +- docs/nearlib/classes/_contract_.contract.md | 6 +- ..._key_store_.browserlocalstoragekeystore.md | 22 ++-- ...s_in_memory_key_store_.inmemorykeystore.md | 16 +-- .../classes/_key_stores_keystore_.keystore.md | 12 +- ...y_stores_merge_key_store_.mergekeystore.md | 16 +-- ...keystore_.unencryptedfilesystemkeystore.md | 18 +-- docs/nearlib/classes/_near_.near.md | 16 +-- ...ders_json_rpc_provider_.jsonrpcprovider.md | 20 ++-- ...providers_json_rpc_provider_.typederror.md | 4 +- .../classes/_providers_provider_.provider.md | 14 +-- .../classes/_signer_.inmemorysigner.md | 12 +- docs/nearlib/classes/_signer_.signer.md | 8 +- .../classes/_transaction_.accesskey.md | 6 +- .../_transaction_.accesskeypermission.md | 8 +- docs/nearlib/classes/_transaction_.action.md | 20 ++-- docs/nearlib/classes/_transaction_.addkey.md | 6 +- .../classes/_transaction_.createaccount.md | 2 +- .../classes/_transaction_.deleteaccount.md | 4 +- .../classes/_transaction_.deletekey.md | 4 +- .../classes/_transaction_.deploycontract.md | 4 +- .../_transaction_.fullaccesspermission.md | 2 +- .../classes/_transaction_.functioncall.md | 10 +- .../_transaction_.functioncallpermission.md | 8 +- docs/nearlib/classes/_transaction_.iaction.md | 2 +- .../classes/_transaction_.signature.md | 16 ++- .../_transaction_.signedtransaction.md | 25 ++++- docs/nearlib/classes/_transaction_.stake.md | 6 +- .../classes/_transaction_.transaction.md | 45 ++++++-- .../nearlib/classes/_transaction_.transfer.md | 4 +- .../classes/_utils_enums_.assignable.md | 4 +- docs/nearlib/classes/_utils_enums_.enum.md | 4 +- .../_utils_errors_.argumenttypeerror.md | 82 ++++++++++++++ .../_utils_errors_.positionalargserror.md | 74 +++++++++++++ .../classes/_utils_key_pair_.keypair.md | 12 +- .../_utils_key_pair_.keypaired25519.md | 18 +-- .../classes/_utils_key_pair_.publickey.md | 12 +- .../classes/_utils_serialize_.binaryreader.md | 22 ++-- .../classes/_utils_serialize_.binarywriter.md | 26 ++--- .../classes/_utils_serialize_.borsherror.md | 8 +- .../classes/_wallet_account_.walletaccount.md | 24 ++-- ...roviders_provider_.executionstatusbasic.md | 6 +- ...ers_provider_.finalexecutionstatusbasic.md | 6 +- ..._provider_.legacyfinaltransactionstatus.md | 8 +- ...iders_provider_.legacytransactionstatus.md | 6 +- .../nearlib/enums/_utils_key_pair_.keytype.md | 2 +- docs/nearlib/globals.md | 1 + .../interfaces/_account_.accountstate.md | 8 +- ...ypted_file_system_keystore_.accountinfo.md | 4 +- .../_providers_provider_.blockheader.md | 18 +-- .../_providers_provider_.blockresult.md | 4 +- .../_providers_provider_.chunkheader.md | 36 +++--- .../_providers_provider_.chunkresult.md | 6 +- .../_providers_provider_.executionerror.md | 4 +- .../_providers_provider_.executionoutcome.md | 8 +- ...viders_provider_.executionoutcomewithid.md | 4 +- .../_providers_provider_.executionstatus.md | 6 +- ...oviders_provider_.finalexecutionoutcome.md | 6 +- ...roviders_provider_.finalexecutionstatus.md | 4 +- ..._provider_.legacyfinaltransactionresult.md | 4 +- ...roviders_provider_.legacytransactionlog.md | 4 +- ...iders_provider_.legacytransactionresult.md | 8 +- .../_providers_provider_.nodestatusresult.md | 17 ++- .../_providers_provider_.syncinfo.md | 10 +- .../_providers_provider_.totalweight.md | 2 +- .../_providers_provider_.transaction.md | 8 +- .../_providers_provider_.version.md | 32 ++++++ .../interfaces/_utils_key_pair_.signature.md | 4 +- .../interfaces/_utils_network_.network.md | 6 +- .../interfaces/_utils_web_.connectioninfo.md | 12 +- docs/nearlib/modules/_account_.md | 10 +- docs/nearlib/modules/_connection_.md | 4 +- docs/nearlib/modules/_contract_.md | 20 ++++ ...stores_browser_local_storage_key_store_.md | 2 +- ...tores_unencrypted_file_system_keystore_.md | 20 ++-- docs/nearlib/modules/_near_.md | 2 +- .../modules/_providers_json_rpc_provider_.md | 2 +- docs/nearlib/modules/_providers_provider_.md | 23 ++-- docs/nearlib/modules/_transaction_.md | 46 ++++++-- docs/nearlib/modules/_utils_errors_.md | 12 ++ docs/nearlib/modules/_utils_format_.md | 83 ++++++++++++-- docs/nearlib/modules/_utils_key_pair_.md | 6 +- docs/nearlib/modules/_utils_serialize_.md | 35 +++--- docs/nearlib/modules/_utils_web_.md | 4 +- docs/nearlib/modules/_wallet_account_.md | 6 +- lib/utils/format.d.ts | 2 +- lib/utils/format.js | 2 +- src.ts/utils/format.ts | 2 +- test/utils/format.test.js | 38 +++---- website/sidebars.json | 7 ++ 96 files changed, 897 insertions(+), 495 deletions(-) create mode 100644 docs/nearlib/classes/_utils_errors_.argumenttypeerror.md create mode 100644 docs/nearlib/classes/_utils_errors_.positionalargserror.md create mode 100644 docs/nearlib/interfaces/_providers_provider_.version.md create mode 100644 docs/nearlib/modules/_utils_errors_.md diff --git a/dist/nearlib.js b/dist/nearlib.js index 9e5a03931e..81143a7b89 100644 --- a/dist/nearlib.js +++ b/dist/nearlib.js @@ -1258,39 +1258,48 @@ exports.ArgumentTypeError = ArgumentTypeError; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const BN = require('bn.js'); -// Exponent for calculating how many units of account balance are in one near. -const NEAR_NOMINATION_EXP = 18; -// actual number of units of account balance in one near. -const NEAR_NOMINATION = new BN('10', 10).pow(new BN(NEAR_NOMINATION_EXP, 10)); /** - * Convert account balance value from internal units (currently yoctoNEAR) to NEAR. - * @param balance + * Exponent for calculating how many indivisible units are there in one NEAR. See {@link NEAR_NOMINATION}. */ -function formatNearAmount(balance, digits) { - balance = trimLeadingZeroes(balance); - const amtBN = new BN(balance, 10); - let wholeBN = amtBN.div(NEAR_NOMINATION); - let fractionString = amtBN.mod(NEAR_NOMINATION).toString(10, NEAR_NOMINATION_EXP); - // truncate fraction if needed - if (digits && fractionString.length > digits) { - if (fractionString[digits] >= '5') { - const oneBN = new BN('1', 10); - fractionString = new BN(fractionString.substring(0, digits), 10).add(oneBN).toString(10).padStart(digits, '0'); - if (fractionString.length > digits) { - wholeBN = wholeBN.add(oneBN); - fractionString = fractionString.substring(1, fractionString.length); - } - } - else { - fractionString = fractionString.substring(0, digits); +exports.NEAR_NOMINATION_EXP = 24; +/** + * Number of indivisible units in one NEAR. Derived from {@link NEAR_NOMINATION_EXP}. + */ +exports.NEAR_NOMINATION = new BN('10', 10).pow(new BN(exports.NEAR_NOMINATION_EXP, 10)); +// Pre-calculate offests used for rounding to different number of digits +const ROUNDING_OFFSETS = []; +const BN10 = new BN(10); +for (let i = 0, offset = new BN(5); i < exports.NEAR_NOMINATION_EXP; i++, offset = offset.mul(BN10)) { + ROUNDING_OFFSETS[i] = offset; +} +/** + * Convert account balance value from internal indivisible units to NEAR. 1 NEAR is defined by {@link NEAR_NOMINATION}. + * Effectively this divides given amount by {@link NEAR_NOMINATION}. + * + * @param balance decimal string representing balance in smallest non-divisible NEAR units (as specified by {@link NEAR_NOMINATION}) + * @param fracDigits number of fractional digits to preserve in formatted string. Balance is rounded to match given number of digits. + */ +function formatNearAmount(balance, fracDigits = exports.NEAR_NOMINATION_EXP) { + const balanceBN = new BN(balance, 10); + if (fracDigits !== exports.NEAR_NOMINATION_EXP) { + // Adjust balance for rounding at given number of digits + const roundingExp = exports.NEAR_NOMINATION_EXP - fracDigits - 1; + if (roundingExp > 0) { + balanceBN.iadd(ROUNDING_OFFSETS[roundingExp]); } } - return trimTrailingZeroes(`${formatWithCommas(wholeBN.toString(10, 0))}.${fractionString}`); + balance = balanceBN.toString(); + const wholeStr = balance.substring(0, balance.length - exports.NEAR_NOMINATION_EXP) || '0'; + const fractionStr = balance.substring(balance.length - exports.NEAR_NOMINATION_EXP) + .padStart(exports.NEAR_NOMINATION_EXP, '0').substring(0, fracDigits); + return trimTrailingZeroes(`${formatWithCommas(wholeStr)}.${fractionStr}`); } exports.formatNearAmount = formatNearAmount; /** - * Convert human readable near amount to internal account balance units. - * @param amt + * Convert human readable NEAR amount to internal indivisible units. + * Effectively this multiplies given amount by {@link NEAR_NOMINATION}. + * + * @param amt decimal string (potentially fractional) denominated in NEAR. */ function parseNearAmount(amt) { if (!amt) { @@ -1299,29 +1308,18 @@ function parseNearAmount(amt) { amt = amt.trim(); const split = amt.split('.'); if (split.length === 1) { - return `${amt.padEnd(NEAR_NOMINATION_EXP + 1, '0')}`; + return `${amt.padEnd(exports.NEAR_NOMINATION_EXP + 1, '0')}`; } - if (split.length > 2 || split[1].length > NEAR_NOMINATION_EXP) { + if (split.length > 2 || split[1].length > exports.NEAR_NOMINATION_EXP) { throw new Error(`Cannot parse '${amt}' as NEAR amount`); } - const wholePart = new BN(split[0], 10).mul(NEAR_NOMINATION); - const fractionPart = new BN(split[1].padEnd(NEAR_NOMINATION_EXP, '0'), 10); + const wholePart = new BN(split[0], 10).mul(exports.NEAR_NOMINATION); + const fractionPart = new BN(split[1].padEnd(exports.NEAR_NOMINATION_EXP, '0'), 10); return `${wholePart.add(fractionPart).toString(10, 0)}`; } exports.parseNearAmount = parseNearAmount; -function trimLeadingZeroes(value) { - return value.replace(/^0+/, ''); -} function trimTrailingZeroes(value) { - for (let i = value.length - 1; i >= 0; i--) { - if (value[i] === '.') { - return value.substring(0, i); - } - else if (value[i] !== '0') { - return value.substring(0, i + 1); - } - } - return value; + return value.replace(/\.?0*$/, ''); } function formatWithCommas(value) { const pattern = /(-?\d+)(\d{3})/; @@ -6795,7 +6793,7 @@ function hexSlice (buf, start, end) { var out = '' for (var i = start; i < end; ++i) { - out += toHex(buf[i]) + out += hexSliceLookupTable[buf[i]] } return out } @@ -7381,11 +7379,6 @@ function base64clean (str) { return str } -function toHex (n) { - if (n < 16) return '0' + n.toString(16) - return n.toString(16) -} - function utf8ToBytes (string, units) { units = units || Infinity var codePoint @@ -7516,6 +7509,20 @@ function numberIsNaN (obj) { return obj !== obj // eslint-disable-line no-self-compare } +// Create lookup table for `toString('hex')` +// See: https://github.com/feross/buffer/issues/219 +var hexSliceLookupTable = (function () { + var alphabet = '0123456789abcdef' + var table = new Array(256) + for (var i = 0; i < 16; ++i) { + var i16 = i * 16 + for (var j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j] + } + } + return table +})() + }).call(this,require("buffer").Buffer) },{"base64-js":29,"buffer":34,"ieee754":51}],35:[function(require,module,exports){ require(".").check("es5"); diff --git a/dist/nearlib.min.js b/dist/nearlib.min.js index 94d1b7be8b..3eac3ed8d9 100644 --- a/dist/nearlib.min.js +++ b/dist/nearlib.min.js @@ -67,7 +67,7 @@ require("error-polyfill"),window.nearlib=require("./lib/index"),window.Buffer=Bu "use strict";Object.defineProperty(exports,"__esModule",{value:!0});class PositionalArgsError extends Error{constructor(){super("Contract method calls expect named arguments wrapped in object, e.g. { argName1: argValue1, argName2: argValue2 }")}}exports.PositionalArgsError=PositionalArgsError;class ArgumentTypeError extends Error{constructor(r,e,t){super(`Expected ${e} for '${r}' argument, but got '${JSON.stringify(t)}'`)}}exports.ArgumentTypeError=ArgumentTypeError; },{}],21:[function(require,module,exports){ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const BN=require("bn.js"),NEAR_NOMINATION_EXP=18,NEAR_NOMINATION=new BN("10",10).pow(new BN(NEAR_NOMINATION_EXP,10));function formatNearAmount(t,r){t=trimLeadingZeroes(t);const e=new BN(t,10);let n=e.div(NEAR_NOMINATION),N=e.mod(NEAR_NOMINATION).toString(10,NEAR_NOMINATION_EXP);if(r&&N.length>r)if(N[r]>="5"){const t=new BN("1",10);(N=new BN(N.substring(0,r),10).add(t).toString(10).padStart(r,"0")).length>r&&(n=n.add(t),N=N.substring(1,N.length))}else N=N.substring(0,r);return trimTrailingZeroes(`${formatWithCommas(n.toString(10,0))}.${N}`)}function parseNearAmount(t){if(!t)return t;const r=(t=t.trim()).split(".");if(1===r.length)return`${t.padEnd(NEAR_NOMINATION_EXP+1,"0")}`;if(r.length>2||r[1].length>NEAR_NOMINATION_EXP)throw new Error(`Cannot parse '${t}' as NEAR amount`);const e=new BN(r[0],10).mul(NEAR_NOMINATION),n=new BN(r[1].padEnd(NEAR_NOMINATION_EXP,"0"),10);return`${e.add(n).toString(10,0)}`}function trimLeadingZeroes(t){return t.replace(/^0+/,"")}function trimTrailingZeroes(t){for(let r=t.length-1;r>=0;r--){if("."===t[r])return t.substring(0,r);if("0"!==t[r])return t.substring(0,r+1)}return t}function formatWithCommas(t){const r=/(-?\d+)(\d{3})/;for(;r.test(t);)t=t.replace(r,"$1,$2");return t}exports.formatNearAmount=formatNearAmount,exports.parseNearAmount=parseNearAmount; +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const BN=require("bn.js");exports.NEAR_NOMINATION_EXP=24,exports.NEAR_NOMINATION=new BN("10",10).pow(new BN(exports.NEAR_NOMINATION_EXP,10));const ROUNDING_OFFSETS=[],BN10=new BN(10);for(let N=0,t=new BN(5);N0&&r.iadd(ROUNDING_OFFSETS[N])}const e=(N=r.toString()).substring(0,N.length-exports.NEAR_NOMINATION_EXP)||"0",n=N.substring(N.length-exports.NEAR_NOMINATION_EXP).padStart(exports.NEAR_NOMINATION_EXP,"0").substring(0,t);return trimTrailingZeroes(`${formatWithCommas(e)}.${n}`)}function parseNearAmount(N){if(!N)return N;const t=(N=N.trim()).split(".");if(1===t.length)return`${N.padEnd(exports.NEAR_NOMINATION_EXP+1,"0")}`;if(t.length>2||t[1].length>exports.NEAR_NOMINATION_EXP)throw new Error(`Cannot parse '${N}' as NEAR amount`);const r=new BN(t[0],10).mul(exports.NEAR_NOMINATION),e=new BN(t[1].padEnd(exports.NEAR_NOMINATION_EXP,"0"),10);return`${r.add(e).toString(10,0)}`}function trimTrailingZeroes(N){return N.replace(/\.?0*$/,"")}function formatWithCommas(N){const t=/(-?\d+)(\d{3})/;for(;t.test(N);)N=N.replace(t,"$1,$2");return N}exports.formatNearAmount=formatNearAmount,exports.parseNearAmount=parseNearAmount; },{"bn.js":30}],22:[function(require,module,exports){ "use strict";var __importStar=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(null!=r)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e};Object.defineProperty(exports,"__esModule",{value:!0});const key_pair=__importStar(require("./key_pair"));exports.key_pair=key_pair;const network=__importStar(require("./network"));exports.network=network;const serialize=__importStar(require("./serialize"));exports.serialize=serialize;const web=__importStar(require("./web"));exports.web=web;const enums=__importStar(require("./enums"));exports.enums=enums;const format=__importStar(require("./format"));exports.format=format;const key_pair_1=require("./key_pair");exports.PublicKey=key_pair_1.PublicKey,exports.KeyPair=key_pair_1.KeyPair,exports.KeyPairEd25519=key_pair_1.KeyPairEd25519; @@ -112,7 +112,7 @@ var basex=require("base-x"),ALPHABET="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghi },{"base-x":28}],35:[function(require,module,exports){ (function (Buffer){ -"use strict";var base64=require("base64-js"),ieee754=require("ieee754"),customInspectSymbol="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;exports.Buffer=Buffer,exports.SlowBuffer=SlowBuffer,exports.INSPECT_MAX_BYTES=50;var K_MAX_LENGTH=2147483647;function typedArraySupport(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}function createBuffer(e){if(e>K_MAX_LENGTH)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,Buffer.prototype),t}function Buffer(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(e)}return from(e,t,r)}function from(e,t,r){if("string"==typeof e)return fromString(e,t);if(ArrayBuffer.isView(e))return fromArrayLike(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(isInstance(e,ArrayBuffer)||e&&isInstance(e.buffer,ArrayBuffer))return fromArrayBuffer(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return Buffer.from(n,t,r);var f=fromObject(e);if(f)return f;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Buffer.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function assertSize(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function alloc(e,t,r){return assertSize(e),e<=0?createBuffer(e):void 0!==t?"string"==typeof r?createBuffer(e).fill(t,r):createBuffer(e).fill(t):createBuffer(e)}function allocUnsafe(e){return assertSize(e),createBuffer(e<0?0:0|checked(e))}function fromString(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!Buffer.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|byteLength(e,t),n=createBuffer(r),f=n.write(e,t);return f!==r&&(n=n.slice(0,f)),n}function fromArrayLike(e){for(var t=e.length<0?0:0|checked(e.length),r=createBuffer(t),n=0;n=K_MAX_LENGTH)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K_MAX_LENGTH.toString(16)+" bytes");return 0|e}function SlowBuffer(e){return+e!=e&&(e=0),Buffer.alloc(+e)}function byteLength(e,t){if(Buffer.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||isInstance(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var f=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return base64ToBytes(e).length;default:if(f)return n?-1:utf8ToBytes(e).length;t=(""+t).toLowerCase(),f=!0}}function slowToString(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return hexSlice(this,t,r);case"utf8":case"utf-8":return utf8Slice(this,t,r);case"ascii":return asciiSlice(this,t,r);case"latin1":case"binary":return latin1Slice(this,t,r);case"base64":return base64Slice(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function swap(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function bidirectionalIndexOf(e,t,r,n,f){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),numberIsNaN(r=+r)&&(r=f?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(f)return-1;r=e.length-1}else if(r<0){if(!f)return-1;r=0}if("string"==typeof t&&(t=Buffer.from(t,n)),Buffer.isBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,r,n,f);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):arrayIndexOf(e,[t],r,n,f);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,r,n,f){var i,o=1,u=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,u/=2,s/=2,r/=2}function a(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(f){var h=-1;for(i=r;iu&&(r=u-s),i=r;i>=0;i--){for(var c=!0,l=0;lf&&(n=f):n=f;var i=t.length;n>i/2&&(n=i/2);for(var o=0;o239?4:a>223?3:a>191?2:1;if(f+c<=r)switch(c){case 1:a<128&&(h=a);break;case 2:128==(192&(i=e[f+1]))&&(s=(31&a)<<6|63&i)>127&&(h=s);break;case 3:i=e[f+1],o=e[f+2],128==(192&i)&&128==(192&o)&&(s=(15&a)<<12|(63&i)<<6|63&o)>2047&&(s<55296||s>57343)&&(h=s);break;case 4:i=e[f+1],o=e[f+2],u=e[f+3],128==(192&i)&&128==(192&o)&&128==(192&u)&&(s=(15&a)<<18|(63&i)<<12|(63&o)<<6|63&u)>65535&&s<1114112&&(h=s)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),f+=c}return decodeCodePointsArray(n)}exports.kMaxLength=K_MAX_LENGTH,Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport(),Buffer.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(Buffer.prototype,"parent",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.buffer}}),Object.defineProperty(Buffer.prototype,"offset",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),Buffer.poolSize=8192,Buffer.from=function(e,t,r){return from(e,t,r)},Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype),Object.setPrototypeOf(Buffer,Uint8Array),Buffer.alloc=function(e,t,r){return alloc(e,t,r)},Buffer.allocUnsafe=function(e){return allocUnsafe(e)},Buffer.allocUnsafeSlow=function(e){return allocUnsafe(e)},Buffer.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==Buffer.prototype},Buffer.compare=function(e,t){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),isInstance(t,Uint8Array)&&(t=Buffer.from(t,t.offset,t.byteLength)),!Buffer.isBuffer(e)||!Buffer.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,f=0,i=Math.min(r,n);ft&&(e+=" ... "),""},customInspectSymbol&&(Buffer.prototype[customInspectSymbol]=Buffer.prototype.inspect),Buffer.prototype.compare=function(e,t,r,n,f){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===f&&(f=this.length),t<0||r>e.length||n<0||f>this.length)throw new RangeError("out of range index");if(n>=f&&t>=r)return 0;if(n>=f)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(f>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),u=Math.min(i,o),s=this.slice(n,f),a=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var f=this.length-t;if((void 0===r||r>f)&&(r=f),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return hexWrite(this,e,t,r);case"utf8":case"utf-8":return utf8Write(this,e,t,r);case"ascii":return asciiWrite(this,e,t,r);case"latin1":case"binary":return latin1Write(this,e,t,r);case"base64":return base64Write(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(e){var t=e.length;if(t<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn)&&(r=n);for(var f="",i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function checkInt(e,t,r,n,f,i){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>f||te.length)throw new RangeError("Index out of range")}function checkIEEE754(e,t,r,n,f,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(e,t,r,n,f){return t=+t,r>>>=0,f||checkIEEE754(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),ieee754.write(e,t,r,n,23,4),r+4}function writeDouble(e,t,r,n,f){return t=+t,r>>>=0,f||checkIEEE754(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),ieee754.write(e,t,r,n,52,8),r+8}Buffer.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e],f=1,i=0;++i>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e+--t],f=1;t>0&&(f*=256);)n+=this[e+--t]*f;return n},Buffer.prototype.readUInt8=function(e,t){return e>>>=0,t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUInt16LE=function(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUInt16BE=function(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUInt32LE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUInt32BE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e],f=1,i=0;++i=(f*=128)&&(n-=Math.pow(2,8*t)),n},Buffer.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=t,f=1,i=this[e+--n];n>0&&(f*=256);)i+=this[e+--n]*f;return i>=(f*=128)&&(i-=Math.pow(2,8*t)),i},Buffer.prototype.readInt8=function(e,t){return e>>>=0,t||checkOffset(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function(e,t){e>>>=0,t||checkOffset(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(e,t){e>>>=0,t||checkOffset(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),ieee754.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),ieee754.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function(e,t){return e>>>=0,t||checkOffset(e,8,this.length),ieee754.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function(e,t){return e>>>=0,t||checkOffset(e,8,this.length),ieee754.read(this,e,!1,52,8)},Buffer.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var f=1,i=0;for(this[t]=255&e;++i>>=0,r>>>=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var f=r-1,i=1;for(this[t+f]=255&e;--f>=0&&(i*=256);)this[t+f]=e/i&255;return t+r},Buffer.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,255,0),this[t]=255&e,t+1},Buffer.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},Buffer.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,e,t,r,f-1,-f)}var i=0,o=1,u=0;for(this[t]=255&e;++i>0)-u&255;return t+r},Buffer.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,e,t,r,f-1,-f)}var i=r-1,o=1,u=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===u&&0!==this[t+i+1]&&(u=1),this[t+i]=(e/o>>0)-u&255;return t+r},Buffer.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},Buffer.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeFloatLE=function(e,t,r){return writeFloat(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function(e,t,r){return writeFloat(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function(e,t,r){return writeDouble(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function(e,t,r){return writeDouble(this,e,t,!1,r)},Buffer.prototype.copy=function(e,t,r,n){if(!Buffer.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return f},Buffer.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var f=e.charCodeAt(0);("utf8"===n&&f<128||"latin1"===n)&&(e=f)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&r<57344){if(!f){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&i.push(239,191,189);continue}f=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),f=r;continue}r=65536+(f-55296<<10|r-56320)}else f&&(t-=3)>-1&&i.push(239,191,189);if(f=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function asciiToBytes(e){for(var t=[],r=0;r>8,f=r%256,i.push(f),i.push(n);return i}function base64ToBytes(e){return base64.toByteArray(base64clean(e))}function blitBuffer(e,t,r,n){for(var f=0;f=t.length||f>=e.length);++f)t[f+r]=e[f];return f}function isInstance(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function numberIsNaN(e){return e!=e} +"use strict";var base64=require("base64-js"),ieee754=require("ieee754"),customInspectSymbol="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;exports.Buffer=Buffer,exports.SlowBuffer=SlowBuffer,exports.INSPECT_MAX_BYTES=50;var K_MAX_LENGTH=2147483647;function typedArraySupport(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}function createBuffer(e){if(e>K_MAX_LENGTH)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,Buffer.prototype),t}function Buffer(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(e)}return from(e,t,r)}function from(e,t,r){if("string"==typeof e)return fromString(e,t);if(ArrayBuffer.isView(e))return fromArrayLike(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(isInstance(e,ArrayBuffer)||e&&isInstance(e.buffer,ArrayBuffer))return fromArrayBuffer(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return Buffer.from(n,t,r);var f=fromObject(e);if(f)return f;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Buffer.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function assertSize(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function alloc(e,t,r){return assertSize(e),e<=0?createBuffer(e):void 0!==t?"string"==typeof r?createBuffer(e).fill(t,r):createBuffer(e).fill(t):createBuffer(e)}function allocUnsafe(e){return assertSize(e),createBuffer(e<0?0:0|checked(e))}function fromString(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!Buffer.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|byteLength(e,t),n=createBuffer(r),f=n.write(e,t);return f!==r&&(n=n.slice(0,f)),n}function fromArrayLike(e){for(var t=e.length<0?0:0|checked(e.length),r=createBuffer(t),n=0;n=K_MAX_LENGTH)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K_MAX_LENGTH.toString(16)+" bytes");return 0|e}function SlowBuffer(e){return+e!=e&&(e=0),Buffer.alloc(+e)}function byteLength(e,t){if(Buffer.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||isInstance(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var f=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return base64ToBytes(e).length;default:if(f)return n?-1:utf8ToBytes(e).length;t=(""+t).toLowerCase(),f=!0}}function slowToString(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return hexSlice(this,t,r);case"utf8":case"utf-8":return utf8Slice(this,t,r);case"ascii":return asciiSlice(this,t,r);case"latin1":case"binary":return latin1Slice(this,t,r);case"base64":return base64Slice(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function swap(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function bidirectionalIndexOf(e,t,r,n,f){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),numberIsNaN(r=+r)&&(r=f?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(f)return-1;r=e.length-1}else if(r<0){if(!f)return-1;r=0}if("string"==typeof t&&(t=Buffer.from(t,n)),Buffer.isBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,r,n,f);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):arrayIndexOf(e,[t],r,n,f);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,r,n,f){var i,o=1,u=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,u/=2,s/=2,r/=2}function a(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(f){var h=-1;for(i=r;iu&&(r=u-s),i=r;i>=0;i--){for(var c=!0,l=0;lf&&(n=f):n=f;var i=t.length;n>i/2&&(n=i/2);for(var o=0;o239?4:a>223?3:a>191?2:1;if(f+c<=r)switch(c){case 1:a<128&&(h=a);break;case 2:128==(192&(i=e[f+1]))&&(s=(31&a)<<6|63&i)>127&&(h=s);break;case 3:i=e[f+1],o=e[f+2],128==(192&i)&&128==(192&o)&&(s=(15&a)<<12|(63&i)<<6|63&o)>2047&&(s<55296||s>57343)&&(h=s);break;case 4:i=e[f+1],o=e[f+2],u=e[f+3],128==(192&i)&&128==(192&o)&&128==(192&u)&&(s=(15&a)<<18|(63&i)<<12|(63&o)<<6|63&u)>65535&&s<1114112&&(h=s)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),f+=c}return decodeCodePointsArray(n)}exports.kMaxLength=K_MAX_LENGTH,Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport(),Buffer.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(Buffer.prototype,"parent",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.buffer}}),Object.defineProperty(Buffer.prototype,"offset",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),Buffer.poolSize=8192,Buffer.from=function(e,t,r){return from(e,t,r)},Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype),Object.setPrototypeOf(Buffer,Uint8Array),Buffer.alloc=function(e,t,r){return alloc(e,t,r)},Buffer.allocUnsafe=function(e){return allocUnsafe(e)},Buffer.allocUnsafeSlow=function(e){return allocUnsafe(e)},Buffer.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==Buffer.prototype},Buffer.compare=function(e,t){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),isInstance(t,Uint8Array)&&(t=Buffer.from(t,t.offset,t.byteLength)),!Buffer.isBuffer(e)||!Buffer.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,f=0,i=Math.min(r,n);ft&&(e+=" ... "),""},customInspectSymbol&&(Buffer.prototype[customInspectSymbol]=Buffer.prototype.inspect),Buffer.prototype.compare=function(e,t,r,n,f){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===f&&(f=this.length),t<0||r>e.length||n<0||f>this.length)throw new RangeError("out of range index");if(n>=f&&t>=r)return 0;if(n>=f)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(f>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),u=Math.min(i,o),s=this.slice(n,f),a=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var f=this.length-t;if((void 0===r||r>f)&&(r=f),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return hexWrite(this,e,t,r);case"utf8":case"utf-8":return utf8Write(this,e,t,r);case"ascii":return asciiWrite(this,e,t,r);case"latin1":case"binary":return latin1Write(this,e,t,r);case"base64":return base64Write(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(e){var t=e.length;if(t<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn)&&(r=n);for(var f="",i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function checkInt(e,t,r,n,f,i){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>f||te.length)throw new RangeError("Index out of range")}function checkIEEE754(e,t,r,n,f,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(e,t,r,n,f){return t=+t,r>>>=0,f||checkIEEE754(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),ieee754.write(e,t,r,n,23,4),r+4}function writeDouble(e,t,r,n,f){return t=+t,r>>>=0,f||checkIEEE754(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),ieee754.write(e,t,r,n,52,8),r+8}Buffer.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e],f=1,i=0;++i>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e+--t],f=1;t>0&&(f*=256);)n+=this[e+--t]*f;return n},Buffer.prototype.readUInt8=function(e,t){return e>>>=0,t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUInt16LE=function(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUInt16BE=function(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUInt32LE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUInt32BE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e],f=1,i=0;++i=(f*=128)&&(n-=Math.pow(2,8*t)),n},Buffer.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=t,f=1,i=this[e+--n];n>0&&(f*=256);)i+=this[e+--n]*f;return i>=(f*=128)&&(i-=Math.pow(2,8*t)),i},Buffer.prototype.readInt8=function(e,t){return e>>>=0,t||checkOffset(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function(e,t){e>>>=0,t||checkOffset(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(e,t){e>>>=0,t||checkOffset(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),ieee754.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),ieee754.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function(e,t){return e>>>=0,t||checkOffset(e,8,this.length),ieee754.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function(e,t){return e>>>=0,t||checkOffset(e,8,this.length),ieee754.read(this,e,!1,52,8)},Buffer.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var f=1,i=0;for(this[t]=255&e;++i>>=0,r>>>=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var f=r-1,i=1;for(this[t+f]=255&e;--f>=0&&(i*=256);)this[t+f]=e/i&255;return t+r},Buffer.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,255,0),this[t]=255&e,t+1},Buffer.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},Buffer.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,e,t,r,f-1,-f)}var i=0,o=1,u=0;for(this[t]=255&e;++i>0)-u&255;return t+r},Buffer.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,e,t,r,f-1,-f)}var i=r-1,o=1,u=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===u&&0!==this[t+i+1]&&(u=1),this[t+i]=(e/o>>0)-u&255;return t+r},Buffer.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},Buffer.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeFloatLE=function(e,t,r){return writeFloat(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function(e,t,r){return writeFloat(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function(e,t,r){return writeDouble(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function(e,t,r){return writeDouble(this,e,t,!1,r)},Buffer.prototype.copy=function(e,t,r,n){if(!Buffer.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return f},Buffer.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var f=e.charCodeAt(0);("utf8"===n&&f<128||"latin1"===n)&&(e=f)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&r<57344){if(!f){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&i.push(239,191,189);continue}f=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),f=r;continue}r=65536+(f-55296<<10|r-56320)}else f&&(t-=3)>-1&&i.push(239,191,189);if(f=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function asciiToBytes(e){for(var t=[],r=0;r>8,f=r%256,i.push(f),i.push(n);return i}function base64ToBytes(e){return base64.toByteArray(base64clean(e))}function blitBuffer(e,t,r,n){for(var f=0;f=t.length||f>=e.length);++f)t[f+r]=e[f];return f}function isInstance(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function numberIsNaN(e){return e!=e}var hexSliceLookupTable=function(){for(var e=new Array(256),t=0;t<16;++t)for(var r=16*t,n=0;n<16;++n)e[r+n]="0123456789abcdef"[t]+"0123456789abcdef"[n];return e}(); }).call(this,require("buffer").Buffer) },{"base64-js":29,"buffer":35,"ieee754":55}],36:[function(require,module,exports){ diff --git a/docs/nearlib/classes/_account_.account.md b/docs/nearlib/classes/_account_.account.md index 7c817e1ef6..4957420ab3 100644 --- a/docs/nearlib/classes/_account_.account.md +++ b/docs/nearlib/classes/_account_.account.md @@ -44,6 +44,7 @@ sidebar_label: "Account" * [signAndSendTransaction](_account_.account.md#private-signandsendtransaction) * [stake](_account_.account.md#stake) * [state](_account_.account.md#state) +* [validateArgs](_account_.account.md#private-validateargs) * [viewFunction](_account_.account.md#viewfunction) ## Constructors @@ -52,7 +53,7 @@ sidebar_label: "Account" \+ **new Account**(`connection`: [Connection](_connection_.connection.md), `accountId`: string): *[Account](_account_.account.md)* -*Defined in [src.ts/account.ts:46](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L46)* +*Defined in [src.ts/account.ts:47](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L47)* **Parameters:** @@ -69,7 +70,7 @@ Name | Type | • **_accessKey**: *[AccessKey](_transaction_.accesskey.md)* -*Defined in [src.ts/account.ts:41](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L41)* +*Defined in [src.ts/account.ts:42](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L42)* ___ @@ -77,7 +78,7 @@ ___ • **_ready**: *Promise‹void›* -*Defined in [src.ts/account.ts:43](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L43)* +*Defined in [src.ts/account.ts:44](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L44)* ___ @@ -85,7 +86,7 @@ ___ • **_state**: *[AccountState](../interfaces/_account_.accountstate.md)* -*Defined in [src.ts/account.ts:40](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L40)* +*Defined in [src.ts/account.ts:41](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L41)* ___ @@ -93,7 +94,7 @@ ___ • **accountId**: *string* -*Defined in [src.ts/account.ts:39](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L39)* +*Defined in [src.ts/account.ts:40](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L40)* ___ @@ -101,7 +102,7 @@ ___ • **connection**: *[Connection](_connection_.connection.md)* -*Defined in [src.ts/account.ts:38](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L38)* +*Defined in [src.ts/account.ts:39](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L39)* ## Accessors @@ -109,7 +110,7 @@ ___ • **get ready**(): *Promise‹void›* -*Defined in [src.ts/account.ts:44](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L44)* +*Defined in [src.ts/account.ts:45](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L45)* **Returns:** *Promise‹void›* @@ -119,7 +120,7 @@ ___ ▸ **addKey**(`publicKey`: string | [PublicKey](_utils_key_pair_.publickey.md), `contractId?`: string, `methodName?`: string, `amount?`: BN): *Promise‹[FinalExecutionOutcome](../interfaces/_providers_provider_.finalexecutionoutcome.md)›* -*Defined in [src.ts/account.ts:161](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L161)* +*Defined in [src.ts/account.ts:161](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L161)* **Parameters:** @@ -138,7 +139,7 @@ ___ ▸ **createAccount**(`newAccountId`: string, `publicKey`: string | [PublicKey](_utils_key_pair_.publickey.md), `amount`: BN): *Promise‹[FinalExecutionOutcome](../interfaces/_providers_provider_.finalexecutionoutcome.md)›* -*Defined in [src.ts/account.ts:140](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L140)* +*Defined in [src.ts/account.ts:141](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L141)* **Parameters:** @@ -156,7 +157,7 @@ ___ ▸ **createAndDeployContract**(`contractId`: string, `publicKey`: string | [PublicKey](_utils_key_pair_.publickey.md), `data`: Uint8Array, `amount`: BN): *Promise‹[Account](_account_.account.md)›* -*Defined in [src.ts/account.ts:129](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L129)* +*Defined in [src.ts/account.ts:130](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L130)* **Parameters:** @@ -175,7 +176,7 @@ ___ ▸ **deleteAccount**(`beneficiaryId`: string): *Promise‹[FinalExecutionOutcome](../interfaces/_providers_provider_.finalexecutionoutcome.md)›* -*Defined in [src.ts/account.ts:145](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L145)* +*Defined in [src.ts/account.ts:146](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L146)* **Parameters:** @@ -191,7 +192,7 @@ ___ ▸ **deleteKey**(`publicKey`: string | [PublicKey](_utils_key_pair_.publickey.md)): *Promise‹[FinalExecutionOutcome](../interfaces/_providers_provider_.finalexecutionoutcome.md)›* -*Defined in [src.ts/account.ts:171](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L171)* +*Defined in [src.ts/account.ts:171](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L171)* **Parameters:** @@ -207,7 +208,7 @@ ___ ▸ **deployContract**(`data`: Uint8Array): *Promise‹[FinalExecutionOutcome](../interfaces/_providers_provider_.finalexecutionoutcome.md)›* -*Defined in [src.ts/account.ts:149](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L149)* +*Defined in [src.ts/account.ts:150](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L150)* **Parameters:** @@ -223,7 +224,7 @@ ___ ▸ **fetchState**(): *Promise‹void›* -*Defined in [src.ts/account.ts:53](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L53)* +*Defined in [src.ts/account.ts:54](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L54)* **Returns:** *Promise‹void›* @@ -233,7 +234,7 @@ ___ ▸ **functionCall**(`contractId`: string, `methodName`: string, `args`: any, `gas`: number, `amount?`: BN): *Promise‹[FinalExecutionOutcome](../interfaces/_providers_provider_.finalexecutionoutcome.md)›* -*Defined in [src.ts/account.ts:153](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L153)* +*Defined in [src.ts/account.ts:154](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L154)* **Parameters:** @@ -253,7 +254,7 @@ ___ ▸ **getAccessKeys**(): *Promise‹any›* -*Defined in [src.ts/account.ts:188](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L188)* +*Defined in [src.ts/account.ts:196](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L196)* **Returns:** *Promise‹any›* @@ -263,7 +264,7 @@ ___ ▸ **getAccountDetails**(): *Promise‹any›* -*Defined in [src.ts/account.ts:193](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L193)* +*Defined in [src.ts/account.ts:207](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L207)* **Returns:** *Promise‹any›* @@ -273,7 +274,7 @@ ___ ▸ **printLogs**(`contractId`: string, `logs`: string[]): *void* -*Defined in [src.ts/account.ts:71](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L71)* +*Defined in [src.ts/account.ts:72](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L72)* **Parameters:** @@ -290,7 +291,7 @@ ___ ▸ **retryTxResult**(`txHash`: Uint8Array, `accountId`: string): *Promise‹[FinalExecutionOutcome](../interfaces/_providers_provider_.finalexecutionoutcome.md)›* -*Defined in [src.ts/account.ts:77](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L77)* +*Defined in [src.ts/account.ts:78](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L78)* **Parameters:** @@ -307,7 +308,7 @@ ___ ▸ **sendMoney**(`receiverId`: string, `amount`: BN): *Promise‹[FinalExecutionOutcome](../interfaces/_providers_provider_.finalexecutionoutcome.md)›* -*Defined in [src.ts/account.ts:136](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L136)* +*Defined in [src.ts/account.ts:137](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L137)* **Parameters:** @@ -324,7 +325,7 @@ ___ ▸ **signAndSendTransaction**(`receiverId`: string, `actions`: [Action](_transaction_.action.md)[]): *Promise‹[FinalExecutionOutcome](../interfaces/_providers_provider_.finalexecutionoutcome.md)›* -*Defined in [src.ts/account.ts:93](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L93)* +*Defined in [src.ts/account.ts:94](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L94)* **Parameters:** @@ -341,7 +342,7 @@ ___ ▸ **stake**(`publicKey`: string | [PublicKey](_utils_key_pair_.publickey.md), `amount`: BN): *Promise‹[FinalExecutionOutcome](../interfaces/_providers_provider_.finalexecutionoutcome.md)›* -*Defined in [src.ts/account.ts:175](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L175)* +*Defined in [src.ts/account.ts:175](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L175)* **Parameters:** @@ -358,17 +359,33 @@ ___ ▸ **state**(): *Promise‹[AccountState](../interfaces/_account_.accountstate.md)›* -*Defined in [src.ts/account.ts:66](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L66)* +*Defined in [src.ts/account.ts:67](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L67)* **Returns:** *Promise‹[AccountState](../interfaces/_account_.accountstate.md)›* ___ +### `Private` validateArgs + +▸ **validateArgs**(`args`: any): *void* + +*Defined in [src.ts/account.ts:179](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L179)* + +**Parameters:** + +Name | Type | +------ | ------ | +`args` | any | + +**Returns:** *void* + +___ + ### viewFunction ▸ **viewFunction**(`contractId`: string, `methodName`: string, `args`: any): *Promise‹any›* -*Defined in [src.ts/account.ts:179](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L179)* +*Defined in [src.ts/account.ts:185](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L185)* **Parameters:** diff --git a/docs/nearlib/classes/_account_creator_.accountcreator.md b/docs/nearlib/classes/_account_creator_.accountcreator.md index 3321337bc3..041edf7381 100644 --- a/docs/nearlib/classes/_account_creator_.accountcreator.md +++ b/docs/nearlib/classes/_account_creator_.accountcreator.md @@ -26,7 +26,7 @@ Account creator provides interface to specific implementation to acutally create ▸ **createAccount**(`newAccountId`: string, `publicKey`: [PublicKey](_utils_key_pair_.publickey.md)): *Promise‹void›* -*Defined in [src.ts/account_creator.ts:11](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account_creator.ts#L11)* +*Defined in [src.ts/account_creator.ts:11](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account_creator.ts#L11)* **Parameters:** diff --git a/docs/nearlib/classes/_account_creator_.localaccountcreator.md b/docs/nearlib/classes/_account_creator_.localaccountcreator.md index d7cdab84ec..4c99dd3431 100644 --- a/docs/nearlib/classes/_account_creator_.localaccountcreator.md +++ b/docs/nearlib/classes/_account_creator_.localaccountcreator.md @@ -31,7 +31,7 @@ sidebar_label: "LocalAccountCreator" \+ **new LocalAccountCreator**(`masterAccount`: [Account](_account_.account.md), `initialBalance`: BN): *[LocalAccountCreator](_account_creator_.localaccountcreator.md)* -*Defined in [src.ts/account_creator.ts:16](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account_creator.ts#L16)* +*Defined in [src.ts/account_creator.ts:16](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account_creator.ts#L16)* **Parameters:** @@ -48,7 +48,7 @@ Name | Type | • **initialBalance**: *BN* -*Defined in [src.ts/account_creator.ts:16](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account_creator.ts#L16)* +*Defined in [src.ts/account_creator.ts:16](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account_creator.ts#L16)* ___ @@ -56,7 +56,7 @@ ___ • **masterAccount**: *[Account](_account_.account.md)* -*Defined in [src.ts/account_creator.ts:15](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account_creator.ts#L15)* +*Defined in [src.ts/account_creator.ts:15](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account_creator.ts#L15)* ## Methods @@ -66,7 +66,7 @@ ___ *Overrides [AccountCreator](_account_creator_.accountcreator.md).[createAccount](_account_creator_.accountcreator.md#abstract-createaccount)* -*Defined in [src.ts/account_creator.ts:24](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account_creator.ts#L24)* +*Defined in [src.ts/account_creator.ts:24](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account_creator.ts#L24)* **Parameters:** diff --git a/docs/nearlib/classes/_account_creator_.urlaccountcreator.md b/docs/nearlib/classes/_account_creator_.urlaccountcreator.md index 7004ed36b2..3ba3e7302f 100644 --- a/docs/nearlib/classes/_account_creator_.urlaccountcreator.md +++ b/docs/nearlib/classes/_account_creator_.urlaccountcreator.md @@ -31,7 +31,7 @@ sidebar_label: "UrlAccountCreator" \+ **new UrlAccountCreator**(`connection`: [Connection](_connection_.connection.md), `helperUrl`: string): *[UrlAccountCreator](_account_creator_.urlaccountcreator.md)* -*Defined in [src.ts/account_creator.ts:32](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account_creator.ts#L32)* +*Defined in [src.ts/account_creator.ts:32](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account_creator.ts#L32)* **Parameters:** @@ -48,7 +48,7 @@ Name | Type | • **connection**: *[Connection](_connection_.connection.md)* -*Defined in [src.ts/account_creator.ts:31](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account_creator.ts#L31)* +*Defined in [src.ts/account_creator.ts:31](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account_creator.ts#L31)* ___ @@ -56,7 +56,7 @@ ___ • **helperConnection**: *[ConnectionInfo](../interfaces/_utils_web_.connectioninfo.md)* -*Defined in [src.ts/account_creator.ts:32](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account_creator.ts#L32)* +*Defined in [src.ts/account_creator.ts:32](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account_creator.ts#L32)* ## Methods @@ -66,7 +66,7 @@ ___ *Overrides [AccountCreator](_account_creator_.accountcreator.md).[createAccount](_account_creator_.accountcreator.md#abstract-createaccount)* -*Defined in [src.ts/account_creator.ts:40](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account_creator.ts#L40)* +*Defined in [src.ts/account_creator.ts:40](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account_creator.ts#L40)* **Parameters:** diff --git a/docs/nearlib/classes/_connection_.connection.md b/docs/nearlib/classes/_connection_.connection.md index 2b32a1bef9..79404b72a3 100644 --- a/docs/nearlib/classes/_connection_.connection.md +++ b/docs/nearlib/classes/_connection_.connection.md @@ -30,7 +30,7 @@ sidebar_label: "Connection" \+ **new Connection**(`networkId`: string, `provider`: [Provider](_providers_provider_.provider.md), `signer`: [Signer](_signer_.signer.md)): *[Connection](_connection_.connection.md)* -*Defined in [src.ts/connection.ts:29](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/connection.ts#L29)* +*Defined in [src.ts/connection.ts:29](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/connection.ts#L29)* **Parameters:** @@ -48,7 +48,7 @@ Name | Type | • **networkId**: *string* -*Defined in [src.ts/connection.ts:27](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/connection.ts#L27)* +*Defined in [src.ts/connection.ts:27](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/connection.ts#L27)* ___ @@ -56,7 +56,7 @@ ___ • **provider**: *[Provider](_providers_provider_.provider.md)* -*Defined in [src.ts/connection.ts:28](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/connection.ts#L28)* +*Defined in [src.ts/connection.ts:28](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/connection.ts#L28)* ___ @@ -64,7 +64,7 @@ ___ • **signer**: *[Signer](_signer_.signer.md)* -*Defined in [src.ts/connection.ts:29](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/connection.ts#L29)* +*Defined in [src.ts/connection.ts:29](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/connection.ts#L29)* ## Methods @@ -72,7 +72,7 @@ ___ ▸ **fromConfig**(`config`: any): *[Connection](_connection_.connection.md)* -*Defined in [src.ts/connection.ts:37](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/connection.ts#L37)* +*Defined in [src.ts/connection.ts:37](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/connection.ts#L37)* **Parameters:** diff --git a/docs/nearlib/classes/_contract_.contract.md b/docs/nearlib/classes/_contract_.contract.md index 8fed64b060..6e5fa13cbe 100644 --- a/docs/nearlib/classes/_contract_.contract.md +++ b/docs/nearlib/classes/_contract_.contract.md @@ -25,7 +25,7 @@ sidebar_label: "Contract" \+ **new Contract**(`account`: [Account](_account_.account.md), `contractId`: string, `options`: object): *[Contract](_contract_.contract.md)* -*Defined in [src.ts/contract.ts:9](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/contract.ts#L9)* +*Defined in [src.ts/contract.ts:10](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/contract.ts#L10)* **Parameters:** @@ -48,7 +48,7 @@ Name | Type | • **account**: *[Account](_account_.account.md)* -*Defined in [src.ts/contract.ts:8](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/contract.ts#L8)* +*Defined in [src.ts/contract.ts:9](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/contract.ts#L9)* ___ @@ -56,4 +56,4 @@ ___ • **contractId**: *string* -*Defined in [src.ts/contract.ts:9](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/contract.ts#L9)* +*Defined in [src.ts/contract.ts:10](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/contract.ts#L10)* diff --git a/docs/nearlib/classes/_key_stores_browser_local_storage_key_store_.browserlocalstoragekeystore.md b/docs/nearlib/classes/_key_stores_browser_local_storage_key_store_.browserlocalstoragekeystore.md index 52d9bf248a..ede9783af7 100644 --- a/docs/nearlib/classes/_key_stores_browser_local_storage_key_store_.browserlocalstoragekeystore.md +++ b/docs/nearlib/classes/_key_stores_browser_local_storage_key_store_.browserlocalstoragekeystore.md @@ -38,7 +38,7 @@ sidebar_label: "BrowserLocalStorageKeyStore" \+ **new BrowserLocalStorageKeyStore**(`localStorage`: any, `prefix`: string): *[BrowserLocalStorageKeyStore](_key_stores_browser_local_storage_key_store_.browserlocalstoragekeystore.md)* -*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/browser_local_storage_key_store.ts#L10)* +*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/browser_local_storage_key_store.ts#L10)* **Parameters:** @@ -55,7 +55,7 @@ Name | Type | Default | • **localStorage**: *any* -*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:9](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/browser_local_storage_key_store.ts#L9)* +*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:9](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/browser_local_storage_key_store.ts#L9)* ___ @@ -63,7 +63,7 @@ ___ • **prefix**: *string* -*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/browser_local_storage_key_store.ts#L10)* +*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/browser_local_storage_key_store.ts#L10)* ## Methods @@ -73,7 +73,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[clear](_key_stores_keystore_.keystore.md#abstract-clear)* -*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:34](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/browser_local_storage_key_store.ts#L34)* +*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:34](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/browser_local_storage_key_store.ts#L34)* **Returns:** *Promise‹void›* @@ -85,7 +85,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getAccounts](_key_stores_keystore_.keystore.md#abstract-getaccounts)* -*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:53](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/browser_local_storage_key_store.ts#L53)* +*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:53](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/browser_local_storage_key_store.ts#L53)* **Parameters:** @@ -103,7 +103,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getKey](_key_stores_keystore_.keystore.md#abstract-getkey)* -*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:22](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/browser_local_storage_key_store.ts#L22)* +*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:22](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/browser_local_storage_key_store.ts#L22)* **Parameters:** @@ -122,7 +122,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getNetworks](_key_stores_keystore_.keystore.md#abstract-getnetworks)* -*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:42](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/browser_local_storage_key_store.ts#L42)* +*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:42](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/browser_local_storage_key_store.ts#L42)* **Returns:** *Promise‹string[]›* @@ -134,7 +134,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[removeKey](_key_stores_keystore_.keystore.md#abstract-removekey)* -*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:30](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/browser_local_storage_key_store.ts#L30)* +*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:30](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/browser_local_storage_key_store.ts#L30)* **Parameters:** @@ -153,7 +153,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[setKey](_key_stores_keystore_.keystore.md#abstract-setkey)* -*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:18](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/browser_local_storage_key_store.ts#L18)* +*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:18](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/browser_local_storage_key_store.ts#L18)* **Parameters:** @@ -171,7 +171,7 @@ ___ ▸ **storageKeyForSecretKey**(`networkId`: string, `accountId`: string): *string* -*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:66](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/browser_local_storage_key_store.ts#L66)* +*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:66](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/browser_local_storage_key_store.ts#L66)* **Parameters:** @@ -188,6 +188,6 @@ ___ ▸ **storageKeys**(): *IterableIterator‹string›* -*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:70](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/browser_local_storage_key_store.ts#L70)* +*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:70](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/browser_local_storage_key_store.ts#L70)* **Returns:** *IterableIterator‹string›* diff --git a/docs/nearlib/classes/_key_stores_in_memory_key_store_.inmemorykeystore.md b/docs/nearlib/classes/_key_stores_in_memory_key_store_.inmemorykeystore.md index 31c907ddab..0813a6a3e3 100644 --- a/docs/nearlib/classes/_key_stores_in_memory_key_store_.inmemorykeystore.md +++ b/docs/nearlib/classes/_key_stores_in_memory_key_store_.inmemorykeystore.md @@ -37,7 +37,7 @@ Simple in-memory keystore for testing purposes. \+ **new InMemoryKeyStore**(): *[InMemoryKeyStore](_key_stores_in_memory_key_store_.inmemorykeystore.md)* -*Defined in [src.ts/key_stores/in_memory_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/in_memory_key_store.ts#L10)* +*Defined in [src.ts/key_stores/in_memory_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/in_memory_key_store.ts#L10)* **Returns:** *[InMemoryKeyStore](_key_stores_in_memory_key_store_.inmemorykeystore.md)* @@ -47,7 +47,7 @@ Simple in-memory keystore for testing purposes. • **keys**: *object* -*Defined in [src.ts/key_stores/in_memory_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/in_memory_key_store.ts#L10)* +*Defined in [src.ts/key_stores/in_memory_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/in_memory_key_store.ts#L10)* #### Type declaration: @@ -61,7 +61,7 @@ Simple in-memory keystore for testing purposes. *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[clear](_key_stores_keystore_.keystore.md#abstract-clear)* -*Defined in [src.ts/key_stores/in_memory_key_store.ts:33](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/in_memory_key_store.ts#L33)* +*Defined in [src.ts/key_stores/in_memory_key_store.ts:33](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/in_memory_key_store.ts#L33)* **Returns:** *Promise‹void›* @@ -73,7 +73,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getAccounts](_key_stores_keystore_.keystore.md#abstract-getaccounts)* -*Defined in [src.ts/key_stores/in_memory_key_store.ts:46](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/in_memory_key_store.ts#L46)* +*Defined in [src.ts/key_stores/in_memory_key_store.ts:46](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/in_memory_key_store.ts#L46)* **Parameters:** @@ -91,7 +91,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getKey](_key_stores_keystore_.keystore.md#abstract-getkey)* -*Defined in [src.ts/key_stores/in_memory_key_store.ts:21](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/in_memory_key_store.ts#L21)* +*Defined in [src.ts/key_stores/in_memory_key_store.ts:21](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/in_memory_key_store.ts#L21)* **Parameters:** @@ -110,7 +110,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getNetworks](_key_stores_keystore_.keystore.md#abstract-getnetworks)* -*Defined in [src.ts/key_stores/in_memory_key_store.ts:37](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/in_memory_key_store.ts#L37)* +*Defined in [src.ts/key_stores/in_memory_key_store.ts:37](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/in_memory_key_store.ts#L37)* **Returns:** *Promise‹string[]›* @@ -122,7 +122,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[removeKey](_key_stores_keystore_.keystore.md#abstract-removekey)* -*Defined in [src.ts/key_stores/in_memory_key_store.ts:29](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/in_memory_key_store.ts#L29)* +*Defined in [src.ts/key_stores/in_memory_key_store.ts:29](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/in_memory_key_store.ts#L29)* **Parameters:** @@ -141,7 +141,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[setKey](_key_stores_keystore_.keystore.md#abstract-setkey)* -*Defined in [src.ts/key_stores/in_memory_key_store.ts:17](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/in_memory_key_store.ts#L17)* +*Defined in [src.ts/key_stores/in_memory_key_store.ts:17](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/in_memory_key_store.ts#L17)* **Parameters:** diff --git a/docs/nearlib/classes/_key_stores_keystore_.keystore.md b/docs/nearlib/classes/_key_stores_keystore_.keystore.md index 9cf290ffa4..3dba9fc2e7 100644 --- a/docs/nearlib/classes/_key_stores_keystore_.keystore.md +++ b/docs/nearlib/classes/_key_stores_keystore_.keystore.md @@ -35,7 +35,7 @@ Key store interface for `InMemorySigner`. ▸ **clear**(): *Promise‹void›* -*Defined in [src.ts/key_stores/keystore.ts:12](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/keystore.ts#L12)* +*Defined in [src.ts/key_stores/keystore.ts:12](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/keystore.ts#L12)* **Returns:** *Promise‹void›* @@ -45,7 +45,7 @@ ___ ▸ **getAccounts**(`networkId`: string): *Promise‹string[]›* -*Defined in [src.ts/key_stores/keystore.ts:14](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/keystore.ts#L14)* +*Defined in [src.ts/key_stores/keystore.ts:14](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/keystore.ts#L14)* **Parameters:** @@ -61,7 +61,7 @@ ___ ▸ **getKey**(`networkId`: string, `accountId`: string): *Promise‹[KeyPair](_utils_key_pair_.keypair.md)›* -*Defined in [src.ts/key_stores/keystore.ts:10](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/keystore.ts#L10)* +*Defined in [src.ts/key_stores/keystore.ts:10](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/keystore.ts#L10)* **Parameters:** @@ -78,7 +78,7 @@ ___ ▸ **getNetworks**(): *Promise‹string[]›* -*Defined in [src.ts/key_stores/keystore.ts:13](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/keystore.ts#L13)* +*Defined in [src.ts/key_stores/keystore.ts:13](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/keystore.ts#L13)* **Returns:** *Promise‹string[]›* @@ -88,7 +88,7 @@ ___ ▸ **removeKey**(`networkId`: string, `accountId`: string): *Promise‹void›* -*Defined in [src.ts/key_stores/keystore.ts:11](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/keystore.ts#L11)* +*Defined in [src.ts/key_stores/keystore.ts:11](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/keystore.ts#L11)* **Parameters:** @@ -105,7 +105,7 @@ ___ ▸ **setKey**(`networkId`: string, `accountId`: string, `keyPair`: [KeyPair](_utils_key_pair_.keypair.md)): *Promise‹void›* -*Defined in [src.ts/key_stores/keystore.ts:9](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/keystore.ts#L9)* +*Defined in [src.ts/key_stores/keystore.ts:9](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/keystore.ts#L9)* **Parameters:** diff --git a/docs/nearlib/classes/_key_stores_merge_key_store_.mergekeystore.md b/docs/nearlib/classes/_key_stores_merge_key_store_.mergekeystore.md index 3e75219939..a3535b9eb4 100644 --- a/docs/nearlib/classes/_key_stores_merge_key_store_.mergekeystore.md +++ b/docs/nearlib/classes/_key_stores_merge_key_store_.mergekeystore.md @@ -37,7 +37,7 @@ Keystore which can be used to merge multiple key stores into one virtual key sto \+ **new MergeKeyStore**(`keyStores`: [KeyStore](_key_stores_keystore_.keystore.md)[]): *[MergeKeyStore](_key_stores_merge_key_store_.mergekeystore.md)* -*Defined in [src.ts/key_stores/merge_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/merge_key_store.ts#L10)* +*Defined in [src.ts/key_stores/merge_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/merge_key_store.ts#L10)* **Parameters:** @@ -53,7 +53,7 @@ Name | Type | Description | • **keyStores**: *[KeyStore](_key_stores_keystore_.keystore.md)[]* -*Defined in [src.ts/key_stores/merge_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/merge_key_store.ts#L10)* +*Defined in [src.ts/key_stores/merge_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/merge_key_store.ts#L10)* ## Methods @@ -63,7 +63,7 @@ Name | Type | Description | *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[clear](_key_stores_keystore_.keystore.md#abstract-clear)* -*Defined in [src.ts/key_stores/merge_key_store.ts:40](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/merge_key_store.ts#L40)* +*Defined in [src.ts/key_stores/merge_key_store.ts:40](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/merge_key_store.ts#L40)* **Returns:** *Promise‹void›* @@ -75,7 +75,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getAccounts](_key_stores_keystore_.keystore.md#abstract-getaccounts)* -*Defined in [src.ts/key_stores/merge_key_store.ts:56](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/merge_key_store.ts#L56)* +*Defined in [src.ts/key_stores/merge_key_store.ts:56](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/merge_key_store.ts#L56)* **Parameters:** @@ -93,7 +93,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getKey](_key_stores_keystore_.keystore.md#abstract-getkey)* -*Defined in [src.ts/key_stores/merge_key_store.ts:24](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/merge_key_store.ts#L24)* +*Defined in [src.ts/key_stores/merge_key_store.ts:24](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/merge_key_store.ts#L24)* **Parameters:** @@ -112,7 +112,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getNetworks](_key_stores_keystore_.keystore.md#abstract-getnetworks)* -*Defined in [src.ts/key_stores/merge_key_store.ts:46](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/merge_key_store.ts#L46)* +*Defined in [src.ts/key_stores/merge_key_store.ts:46](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/merge_key_store.ts#L46)* **Returns:** *Promise‹string[]›* @@ -124,7 +124,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[removeKey](_key_stores_keystore_.keystore.md#abstract-removekey)* -*Defined in [src.ts/key_stores/merge_key_store.ts:34](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/merge_key_store.ts#L34)* +*Defined in [src.ts/key_stores/merge_key_store.ts:34](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/merge_key_store.ts#L34)* **Parameters:** @@ -143,7 +143,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[setKey](_key_stores_keystore_.keystore.md#abstract-setkey)* -*Defined in [src.ts/key_stores/merge_key_store.ts:20](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/merge_key_store.ts#L20)* +*Defined in [src.ts/key_stores/merge_key_store.ts:20](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/merge_key_store.ts#L20)* **Parameters:** diff --git a/docs/nearlib/classes/_key_stores_unencrypted_file_system_keystore_.unencryptedfilesystemkeystore.md b/docs/nearlib/classes/_key_stores_unencrypted_file_system_keystore_.unencryptedfilesystemkeystore.md index 62a2ae7bb2..35ec3aa9a0 100644 --- a/docs/nearlib/classes/_key_stores_unencrypted_file_system_keystore_.unencryptedfilesystemkeystore.md +++ b/docs/nearlib/classes/_key_stores_unencrypted_file_system_keystore_.unencryptedfilesystemkeystore.md @@ -36,7 +36,7 @@ sidebar_label: "UnencryptedFileSystemKeyStore" \+ **new UnencryptedFileSystemKeyStore**(`keyDir`: string): *[UnencryptedFileSystemKeyStore](_key_stores_unencrypted_file_system_keystore_.unencryptedfilesystemkeystore.md)* -*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:57](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/unencrypted_file_system_keystore.ts#L57)* +*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:57](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/unencrypted_file_system_keystore.ts#L57)* **Parameters:** @@ -52,7 +52,7 @@ Name | Type | • **keyDir**: *string* -*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:57](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/unencrypted_file_system_keystore.ts#L57)* +*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:57](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/unencrypted_file_system_keystore.ts#L57)* ## Methods @@ -62,7 +62,7 @@ Name | Type | *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[clear](_key_stores_keystore_.keystore.md#abstract-clear)* -*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:85](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/unencrypted_file_system_keystore.ts#L85)* +*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:85](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/unencrypted_file_system_keystore.ts#L85)* **Returns:** *Promise‹void›* @@ -74,7 +74,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getAccounts](_key_stores_keystore_.keystore.md#abstract-getaccounts)* -*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:106](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/unencrypted_file_system_keystore.ts#L106)* +*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:106](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/unencrypted_file_system_keystore.ts#L106)* **Parameters:** @@ -92,7 +92,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getKey](_key_stores_keystore_.keystore.md#abstract-getkey)* -*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:70](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/unencrypted_file_system_keystore.ts#L70)* +*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:70](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/unencrypted_file_system_keystore.ts#L70)* **Parameters:** @@ -109,7 +109,7 @@ ___ ▸ **getKeyFilePath**(`networkId`: string, `accountId`: string): *string* -*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:93](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/unencrypted_file_system_keystore.ts#L93)* +*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:93](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/unencrypted_file_system_keystore.ts#L93)* **Parameters:** @@ -128,7 +128,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getNetworks](_key_stores_keystore_.keystore.md#abstract-getnetworks)* -*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:97](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/unencrypted_file_system_keystore.ts#L97)* +*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:97](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/unencrypted_file_system_keystore.ts#L97)* **Returns:** *Promise‹string[]›* @@ -140,7 +140,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[removeKey](_key_stores_keystore_.keystore.md#abstract-removekey)* -*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:79](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/unencrypted_file_system_keystore.ts#L79)* +*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:79](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/unencrypted_file_system_keystore.ts#L79)* **Parameters:** @@ -159,7 +159,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[setKey](_key_stores_keystore_.keystore.md#abstract-setkey)* -*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:64](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/unencrypted_file_system_keystore.ts#L64)* +*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:64](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/unencrypted_file_system_keystore.ts#L64)* **Parameters:** diff --git a/docs/nearlib/classes/_near_.near.md b/docs/nearlib/classes/_near_.near.md index ec24340963..37f2c39a37 100644 --- a/docs/nearlib/classes/_near_.near.md +++ b/docs/nearlib/classes/_near_.near.md @@ -33,7 +33,7 @@ sidebar_label: "Near" \+ **new Near**(`config`: any): *[Near](_near_.near.md)* -*Defined in [src.ts/near.ts:14](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/near.ts#L14)* +*Defined in [src.ts/near.ts:14](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/near.ts#L14)* **Parameters:** @@ -49,7 +49,7 @@ Name | Type | • **accountCreator**: *[AccountCreator](_account_creator_.accountcreator.md)* -*Defined in [src.ts/near.ts:14](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/near.ts#L14)* +*Defined in [src.ts/near.ts:14](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/near.ts#L14)* ___ @@ -57,7 +57,7 @@ ___ • **config**: *any* -*Defined in [src.ts/near.ts:12](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/near.ts#L12)* +*Defined in [src.ts/near.ts:12](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/near.ts#L12)* ___ @@ -65,7 +65,7 @@ ___ • **connection**: *[Connection](_connection_.connection.md)* -*Defined in [src.ts/near.ts:13](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/near.ts#L13)* +*Defined in [src.ts/near.ts:13](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/near.ts#L13)* ## Methods @@ -73,7 +73,7 @@ ___ ▸ **account**(`accountId`: string): *Promise‹[Account](_account_.account.md)›* -*Defined in [src.ts/near.ts:33](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/near.ts#L33)* +*Defined in [src.ts/near.ts:33](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/near.ts#L33)* **Parameters:** @@ -89,7 +89,7 @@ ___ ▸ **createAccount**(`accountId`: string, `publicKey`: [PublicKey](_utils_key_pair_.publickey.md)): *Promise‹[Account](_account_.account.md)›* -*Defined in [src.ts/near.ts:39](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/near.ts#L39)* +*Defined in [src.ts/near.ts:39](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/near.ts#L39)* **Parameters:** @@ -106,7 +106,7 @@ ___ ▸ **loadContract**(`contractId`: string, `options`: object): *Promise‹[Contract](_contract_.contract.md)›* -*Defined in [src.ts/near.ts:52](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/near.ts#L52)* +*Defined in [src.ts/near.ts:52](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/near.ts#L52)* Backwards compatibility method. Use `new nearlib.Contract(yourAccount, contractId, { viewMethods, changeMethods })` instead. @@ -130,7 +130,7 @@ ___ ▸ **sendTokens**(`amount`: BN, `originator`: string, `receiver`: string): *Promise‹string›* -*Defined in [src.ts/near.ts:64](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/near.ts#L64)* +*Defined in [src.ts/near.ts:64](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/near.ts#L64)* Backwards compatibility method. Use `yourAccount.sendMoney` instead. diff --git a/docs/nearlib/classes/_providers_json_rpc_provider_.jsonrpcprovider.md b/docs/nearlib/classes/_providers_json_rpc_provider_.jsonrpcprovider.md index 1fa53ffc1e..ad22dcc457 100644 --- a/docs/nearlib/classes/_providers_json_rpc_provider_.jsonrpcprovider.md +++ b/docs/nearlib/classes/_providers_json_rpc_provider_.jsonrpcprovider.md @@ -37,7 +37,7 @@ sidebar_label: "JsonRpcProvider" \+ **new JsonRpcProvider**(`url?`: string, `network?`: [Network](../interfaces/_utils_network_.network.md)): *[JsonRpcProvider](_providers_json_rpc_provider_.jsonrpcprovider.md)* -*Defined in [src.ts/providers/json-rpc-provider.ts:24](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/json-rpc-provider.ts#L24)* +*Defined in [src.ts/providers/json-rpc-provider.ts:24](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/json-rpc-provider.ts#L24)* **Parameters:** @@ -54,7 +54,7 @@ Name | Type | • **connection**: *[ConnectionInfo](../interfaces/_utils_web_.connectioninfo.md)* -*Defined in [src.ts/providers/json-rpc-provider.ts:24](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/json-rpc-provider.ts#L24)* +*Defined in [src.ts/providers/json-rpc-provider.ts:24](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/json-rpc-provider.ts#L24)* ## Methods @@ -64,7 +64,7 @@ Name | Type | *Overrides [Provider](_providers_provider_.provider.md).[block](_providers_provider_.provider.md#abstract-block)* -*Defined in [src.ts/providers/json-rpc-provider.ts:61](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/json-rpc-provider.ts#L61)* +*Defined in [src.ts/providers/json-rpc-provider.ts:61](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/json-rpc-provider.ts#L61)* **Parameters:** @@ -82,7 +82,7 @@ ___ *Overrides [Provider](_providers_provider_.provider.md).[chunk](_providers_provider_.provider.md#abstract-chunk)* -*Defined in [src.ts/providers/json-rpc-provider.ts:65](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/json-rpc-provider.ts#L65)* +*Defined in [src.ts/providers/json-rpc-provider.ts:65](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/json-rpc-provider.ts#L65)* **Parameters:** @@ -100,7 +100,7 @@ ___ *Overrides [Provider](_providers_provider_.provider.md).[getNetwork](_providers_provider_.provider.md#abstract-getnetwork)* -*Defined in [src.ts/providers/json-rpc-provider.ts:33](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/json-rpc-provider.ts#L33)* +*Defined in [src.ts/providers/json-rpc-provider.ts:33](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/json-rpc-provider.ts#L33)* **Returns:** *Promise‹[Network](../interfaces/_utils_network_.network.md)›* @@ -112,7 +112,7 @@ ___ *Overrides [Provider](_providers_provider_.provider.md).[query](_providers_provider_.provider.md#abstract-query)* -*Defined in [src.ts/providers/json-rpc-provider.ts:53](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/json-rpc-provider.ts#L53)* +*Defined in [src.ts/providers/json-rpc-provider.ts:53](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/json-rpc-provider.ts#L53)* **Parameters:** @@ -129,7 +129,7 @@ ___ ▸ **sendJsonRpc**(`method`: string, `params`: any[]): *Promise‹any›* -*Defined in [src.ts/providers/json-rpc-provider.ts:69](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/json-rpc-provider.ts#L69)* +*Defined in [src.ts/providers/json-rpc-provider.ts:69](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/json-rpc-provider.ts#L69)* **Parameters:** @@ -148,7 +148,7 @@ ___ *Overrides [Provider](_providers_provider_.provider.md).[sendTransaction](_providers_provider_.provider.md#abstract-sendtransaction)* -*Defined in [src.ts/providers/json-rpc-provider.ts:44](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/json-rpc-provider.ts#L44)* +*Defined in [src.ts/providers/json-rpc-provider.ts:44](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/json-rpc-provider.ts#L44)* **Parameters:** @@ -166,7 +166,7 @@ ___ *Overrides [Provider](_providers_provider_.provider.md).[status](_providers_provider_.provider.md#abstract-status)* -*Defined in [src.ts/providers/json-rpc-provider.ts:40](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/json-rpc-provider.ts#L40)* +*Defined in [src.ts/providers/json-rpc-provider.ts:40](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/json-rpc-provider.ts#L40)* **Returns:** *Promise‹[NodeStatusResult](../interfaces/_providers_provider_.nodestatusresult.md)›* @@ -178,7 +178,7 @@ ___ *Overrides [Provider](_providers_provider_.provider.md).[txStatus](_providers_provider_.provider.md#abstract-txstatus)* -*Defined in [src.ts/providers/json-rpc-provider.ts:49](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/json-rpc-provider.ts#L49)* +*Defined in [src.ts/providers/json-rpc-provider.ts:49](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/json-rpc-provider.ts#L49)* **Parameters:** diff --git a/docs/nearlib/classes/_providers_json_rpc_provider_.typederror.md b/docs/nearlib/classes/_providers_json_rpc_provider_.typederror.md index c211dae9b4..b2f36b0545 100644 --- a/docs/nearlib/classes/_providers_json_rpc_provider_.typederror.md +++ b/docs/nearlib/classes/_providers_json_rpc_provider_.typederror.md @@ -30,7 +30,7 @@ sidebar_label: "TypedError" \+ **new TypedError**(`message?`: string, `type?`: string): *[TypedError](_providers_json_rpc_provider_.typederror.md)* -*Defined in [src.ts/providers/json-rpc-provider.ts:16](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/json-rpc-provider.ts#L16)* +*Defined in [src.ts/providers/json-rpc-provider.ts:16](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/json-rpc-provider.ts#L16)* **Parameters:** @@ -79,7 +79,7 @@ ___ • **type**: *string* -*Defined in [src.ts/providers/json-rpc-provider.ts:16](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/json-rpc-provider.ts#L16)* +*Defined in [src.ts/providers/json-rpc-provider.ts:16](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/json-rpc-provider.ts#L16)* ___ diff --git a/docs/nearlib/classes/_providers_provider_.provider.md b/docs/nearlib/classes/_providers_provider_.provider.md index 520ac8eb6e..c4ebcc7eca 100644 --- a/docs/nearlib/classes/_providers_provider_.provider.md +++ b/docs/nearlib/classes/_providers_provider_.provider.md @@ -28,7 +28,7 @@ sidebar_label: "Provider" ▸ **block**(`blockId`: [BlockId](../modules/_providers_provider_.md#blockid)): *Promise‹[BlockResult](../interfaces/_providers_provider_.blockresult.md)›* -*Defined in [src.ts/providers/provider.ts:259](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L259)* +*Defined in [src.ts/providers/provider.ts:265](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L265)* **Parameters:** @@ -44,7 +44,7 @@ ___ ▸ **chunk**(`chunkId`: [ChunkId](../modules/_providers_provider_.md#chunkid)): *Promise‹[ChunkResult](../interfaces/_providers_provider_.chunkresult.md)›* -*Defined in [src.ts/providers/provider.ts:260](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L260)* +*Defined in [src.ts/providers/provider.ts:266](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L266)* **Parameters:** @@ -60,7 +60,7 @@ ___ ▸ **getNetwork**(): *Promise‹[Network](../interfaces/_utils_network_.network.md)›* -*Defined in [src.ts/providers/provider.ts:253](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L253)* +*Defined in [src.ts/providers/provider.ts:259](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L259)* **Returns:** *Promise‹[Network](../interfaces/_utils_network_.network.md)›* @@ -70,7 +70,7 @@ ___ ▸ **query**(`path`: string, `data`: string): *Promise‹any›* -*Defined in [src.ts/providers/provider.ts:258](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L258)* +*Defined in [src.ts/providers/provider.ts:264](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L264)* **Parameters:** @@ -87,7 +87,7 @@ ___ ▸ **sendTransaction**(`signedTransaction`: [SignedTransaction](_transaction_.signedtransaction.md)): *Promise‹[FinalExecutionOutcome](../interfaces/_providers_provider_.finalexecutionoutcome.md)›* -*Defined in [src.ts/providers/provider.ts:256](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L256)* +*Defined in [src.ts/providers/provider.ts:262](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L262)* **Parameters:** @@ -103,7 +103,7 @@ ___ ▸ **status**(): *Promise‹[NodeStatusResult](../interfaces/_providers_provider_.nodestatusresult.md)›* -*Defined in [src.ts/providers/provider.ts:254](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L254)* +*Defined in [src.ts/providers/provider.ts:260](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L260)* **Returns:** *Promise‹[NodeStatusResult](../interfaces/_providers_provider_.nodestatusresult.md)›* @@ -113,7 +113,7 @@ ___ ▸ **txStatus**(`txHash`: Uint8Array, `accountId`: string): *Promise‹[FinalExecutionOutcome](../interfaces/_providers_provider_.finalexecutionoutcome.md)›* -*Defined in [src.ts/providers/provider.ts:257](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L257)* +*Defined in [src.ts/providers/provider.ts:263](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L263)* **Parameters:** diff --git a/docs/nearlib/classes/_signer_.inmemorysigner.md b/docs/nearlib/classes/_signer_.inmemorysigner.md index de8574ce26..fe92ead54a 100644 --- a/docs/nearlib/classes/_signer_.inmemorysigner.md +++ b/docs/nearlib/classes/_signer_.inmemorysigner.md @@ -35,7 +35,7 @@ Signs using in memory key store. \+ **new InMemorySigner**(`keyStore`: [KeyStore](_key_stores_keystore_.keystore.md)): *[InMemorySigner](_signer_.inmemorysigner.md)* -*Defined in [src.ts/signer.ts:47](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/signer.ts#L47)* +*Defined in [src.ts/signer.ts:47](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/signer.ts#L47)* **Parameters:** @@ -51,7 +51,7 @@ Name | Type | • **keyStore**: *[KeyStore](_key_stores_keystore_.keystore.md)* -*Defined in [src.ts/signer.ts:47](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/signer.ts#L47)* +*Defined in [src.ts/signer.ts:47](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/signer.ts#L47)* ## Methods @@ -61,7 +61,7 @@ Name | Type | *Overrides [Signer](_signer_.signer.md).[createKey](_signer_.signer.md#abstract-createkey)* -*Defined in [src.ts/signer.ts:54](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/signer.ts#L54)* +*Defined in [src.ts/signer.ts:54](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/signer.ts#L54)* **Parameters:** @@ -80,7 +80,7 @@ ___ *Overrides [Signer](_signer_.signer.md).[getPublicKey](_signer_.signer.md#abstract-getpublickey)* -*Defined in [src.ts/signer.ts:60](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/signer.ts#L60)* +*Defined in [src.ts/signer.ts:60](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/signer.ts#L60)* **Parameters:** @@ -99,7 +99,7 @@ ___ *Overrides [Signer](_signer_.signer.md).[signHash](_signer_.signer.md#abstract-signhash)* -*Defined in [src.ts/signer.ts:68](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/signer.ts#L68)* +*Defined in [src.ts/signer.ts:68](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/signer.ts#L68)* **Parameters:** @@ -119,7 +119,7 @@ ___ *Inherited from [Signer](_signer_.signer.md).[signMessage](_signer_.signer.md#signmessage)* -*Defined in [src.ts/signer.ts:38](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/signer.ts#L38)* +*Defined in [src.ts/signer.ts:38](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/signer.ts#L38)* Signs given message, by first hashing with sha256. diff --git a/docs/nearlib/classes/_signer_.signer.md b/docs/nearlib/classes/_signer_.signer.md index ff649e6aee..b4e7451db7 100644 --- a/docs/nearlib/classes/_signer_.signer.md +++ b/docs/nearlib/classes/_signer_.signer.md @@ -27,7 +27,7 @@ General signing interface, can be used for in memory signing, RPC singing, exter ▸ **createKey**(`accountId`: string, `networkId?`: string): *Promise‹[PublicKey](_utils_key_pair_.publickey.md)›* -*Defined in [src.ts/signer.ts:15](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/signer.ts#L15)* +*Defined in [src.ts/signer.ts:15](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/signer.ts#L15)* Creates new key and returns public key. @@ -46,7 +46,7 @@ ___ ▸ **getPublicKey**(`accountId?`: string, `networkId?`: string): *Promise‹[PublicKey](_utils_key_pair_.publickey.md)›* -*Defined in [src.ts/signer.ts:22](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/signer.ts#L22)* +*Defined in [src.ts/signer.ts:22](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/signer.ts#L22)* Returns public key for given account / network. @@ -65,7 +65,7 @@ ___ ▸ **signHash**(`hash`: Uint8Array, `accountId?`: string, `networkId?`: string): *Promise‹[Signature](../interfaces/_utils_key_pair_.signature.md)›* -*Defined in [src.ts/signer.ts:30](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/signer.ts#L30)* +*Defined in [src.ts/signer.ts:30](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/signer.ts#L30)* Signs given hash. @@ -85,7 +85,7 @@ ___ ▸ **signMessage**(`message`: Uint8Array, `accountId?`: string, `networkId?`: string): *Promise‹[Signature](../interfaces/_utils_key_pair_.signature.md)›* -*Defined in [src.ts/signer.ts:38](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/signer.ts#L38)* +*Defined in [src.ts/signer.ts:38](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/signer.ts#L38)* Signs given message, by first hashing with sha256. diff --git a/docs/nearlib/classes/_transaction_.accesskey.md b/docs/nearlib/classes/_transaction_.accesskey.md index 1d724388c0..d897b9ffff 100644 --- a/docs/nearlib/classes/_transaction_.accesskey.md +++ b/docs/nearlib/classes/_transaction_.accesskey.md @@ -29,7 +29,7 @@ sidebar_label: "AccessKey" *Inherited from [Assignable](_utils_enums_.assignable.md).[constructor](_utils_enums_.assignable.md#constructor)* -*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L17)* +*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L17)* **Parameters:** @@ -45,7 +45,7 @@ Name | Type | • **nonce**: *number* -*Defined in [src.ts/transaction.ts:25](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L25)* +*Defined in [src.ts/transaction.ts:25](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L25)* ___ @@ -53,4 +53,4 @@ ___ • **permission**: *[AccessKeyPermission](_transaction_.accesskeypermission.md)* -*Defined in [src.ts/transaction.ts:26](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L26)* +*Defined in [src.ts/transaction.ts:26](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L26)* diff --git a/docs/nearlib/classes/_transaction_.accesskeypermission.md b/docs/nearlib/classes/_transaction_.accesskeypermission.md index 1481f7d3c6..b322e1b600 100644 --- a/docs/nearlib/classes/_transaction_.accesskeypermission.md +++ b/docs/nearlib/classes/_transaction_.accesskeypermission.md @@ -30,7 +30,7 @@ sidebar_label: "AccessKeyPermission" *Inherited from [Enum](_utils_enums_.enum.md).[constructor](_utils_enums_.enum.md#constructor)* -*Defined in [src.ts/utils/enums.ts:4](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L4)* +*Defined in [src.ts/utils/enums.ts:4](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L4)* **Parameters:** @@ -48,7 +48,7 @@ Name | Type | *Inherited from [Enum](_utils_enums_.enum.md).[enum](_utils_enums_.enum.md#enum)* -*Defined in [src.ts/utils/enums.ts:4](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L4)* +*Defined in [src.ts/utils/enums.ts:4](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L4)* ___ @@ -56,7 +56,7 @@ ___ • **fullAccess**: *[FullAccessPermission](_transaction_.fullaccesspermission.md)* -*Defined in [src.ts/transaction.ts:21](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L21)* +*Defined in [src.ts/transaction.ts:21](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L21)* ___ @@ -64,4 +64,4 @@ ___ • **functionCall**: *[FunctionCallPermission](_transaction_.functioncallpermission.md)* -*Defined in [src.ts/transaction.ts:20](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L20)* +*Defined in [src.ts/transaction.ts:20](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L20)* diff --git a/docs/nearlib/classes/_transaction_.action.md b/docs/nearlib/classes/_transaction_.action.md index fcd9f45480..ede2559a40 100644 --- a/docs/nearlib/classes/_transaction_.action.md +++ b/docs/nearlib/classes/_transaction_.action.md @@ -36,7 +36,7 @@ sidebar_label: "Action" *Inherited from [Enum](_utils_enums_.enum.md).[constructor](_utils_enums_.enum.md#constructor)* -*Defined in [src.ts/utils/enums.ts:4](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L4)* +*Defined in [src.ts/utils/enums.ts:4](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L4)* **Parameters:** @@ -52,7 +52,7 @@ Name | Type | • **addKey**: *[AddKey](_transaction_.addkey.md)* -*Defined in [src.ts/transaction.ts:114](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L114)* +*Defined in [src.ts/transaction.ts:121](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L121)* ___ @@ -60,7 +60,7 @@ ___ • **createAccount**: *[CreateAccount](_transaction_.createaccount.md)* -*Defined in [src.ts/transaction.ts:109](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L109)* +*Defined in [src.ts/transaction.ts:116](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L116)* ___ @@ -68,7 +68,7 @@ ___ • **deleteAccount**: *[DeleteAccount](_transaction_.deleteaccount.md)* -*Defined in [src.ts/transaction.ts:116](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L116)* +*Defined in [src.ts/transaction.ts:123](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L123)* ___ @@ -76,7 +76,7 @@ ___ • **deleteKey**: *[DeleteKey](_transaction_.deletekey.md)* -*Defined in [src.ts/transaction.ts:115](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L115)* +*Defined in [src.ts/transaction.ts:122](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L122)* ___ @@ -84,7 +84,7 @@ ___ • **deployContract**: *[DeployContract](_transaction_.deploycontract.md)* -*Defined in [src.ts/transaction.ts:110](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L110)* +*Defined in [src.ts/transaction.ts:117](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L117)* ___ @@ -94,7 +94,7 @@ ___ *Inherited from [Enum](_utils_enums_.enum.md).[enum](_utils_enums_.enum.md#enum)* -*Defined in [src.ts/utils/enums.ts:4](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L4)* +*Defined in [src.ts/utils/enums.ts:4](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L4)* ___ @@ -102,7 +102,7 @@ ___ • **functionCall**: *[FunctionCall](_transaction_.functioncall.md)* -*Defined in [src.ts/transaction.ts:111](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L111)* +*Defined in [src.ts/transaction.ts:118](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L118)* ___ @@ -110,7 +110,7 @@ ___ • **stake**: *[Stake](_transaction_.stake.md)* -*Defined in [src.ts/transaction.ts:113](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L113)* +*Defined in [src.ts/transaction.ts:120](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L120)* ___ @@ -118,4 +118,4 @@ ___ • **transfer**: *[Transfer](_transaction_.transfer.md)* -*Defined in [src.ts/transaction.ts:112](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L112)* +*Defined in [src.ts/transaction.ts:119](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L119)* diff --git a/docs/nearlib/classes/_transaction_.addkey.md b/docs/nearlib/classes/_transaction_.addkey.md index 194b27287b..06d4f1baf6 100644 --- a/docs/nearlib/classes/_transaction_.addkey.md +++ b/docs/nearlib/classes/_transaction_.addkey.md @@ -29,7 +29,7 @@ sidebar_label: "AddKey" *Inherited from [Assignable](_utils_enums_.assignable.md).[constructor](_utils_enums_.assignable.md#constructor)* -*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L17)* +*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L17)* **Parameters:** @@ -45,7 +45,7 @@ Name | Type | • **accessKey**: *[AccessKey](_transaction_.accesskey.md)* -*Defined in [src.ts/transaction.ts:44](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L44)* +*Defined in [src.ts/transaction.ts:44](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L44)* ___ @@ -53,4 +53,4 @@ ___ • **publicKey**: *[PublicKey](_utils_key_pair_.publickey.md)* -*Defined in [src.ts/transaction.ts:44](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L44)* +*Defined in [src.ts/transaction.ts:44](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L44)* diff --git a/docs/nearlib/classes/_transaction_.createaccount.md b/docs/nearlib/classes/_transaction_.createaccount.md index 6fab9522db..4960da89f2 100644 --- a/docs/nearlib/classes/_transaction_.createaccount.md +++ b/docs/nearlib/classes/_transaction_.createaccount.md @@ -24,7 +24,7 @@ sidebar_label: "CreateAccount" *Inherited from [Assignable](_utils_enums_.assignable.md).[constructor](_utils_enums_.assignable.md#constructor)* -*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L17)* +*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L17)* **Parameters:** diff --git a/docs/nearlib/classes/_transaction_.deleteaccount.md b/docs/nearlib/classes/_transaction_.deleteaccount.md index 7063089c65..b58ea390a9 100644 --- a/docs/nearlib/classes/_transaction_.deleteaccount.md +++ b/docs/nearlib/classes/_transaction_.deleteaccount.md @@ -28,7 +28,7 @@ sidebar_label: "DeleteAccount" *Inherited from [Assignable](_utils_enums_.assignable.md).[constructor](_utils_enums_.assignable.md#constructor)* -*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L17)* +*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L17)* **Parameters:** @@ -44,4 +44,4 @@ Name | Type | • **beneficiaryId**: *string* -*Defined in [src.ts/transaction.ts:46](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L46)* +*Defined in [src.ts/transaction.ts:46](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L46)* diff --git a/docs/nearlib/classes/_transaction_.deletekey.md b/docs/nearlib/classes/_transaction_.deletekey.md index c02867f026..8003e4e866 100644 --- a/docs/nearlib/classes/_transaction_.deletekey.md +++ b/docs/nearlib/classes/_transaction_.deletekey.md @@ -28,7 +28,7 @@ sidebar_label: "DeleteKey" *Inherited from [Assignable](_utils_enums_.assignable.md).[constructor](_utils_enums_.assignable.md#constructor)* -*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L17)* +*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L17)* **Parameters:** @@ -44,4 +44,4 @@ Name | Type | • **publicKey**: *[PublicKey](_utils_key_pair_.publickey.md)* -*Defined in [src.ts/transaction.ts:45](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L45)* +*Defined in [src.ts/transaction.ts:45](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L45)* diff --git a/docs/nearlib/classes/_transaction_.deploycontract.md b/docs/nearlib/classes/_transaction_.deploycontract.md index 9ab59d5b96..ea5035f504 100644 --- a/docs/nearlib/classes/_transaction_.deploycontract.md +++ b/docs/nearlib/classes/_transaction_.deploycontract.md @@ -28,7 +28,7 @@ sidebar_label: "DeployContract" *Inherited from [Assignable](_utils_enums_.assignable.md).[constructor](_utils_enums_.assignable.md#constructor)* -*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L17)* +*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L17)* **Parameters:** @@ -44,4 +44,4 @@ Name | Type | • **code**: *Uint8Array* -*Defined in [src.ts/transaction.ts:40](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L40)* +*Defined in [src.ts/transaction.ts:40](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L40)* diff --git a/docs/nearlib/classes/_transaction_.fullaccesspermission.md b/docs/nearlib/classes/_transaction_.fullaccesspermission.md index acf784e472..758f2e6dd7 100644 --- a/docs/nearlib/classes/_transaction_.fullaccesspermission.md +++ b/docs/nearlib/classes/_transaction_.fullaccesspermission.md @@ -24,7 +24,7 @@ sidebar_label: "FullAccessPermission" *Inherited from [Assignable](_utils_enums_.assignable.md).[constructor](_utils_enums_.assignable.md#constructor)* -*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L17)* +*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L17)* **Parameters:** diff --git a/docs/nearlib/classes/_transaction_.functioncall.md b/docs/nearlib/classes/_transaction_.functioncall.md index 10cdf40694..cb173f6e2b 100644 --- a/docs/nearlib/classes/_transaction_.functioncall.md +++ b/docs/nearlib/classes/_transaction_.functioncall.md @@ -31,7 +31,7 @@ sidebar_label: "FunctionCall" *Inherited from [Assignable](_utils_enums_.assignable.md).[constructor](_utils_enums_.assignable.md#constructor)* -*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L17)* +*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L17)* **Parameters:** @@ -47,7 +47,7 @@ Name | Type | • **args**: *Uint8Array* -*Defined in [src.ts/transaction.ts:41](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L41)* +*Defined in [src.ts/transaction.ts:41](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L41)* ___ @@ -55,7 +55,7 @@ ___ • **deposit**: *BN* -*Defined in [src.ts/transaction.ts:41](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L41)* +*Defined in [src.ts/transaction.ts:41](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L41)* ___ @@ -63,7 +63,7 @@ ___ • **gas**: *BN* -*Defined in [src.ts/transaction.ts:41](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L41)* +*Defined in [src.ts/transaction.ts:41](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L41)* ___ @@ -71,4 +71,4 @@ ___ • **methodName**: *string* -*Defined in [src.ts/transaction.ts:41](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L41)* +*Defined in [src.ts/transaction.ts:41](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L41)* diff --git a/docs/nearlib/classes/_transaction_.functioncallpermission.md b/docs/nearlib/classes/_transaction_.functioncallpermission.md index 7bd4ca6f96..c495cf0f1a 100644 --- a/docs/nearlib/classes/_transaction_.functioncallpermission.md +++ b/docs/nearlib/classes/_transaction_.functioncallpermission.md @@ -30,7 +30,7 @@ sidebar_label: "FunctionCallPermission" *Inherited from [Assignable](_utils_enums_.assignable.md).[constructor](_utils_enums_.assignable.md#constructor)* -*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L17)* +*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L17)* **Parameters:** @@ -46,7 +46,7 @@ Name | Type | • **allowance**? : *BN* -*Defined in [src.ts/transaction.ts:12](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L12)* +*Defined in [src.ts/transaction.ts:12](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L12)* ___ @@ -54,7 +54,7 @@ ___ • **methodNames**: *String[]* -*Defined in [src.ts/transaction.ts:14](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L14)* +*Defined in [src.ts/transaction.ts:14](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L14)* ___ @@ -62,4 +62,4 @@ ___ • **receiverId**: *string* -*Defined in [src.ts/transaction.ts:13](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L13)* +*Defined in [src.ts/transaction.ts:13](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L13)* diff --git a/docs/nearlib/classes/_transaction_.iaction.md b/docs/nearlib/classes/_transaction_.iaction.md index cfbc0981fe..67c6f54f07 100644 --- a/docs/nearlib/classes/_transaction_.iaction.md +++ b/docs/nearlib/classes/_transaction_.iaction.md @@ -40,7 +40,7 @@ sidebar_label: "IAction" *Inherited from [Assignable](_utils_enums_.assignable.md).[constructor](_utils_enums_.assignable.md#constructor)* -*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L17)* +*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L17)* **Parameters:** diff --git a/docs/nearlib/classes/_transaction_.signature.md b/docs/nearlib/classes/_transaction_.signature.md index 43d7ec5f92..68005f122b 100644 --- a/docs/nearlib/classes/_transaction_.signature.md +++ b/docs/nearlib/classes/_transaction_.signature.md @@ -6,7 +6,9 @@ sidebar_label: "Signature" ## Hierarchy -* **Signature** +* [Assignable](_utils_enums_.assignable.md) + + ↳ **Signature** ## Index @@ -23,15 +25,17 @@ sidebar_label: "Signature" ### constructor -\+ **new Signature**(`signature`: Uint8Array): *[Signature](_transaction_.signature.md)* +\+ **new Signature**(`properties`: any): *[Signature](_transaction_.signature.md)* + +*Inherited from [Assignable](_utils_enums_.assignable.md).[constructor](_utils_enums_.assignable.md#constructor)* -*Defined in [src.ts/transaction.ts:82](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L82)* +*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L17)* **Parameters:** Name | Type | ------ | ------ | -`signature` | Uint8Array | +`properties` | any | **Returns:** *[Signature](_transaction_.signature.md)* @@ -41,7 +45,7 @@ Name | Type | • **data**: *Uint8Array* -*Defined in [src.ts/transaction.ts:82](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L82)* +*Defined in [src.ts/transaction.ts:82](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L82)* ___ @@ -49,4 +53,4 @@ ___ • **keyType**: *[KeyType](../enums/_utils_key_pair_.keytype.md)* -*Defined in [src.ts/transaction.ts:81](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L81)* +*Defined in [src.ts/transaction.ts:81](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L81)* diff --git a/docs/nearlib/classes/_transaction_.signedtransaction.md b/docs/nearlib/classes/_transaction_.signedtransaction.md index 4f59fab69d..6524cff7bf 100644 --- a/docs/nearlib/classes/_transaction_.signedtransaction.md +++ b/docs/nearlib/classes/_transaction_.signedtransaction.md @@ -24,6 +24,7 @@ sidebar_label: "SignedTransaction" ### Methods * [encode](_transaction_.signedtransaction.md#encode) +* [decode](_transaction_.signedtransaction.md#static-decode) ## Constructors @@ -33,7 +34,7 @@ sidebar_label: "SignedTransaction" *Inherited from [Assignable](_utils_enums_.assignable.md).[constructor](_utils_enums_.assignable.md#constructor)* -*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L17)* +*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L17)* **Parameters:** @@ -49,7 +50,7 @@ Name | Type | • **signature**: *[Signature](_transaction_.signature.md)* -*Defined in [src.ts/transaction.ts:101](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L101)* +*Defined in [src.ts/transaction.ts:104](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L104)* ___ @@ -57,7 +58,7 @@ ___ • **transaction**: *[Transaction](_transaction_.transaction.md)* -*Defined in [src.ts/transaction.ts:100](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L100)* +*Defined in [src.ts/transaction.ts:103](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L103)* ## Methods @@ -65,6 +66,22 @@ ___ ▸ **encode**(): *Uint8Array* -*Defined in [src.ts/transaction.ts:103](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L103)* +*Defined in [src.ts/transaction.ts:106](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L106)* **Returns:** *Uint8Array* + +___ + +### `Static` decode + +▸ **decode**(`bytes`: Buffer): *[SignedTransaction](_transaction_.signedtransaction.md)* + +*Defined in [src.ts/transaction.ts:110](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L110)* + +**Parameters:** + +Name | Type | +------ | ------ | +`bytes` | Buffer | + +**Returns:** *[SignedTransaction](_transaction_.signedtransaction.md)* diff --git a/docs/nearlib/classes/_transaction_.stake.md b/docs/nearlib/classes/_transaction_.stake.md index 01b3137b15..b0628b87a4 100644 --- a/docs/nearlib/classes/_transaction_.stake.md +++ b/docs/nearlib/classes/_transaction_.stake.md @@ -29,7 +29,7 @@ sidebar_label: "Stake" *Inherited from [Assignable](_utils_enums_.assignable.md).[constructor](_utils_enums_.assignable.md#constructor)* -*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L17)* +*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L17)* **Parameters:** @@ -45,7 +45,7 @@ Name | Type | • **publicKey**: *[PublicKey](_utils_key_pair_.publickey.md)* -*Defined in [src.ts/transaction.ts:43](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L43)* +*Defined in [src.ts/transaction.ts:43](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L43)* ___ @@ -53,4 +53,4 @@ ___ • **stake**: *BN* -*Defined in [src.ts/transaction.ts:43](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L43)* +*Defined in [src.ts/transaction.ts:43](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L43)* diff --git a/docs/nearlib/classes/_transaction_.transaction.md b/docs/nearlib/classes/_transaction_.transaction.md index 77acafaebd..b0aaa6b74a 100644 --- a/docs/nearlib/classes/_transaction_.transaction.md +++ b/docs/nearlib/classes/_transaction_.transaction.md @@ -25,6 +25,11 @@ sidebar_label: "Transaction" * [receiverId](_transaction_.transaction.md#receiverid) * [signerId](_transaction_.transaction.md#signerid) +### Methods + +* [encode](_transaction_.transaction.md#encode) +* [decode](_transaction_.transaction.md#static-decode) + ## Constructors ### constructor @@ -33,7 +38,7 @@ sidebar_label: "Transaction" *Inherited from [Assignable](_utils_enums_.assignable.md).[constructor](_utils_enums_.assignable.md#constructor)* -*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L17)* +*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L17)* **Parameters:** @@ -49,7 +54,7 @@ Name | Type | • **actions**: *[Action](_transaction_.action.md)[]* -*Defined in [src.ts/transaction.ts:95](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L95)* +*Defined in [src.ts/transaction.ts:90](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L90)* ___ @@ -57,7 +62,7 @@ ___ • **blockHash**: *Uint8Array* -*Defined in [src.ts/transaction.ts:96](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L96)* +*Defined in [src.ts/transaction.ts:91](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L91)* ___ @@ -65,7 +70,7 @@ ___ • **nonce**: *number* -*Defined in [src.ts/transaction.ts:93](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L93)* +*Defined in [src.ts/transaction.ts:88](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L88)* ___ @@ -73,7 +78,7 @@ ___ • **publicKey**: *[PublicKey](_utils_key_pair_.publickey.md)* -*Defined in [src.ts/transaction.ts:92](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L92)* +*Defined in [src.ts/transaction.ts:87](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L87)* ___ @@ -81,7 +86,7 @@ ___ • **receiverId**: *string* -*Defined in [src.ts/transaction.ts:94](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L94)* +*Defined in [src.ts/transaction.ts:89](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L89)* ___ @@ -89,4 +94,30 @@ ___ • **signerId**: *string* -*Defined in [src.ts/transaction.ts:91](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L91)* +*Defined in [src.ts/transaction.ts:86](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L86)* + +## Methods + +### encode + +▸ **encode**(): *Uint8Array* + +*Defined in [src.ts/transaction.ts:93](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L93)* + +**Returns:** *Uint8Array* + +___ + +### `Static` decode + +▸ **decode**(`bytes`: Buffer): *[Transaction](_transaction_.transaction.md)* + +*Defined in [src.ts/transaction.ts:97](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L97)* + +**Parameters:** + +Name | Type | +------ | ------ | +`bytes` | Buffer | + +**Returns:** *[Transaction](_transaction_.transaction.md)* diff --git a/docs/nearlib/classes/_transaction_.transfer.md b/docs/nearlib/classes/_transaction_.transfer.md index dec593c75d..3bace73b98 100644 --- a/docs/nearlib/classes/_transaction_.transfer.md +++ b/docs/nearlib/classes/_transaction_.transfer.md @@ -28,7 +28,7 @@ sidebar_label: "Transfer" *Inherited from [Assignable](_utils_enums_.assignable.md).[constructor](_utils_enums_.assignable.md#constructor)* -*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L17)* +*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L17)* **Parameters:** @@ -44,4 +44,4 @@ Name | Type | • **deposit**: *BN* -*Defined in [src.ts/transaction.ts:42](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L42)* +*Defined in [src.ts/transaction.ts:42](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L42)* diff --git a/docs/nearlib/classes/_utils_enums_.assignable.md b/docs/nearlib/classes/_utils_enums_.assignable.md index 18388ee6c5..4e898473c9 100644 --- a/docs/nearlib/classes/_utils_enums_.assignable.md +++ b/docs/nearlib/classes/_utils_enums_.assignable.md @@ -18,6 +18,8 @@ sidebar_label: "Assignable" ↳ [IAction](_transaction_.iaction.md) + ↳ [Signature](_transaction_.signature.md) + ↳ [Transaction](_transaction_.transaction.md) ↳ [SignedTransaction](_transaction_.signedtransaction.md) @@ -34,7 +36,7 @@ sidebar_label: "Assignable" \+ **new Assignable**(`properties`: any): *[Assignable](_utils_enums_.assignable.md)* -*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L17)* +*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L17)* **Parameters:** diff --git a/docs/nearlib/classes/_utils_enums_.enum.md b/docs/nearlib/classes/_utils_enums_.enum.md index 4528ab3fc5..daf9d9b9e8 100644 --- a/docs/nearlib/classes/_utils_enums_.enum.md +++ b/docs/nearlib/classes/_utils_enums_.enum.md @@ -28,7 +28,7 @@ sidebar_label: "Enum" \+ **new Enum**(`properties`: any): *[Enum](_utils_enums_.enum.md)* -*Defined in [src.ts/utils/enums.ts:4](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L4)* +*Defined in [src.ts/utils/enums.ts:4](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L4)* **Parameters:** @@ -44,4 +44,4 @@ Name | Type | • **enum**: *string* -*Defined in [src.ts/utils/enums.ts:4](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L4)* +*Defined in [src.ts/utils/enums.ts:4](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L4)* diff --git a/docs/nearlib/classes/_utils_errors_.argumenttypeerror.md b/docs/nearlib/classes/_utils_errors_.argumenttypeerror.md new file mode 100644 index 0000000000..50bad9e0c3 --- /dev/null +++ b/docs/nearlib/classes/_utils_errors_.argumenttypeerror.md @@ -0,0 +1,82 @@ +--- +id: "_utils_errors_.argumenttypeerror" +title: "ArgumentTypeError" +sidebar_label: "ArgumentTypeError" +--- + +## Hierarchy + +* Error + + ↳ **ArgumentTypeError** + +## Index + +### Constructors + +* [constructor](_utils_errors_.argumenttypeerror.md#constructor) + +### Properties + +* [message](_utils_errors_.argumenttypeerror.md#message) +* [name](_utils_errors_.argumenttypeerror.md#name) +* [stack](_utils_errors_.argumenttypeerror.md#optional-stack) +* [Error](_utils_errors_.argumenttypeerror.md#static-error) + +## Constructors + +### constructor + +\+ **new ArgumentTypeError**(`argName`: string, `argType`: string, `argValue`: any): *[ArgumentTypeError](_utils_errors_.argumenttypeerror.md)* + +*Defined in [src.ts/utils/errors.ts:7](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/errors.ts#L7)* + +**Parameters:** + +Name | Type | +------ | ------ | +`argName` | string | +`argType` | string | +`argValue` | any | + +**Returns:** *[ArgumentTypeError](_utils_errors_.argumenttypeerror.md)* + +## Properties + +### message + +• **message**: *string* + +*Inherited from void* + +Defined in node_modules/typescript/lib/lib.es5.d.ts:974 + +___ + +### name + +• **name**: *string* + +*Inherited from void* + +Defined in node_modules/typescript/lib/lib.es5.d.ts:973 + +___ + +### `Optional` stack + +• **stack**? : *string* + +*Inherited from void* + +*Overrides void* + +Defined in node_modules/typescript/lib/lib.es5.d.ts:975 + +___ + +### `Static` Error + +▪ **Error**: *ErrorConstructor* + +Defined in node_modules/typescript/lib/lib.es5.d.ts:984 diff --git a/docs/nearlib/classes/_utils_errors_.positionalargserror.md b/docs/nearlib/classes/_utils_errors_.positionalargserror.md new file mode 100644 index 0000000000..3e94a08584 --- /dev/null +++ b/docs/nearlib/classes/_utils_errors_.positionalargserror.md @@ -0,0 +1,74 @@ +--- +id: "_utils_errors_.positionalargserror" +title: "PositionalArgsError" +sidebar_label: "PositionalArgsError" +--- + +## Hierarchy + +* Error + + ↳ **PositionalArgsError** + +## Index + +### Constructors + +* [constructor](_utils_errors_.positionalargserror.md#constructor) + +### Properties + +* [message](_utils_errors_.positionalargserror.md#message) +* [name](_utils_errors_.positionalargserror.md#name) +* [stack](_utils_errors_.positionalargserror.md#optional-stack) +* [Error](_utils_errors_.positionalargserror.md#static-error) + +## Constructors + +### constructor + +\+ **new PositionalArgsError**(): *[PositionalArgsError](_utils_errors_.positionalargserror.md)* + +*Defined in [src.ts/utils/errors.ts:1](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/errors.ts#L1)* + +**Returns:** *[PositionalArgsError](_utils_errors_.positionalargserror.md)* + +## Properties + +### message + +• **message**: *string* + +*Inherited from void* + +Defined in node_modules/typescript/lib/lib.es5.d.ts:974 + +___ + +### name + +• **name**: *string* + +*Inherited from void* + +Defined in node_modules/typescript/lib/lib.es5.d.ts:973 + +___ + +### `Optional` stack + +• **stack**? : *string* + +*Inherited from void* + +*Overrides void* + +Defined in node_modules/typescript/lib/lib.es5.d.ts:975 + +___ + +### `Static` Error + +▪ **Error**: *ErrorConstructor* + +Defined in node_modules/typescript/lib/lib.es5.d.ts:984 diff --git a/docs/nearlib/classes/_utils_key_pair_.keypair.md b/docs/nearlib/classes/_utils_key_pair_.keypair.md index 1c2f23d253..3ae226cc70 100644 --- a/docs/nearlib/classes/_utils_key_pair_.keypair.md +++ b/docs/nearlib/classes/_utils_key_pair_.keypair.md @@ -27,7 +27,7 @@ sidebar_label: "KeyPair" ▸ **getPublicKey**(): *[PublicKey](_utils_key_pair_.publickey.md)* -*Defined in [src.ts/utils/key_pair.ts:67](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L67)* +*Defined in [src.ts/utils/key_pair.ts:67](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L67)* **Returns:** *[PublicKey](_utils_key_pair_.publickey.md)* @@ -37,7 +37,7 @@ ___ ▸ **sign**(`message`: Uint8Array): *[Signature](../interfaces/_utils_key_pair_.signature.md)* -*Defined in [src.ts/utils/key_pair.ts:64](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L64)* +*Defined in [src.ts/utils/key_pair.ts:64](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L64)* **Parameters:** @@ -53,7 +53,7 @@ ___ ▸ **toString**(): *string* -*Defined in [src.ts/utils/key_pair.ts:66](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L66)* +*Defined in [src.ts/utils/key_pair.ts:66](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L66)* **Returns:** *string* @@ -63,7 +63,7 @@ ___ ▸ **verify**(`message`: Uint8Array, `signature`: Uint8Array): *boolean* -*Defined in [src.ts/utils/key_pair.ts:65](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L65)* +*Defined in [src.ts/utils/key_pair.ts:65](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L65)* **Parameters:** @@ -80,7 +80,7 @@ ___ ▸ **fromRandom**(`curve`: string): *[KeyPair](_utils_key_pair_.keypair.md)* -*Defined in [src.ts/utils/key_pair.ts:69](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L69)* +*Defined in [src.ts/utils/key_pair.ts:69](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L69)* **Parameters:** @@ -96,7 +96,7 @@ ___ ▸ **fromString**(`encodedKey`: string): *[KeyPair](_utils_key_pair_.keypair.md)* -*Defined in [src.ts/utils/key_pair.ts:76](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L76)* +*Defined in [src.ts/utils/key_pair.ts:76](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L76)* **Parameters:** diff --git a/docs/nearlib/classes/_utils_key_pair_.keypaired25519.md b/docs/nearlib/classes/_utils_key_pair_.keypaired25519.md index cd85d70ef9..8b6d307257 100644 --- a/docs/nearlib/classes/_utils_key_pair_.keypaired25519.md +++ b/docs/nearlib/classes/_utils_key_pair_.keypaired25519.md @@ -39,7 +39,7 @@ generating key pairs, encoding key pairs, signing and verifying. \+ **new KeyPairEd25519**(`secretKey`: string): *[KeyPairEd25519](_utils_key_pair_.keypaired25519.md)* -*Defined in [src.ts/utils/key_pair.ts:97](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L97)* +*Defined in [src.ts/utils/key_pair.ts:97](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L97)* Construct an instance of key pair given a secret key. It's generally assumed that these are encoded in base58. @@ -58,7 +58,7 @@ Name | Type | Description | • **publicKey**: *[PublicKey](_utils_key_pair_.publickey.md)* -*Defined in [src.ts/utils/key_pair.ts:96](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L96)* +*Defined in [src.ts/utils/key_pair.ts:96](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L96)* ___ @@ -66,7 +66,7 @@ ___ • **secretKey**: *string* -*Defined in [src.ts/utils/key_pair.ts:97](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L97)* +*Defined in [src.ts/utils/key_pair.ts:97](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L97)* ## Methods @@ -76,7 +76,7 @@ ___ *Overrides [KeyPair](_utils_key_pair_.keypair.md).[getPublicKey](_utils_key_pair_.keypair.md#abstract-getpublickey)* -*Defined in [src.ts/utils/key_pair.ts:139](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L139)* +*Defined in [src.ts/utils/key_pair.ts:139](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L139)* **Returns:** *[PublicKey](_utils_key_pair_.publickey.md)* @@ -88,7 +88,7 @@ ___ *Overrides [KeyPair](_utils_key_pair_.keypair.md).[sign](_utils_key_pair_.keypair.md#abstract-sign)* -*Defined in [src.ts/utils/key_pair.ts:126](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L126)* +*Defined in [src.ts/utils/key_pair.ts:126](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L126)* **Parameters:** @@ -106,7 +106,7 @@ ___ *Overrides [KeyPair](_utils_key_pair_.keypair.md).[toString](_utils_key_pair_.keypair.md#abstract-tostring)* -*Defined in [src.ts/utils/key_pair.ts:135](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L135)* +*Defined in [src.ts/utils/key_pair.ts:135](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L135)* **Returns:** *string* @@ -118,7 +118,7 @@ ___ *Overrides [KeyPair](_utils_key_pair_.keypair.md).[verify](_utils_key_pair_.keypair.md#abstract-verify)* -*Defined in [src.ts/utils/key_pair.ts:131](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L131)* +*Defined in [src.ts/utils/key_pair.ts:131](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L131)* **Parameters:** @@ -137,7 +137,7 @@ ___ *Overrides [KeyPair](_utils_key_pair_.keypair.md).[fromRandom](_utils_key_pair_.keypair.md#static-fromrandom)* -*Defined in [src.ts/utils/key_pair.ts:121](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L121)* +*Defined in [src.ts/utils/key_pair.ts:121](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L121)* Generate a new random keypair. @@ -159,7 +159,7 @@ ___ *Inherited from [KeyPair](_utils_key_pair_.keypair.md).[fromString](_utils_key_pair_.keypair.md#static-fromstring)* -*Defined in [src.ts/utils/key_pair.ts:76](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L76)* +*Defined in [src.ts/utils/key_pair.ts:76](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L76)* **Parameters:** diff --git a/docs/nearlib/classes/_utils_key_pair_.publickey.md b/docs/nearlib/classes/_utils_key_pair_.publickey.md index 4cf18cb734..ac696b21fd 100644 --- a/docs/nearlib/classes/_utils_key_pair_.publickey.md +++ b/docs/nearlib/classes/_utils_key_pair_.publickey.md @@ -37,7 +37,7 @@ PublicKey representation that has type and bytes of the key. *Inherited from [Assignable](_utils_enums_.assignable.md).[constructor](_utils_enums_.assignable.md#constructor)* -*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/enums.ts#L17)* +*Defined in [src.ts/utils/enums.ts:17](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/enums.ts#L17)* **Parameters:** @@ -53,7 +53,7 @@ Name | Type | • **data**: *Uint8Array* -*Defined in [src.ts/utils/key_pair.ts:38](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L38)* +*Defined in [src.ts/utils/key_pair.ts:38](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L38)* ___ @@ -61,7 +61,7 @@ ___ • **keyType**: *[KeyType](../enums/_utils_key_pair_.keytype.md)* -*Defined in [src.ts/utils/key_pair.ts:37](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L37)* +*Defined in [src.ts/utils/key_pair.ts:37](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L37)* ## Methods @@ -69,7 +69,7 @@ ___ ▸ **toString**(): *string* -*Defined in [src.ts/utils/key_pair.ts:58](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L58)* +*Defined in [src.ts/utils/key_pair.ts:58](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L58)* **Returns:** *string* @@ -79,7 +79,7 @@ ___ ▸ **from**(`value`: string | [PublicKey](_utils_key_pair_.publickey.md)): *[PublicKey](_utils_key_pair_.publickey.md)* -*Defined in [src.ts/utils/key_pair.ts:40](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L40)* +*Defined in [src.ts/utils/key_pair.ts:40](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L40)* **Parameters:** @@ -95,7 +95,7 @@ ___ ▸ **fromString**(`encodedKey`: string): *[PublicKey](_utils_key_pair_.publickey.md)* -*Defined in [src.ts/utils/key_pair.ts:47](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L47)* +*Defined in [src.ts/utils/key_pair.ts:47](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L47)* **Parameters:** diff --git a/docs/nearlib/classes/_utils_serialize_.binaryreader.md b/docs/nearlib/classes/_utils_serialize_.binaryreader.md index f9b766edbb..4fa0286134 100644 --- a/docs/nearlib/classes/_utils_serialize_.binaryreader.md +++ b/docs/nearlib/classes/_utils_serialize_.binaryreader.md @@ -36,7 +36,7 @@ sidebar_label: "BinaryReader" \+ **new BinaryReader**(`buf`: Buffer): *[BinaryReader](_utils_serialize_.binaryreader.md)* -*Defined in [src.ts/utils/serialize.ts:133](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L133)* +*Defined in [src.ts/utils/serialize.ts:130](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L130)* **Parameters:** @@ -52,7 +52,7 @@ Name | Type | • **buf**: *Buffer* -*Defined in [src.ts/utils/serialize.ts:132](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L132)* +*Defined in [src.ts/utils/serialize.ts:129](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L129)* ___ @@ -60,7 +60,7 @@ ___ • **offset**: *number* -*Defined in [src.ts/utils/serialize.ts:133](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L133)* +*Defined in [src.ts/utils/serialize.ts:130](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L130)* ## Methods @@ -68,7 +68,7 @@ ___ ▸ **read_array**(`fn`: any): *any[]* -*Defined in [src.ts/utils/serialize.ts:193](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L193)* +*Defined in [src.ts/utils/serialize.ts:190](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L190)* **Parameters:** @@ -84,7 +84,7 @@ ___ ▸ **read_buffer**(`len`: number): *Buffer* -*Defined in [src.ts/utils/serialize.ts:166](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L166)* +*Defined in [src.ts/utils/serialize.ts:163](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L163)* **Parameters:** @@ -100,7 +100,7 @@ ___ ▸ **read_fixed_array**(`len`: number): *Uint8Array* -*Defined in [src.ts/utils/serialize.ts:188](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L188)* +*Defined in [src.ts/utils/serialize.ts:185](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L185)* **Parameters:** @@ -116,7 +116,7 @@ ___ ▸ **read_string**(): *string* -*Defined in [src.ts/utils/serialize.ts:176](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L176)* +*Defined in [src.ts/utils/serialize.ts:173](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L173)* **Returns:** *string* @@ -126,7 +126,7 @@ ___ ▸ **read_u128**(): *BN* -*Defined in [src.ts/utils/serialize.ts:161](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L161)* +*Defined in [src.ts/utils/serialize.ts:158](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L158)* **Returns:** *BN* @@ -136,7 +136,7 @@ ___ ▸ **read_u32**(): *number* -*Defined in [src.ts/utils/serialize.ts:148](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L148)* +*Defined in [src.ts/utils/serialize.ts:145](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L145)* **Returns:** *number* @@ -146,7 +146,7 @@ ___ ▸ **read_u64**(): *BN* -*Defined in [src.ts/utils/serialize.ts:155](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L155)* +*Defined in [src.ts/utils/serialize.ts:152](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L152)* **Returns:** *BN* @@ -156,6 +156,6 @@ ___ ▸ **read_u8**(): *number* -*Defined in [src.ts/utils/serialize.ts:141](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L141)* +*Defined in [src.ts/utils/serialize.ts:138](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L138)* **Returns:** *number* diff --git a/docs/nearlib/classes/_utils_serialize_.binarywriter.md b/docs/nearlib/classes/_utils_serialize_.binarywriter.md index f49545433e..455e5a39e1 100644 --- a/docs/nearlib/classes/_utils_serialize_.binarywriter.md +++ b/docs/nearlib/classes/_utils_serialize_.binarywriter.md @@ -38,7 +38,7 @@ sidebar_label: "BinaryWriter" \+ **new BinaryWriter**(): *[BinaryWriter](_utils_serialize_.binarywriter.md)* -*Defined in [src.ts/utils/serialize.ts:48](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L48)* +*Defined in [src.ts/utils/serialize.ts:45](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L45)* **Returns:** *[BinaryWriter](_utils_serialize_.binarywriter.md)* @@ -48,7 +48,7 @@ sidebar_label: "BinaryWriter" • **buf**: *Buffer* -*Defined in [src.ts/utils/serialize.ts:47](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L47)* +*Defined in [src.ts/utils/serialize.ts:44](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L44)* ___ @@ -56,7 +56,7 @@ ___ • **length**: *number* -*Defined in [src.ts/utils/serialize.ts:48](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L48)* +*Defined in [src.ts/utils/serialize.ts:45](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L45)* ## Methods @@ -64,7 +64,7 @@ ___ ▸ **maybe_resize**(): *void* -*Defined in [src.ts/utils/serialize.ts:55](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L55)* +*Defined in [src.ts/utils/serialize.ts:52](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L52)* **Returns:** *void* @@ -74,7 +74,7 @@ ___ ▸ **toArray**(): *Uint8Array* -*Defined in [src.ts/utils/serialize.ts:109](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L109)* +*Defined in [src.ts/utils/serialize.ts:106](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L106)* **Returns:** *Uint8Array* @@ -84,7 +84,7 @@ ___ ▸ **write_array**(`array`: any[], `fn`: any): *void* -*Defined in [src.ts/utils/serialize.ts:100](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L100)* +*Defined in [src.ts/utils/serialize.ts:97](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L97)* **Parameters:** @@ -101,7 +101,7 @@ ___ ▸ **write_buffer**(`buffer`: Buffer): *void* -*Defined in [src.ts/utils/serialize.ts:83](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L83)* +*Defined in [src.ts/utils/serialize.ts:80](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L80)* **Parameters:** @@ -117,7 +117,7 @@ ___ ▸ **write_fixed_array**(`array`: Uint8Array): *void* -*Defined in [src.ts/utils/serialize.ts:96](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L96)* +*Defined in [src.ts/utils/serialize.ts:93](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L93)* **Parameters:** @@ -133,7 +133,7 @@ ___ ▸ **write_string**(`str`: string): *void* -*Defined in [src.ts/utils/serialize.ts:89](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L89)* +*Defined in [src.ts/utils/serialize.ts:86](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L86)* **Parameters:** @@ -149,7 +149,7 @@ ___ ▸ **write_u128**(`value`: BN): *void* -*Defined in [src.ts/utils/serialize.ts:78](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L78)* +*Defined in [src.ts/utils/serialize.ts:75](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L75)* **Parameters:** @@ -165,7 +165,7 @@ ___ ▸ **write_u32**(`value`: number): *void* -*Defined in [src.ts/utils/serialize.ts:67](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L67)* +*Defined in [src.ts/utils/serialize.ts:64](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L64)* **Parameters:** @@ -181,7 +181,7 @@ ___ ▸ **write_u64**(`value`: BN): *void* -*Defined in [src.ts/utils/serialize.ts:73](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L73)* +*Defined in [src.ts/utils/serialize.ts:70](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L70)* **Parameters:** @@ -197,7 +197,7 @@ ___ ▸ **write_u8**(`value`: number): *void* -*Defined in [src.ts/utils/serialize.ts:61](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L61)* +*Defined in [src.ts/utils/serialize.ts:58](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L58)* **Parameters:** diff --git a/docs/nearlib/classes/_utils_serialize_.borsherror.md b/docs/nearlib/classes/_utils_serialize_.borsherror.md index 20db444a9b..703adb4f0b 100644 --- a/docs/nearlib/classes/_utils_serialize_.borsherror.md +++ b/docs/nearlib/classes/_utils_serialize_.borsherror.md @@ -35,7 +35,7 @@ sidebar_label: "BorshError" \+ **new BorshError**(`message`: string): *[BorshError](_utils_serialize_.borsherror.md)* -*Defined in [src.ts/utils/serialize.ts:31](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L31)* +*Defined in [src.ts/utils/serialize.ts:28](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L28)* **Parameters:** @@ -51,7 +51,7 @@ Name | Type | • **fieldPath**: *string[]* = [] -*Defined in [src.ts/utils/serialize.ts:31](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L31)* +*Defined in [src.ts/utils/serialize.ts:28](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L28)* ___ @@ -79,7 +79,7 @@ ___ • **originalMessage**: *string* -*Defined in [src.ts/utils/serialize.ts:30](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L30)* +*Defined in [src.ts/utils/serialize.ts:27](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L27)* ___ @@ -107,7 +107,7 @@ Defined in node_modules/typescript/lib/lib.es5.d.ts:984 ▸ **addToFieldPath**(`fieldName`: string): *void* -*Defined in [src.ts/utils/serialize.ts:38](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L38)* +*Defined in [src.ts/utils/serialize.ts:35](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L35)* **Parameters:** diff --git a/docs/nearlib/classes/_wallet_account_.walletaccount.md b/docs/nearlib/classes/_wallet_account_.walletaccount.md index 365a9ff342..988fa299b7 100644 --- a/docs/nearlib/classes/_wallet_account_.walletaccount.md +++ b/docs/nearlib/classes/_wallet_account_.walletaccount.md @@ -37,7 +37,7 @@ sidebar_label: "WalletAccount" \+ **new WalletAccount**(`near`: [Near](_near_.near.md), `appKeyPrefix`: string | null): *[WalletAccount](_wallet_account_.walletaccount.md)* -*Defined in [src.ts/wallet-account.ts:18](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/wallet-account.ts#L18)* +*Defined in [src.ts/wallet-account.ts:18](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/wallet-account.ts#L18)* **Parameters:** @@ -54,7 +54,7 @@ Name | Type | • **_authData**: *any* -*Defined in [src.ts/wallet-account.ts:17](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/wallet-account.ts#L17)* +*Defined in [src.ts/wallet-account.ts:17](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/wallet-account.ts#L17)* ___ @@ -62,7 +62,7 @@ ___ • **_authDataKey**: *string* -*Defined in [src.ts/wallet-account.ts:15](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/wallet-account.ts#L15)* +*Defined in [src.ts/wallet-account.ts:15](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/wallet-account.ts#L15)* ___ @@ -70,7 +70,7 @@ ___ • **_keyStore**: *[KeyStore](_key_stores_keystore_.keystore.md)* -*Defined in [src.ts/wallet-account.ts:16](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/wallet-account.ts#L16)* +*Defined in [src.ts/wallet-account.ts:16](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/wallet-account.ts#L16)* ___ @@ -78,7 +78,7 @@ ___ • **_networkId**: *string* -*Defined in [src.ts/wallet-account.ts:18](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/wallet-account.ts#L18)* +*Defined in [src.ts/wallet-account.ts:18](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/wallet-account.ts#L18)* ___ @@ -86,7 +86,7 @@ ___ • **_walletBaseUrl**: *string* -*Defined in [src.ts/wallet-account.ts:14](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/wallet-account.ts#L14)* +*Defined in [src.ts/wallet-account.ts:14](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/wallet-account.ts#L14)* ## Methods @@ -94,7 +94,7 @@ ___ ▸ **_completeSignInWithAccessKey**(): *Promise‹void›* -*Defined in [src.ts/wallet-account.ts:84](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/wallet-account.ts#L84)* +*Defined in [src.ts/wallet-account.ts:84](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/wallet-account.ts#L84)* Complete sign in for a given account id and public key. To be invoked by the app when getting a callback from the wallet. @@ -106,7 +106,7 @@ ___ ▸ **_moveKeyFromTempToPermanent**(`accountId`: string, `publicKey`: string): *Promise‹void›* -*Defined in [src.ts/wallet-account.ts:100](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/wallet-account.ts#L100)* +*Defined in [src.ts/wallet-account.ts:100](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/wallet-account.ts#L100)* **Parameters:** @@ -123,7 +123,7 @@ ___ ▸ **getAccountId**(): *any* -*Defined in [src.ts/wallet-account.ts:46](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/wallet-account.ts#L46)* +*Defined in [src.ts/wallet-account.ts:46](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/wallet-account.ts#L46)* Returns authorized Account ID. @@ -138,7 +138,7 @@ ___ ▸ **isSignedIn**(): *boolean* -*Defined in [src.ts/wallet-account.ts:37](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/wallet-account.ts#L37)* +*Defined in [src.ts/wallet-account.ts:37](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/wallet-account.ts#L37)* Returns true, if this WalletAccount is authorized with the wallet. @@ -153,7 +153,7 @@ ___ ▸ **requestSignIn**(`contractId`: string, `title`: string, `successUrl`: string, `failureUrl`: string): *Promise‹void›* -*Defined in [src.ts/wallet-account.ts:63](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/wallet-account.ts#L63)* +*Defined in [src.ts/wallet-account.ts:63](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/wallet-account.ts#L63)* Redirects current page to the wallet authentication page. @@ -181,7 +181,7 @@ ___ ▸ **signOut**(): *void* -*Defined in [src.ts/wallet-account.ts:111](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/wallet-account.ts#L111)* +*Defined in [src.ts/wallet-account.ts:111](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/wallet-account.ts#L111)* Sign out from the current account diff --git a/docs/nearlib/enums/_providers_provider_.executionstatusbasic.md b/docs/nearlib/enums/_providers_provider_.executionstatusbasic.md index efe8ce92ba..37f8c6bae5 100644 --- a/docs/nearlib/enums/_providers_provider_.executionstatusbasic.md +++ b/docs/nearlib/enums/_providers_provider_.executionstatusbasic.md @@ -18,7 +18,7 @@ sidebar_label: "ExecutionStatusBasic" • **Failure**: = "Failure" -*Defined in [src.ts/providers/provider.ts:28](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L28)* +*Defined in [src.ts/providers/provider.ts:34](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L34)* ___ @@ -26,7 +26,7 @@ ___ • **Pending**: = "Pending" -*Defined in [src.ts/providers/provider.ts:27](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L27)* +*Defined in [src.ts/providers/provider.ts:33](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L33)* ___ @@ -34,4 +34,4 @@ ___ • **Unknown**: = "Unknown" -*Defined in [src.ts/providers/provider.ts:26](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L26)* +*Defined in [src.ts/providers/provider.ts:32](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L32)* diff --git a/docs/nearlib/enums/_providers_provider_.finalexecutionstatusbasic.md b/docs/nearlib/enums/_providers_provider_.finalexecutionstatusbasic.md index 1f83403268..b5cf76502d 100644 --- a/docs/nearlib/enums/_providers_provider_.finalexecutionstatusbasic.md +++ b/docs/nearlib/enums/_providers_provider_.finalexecutionstatusbasic.md @@ -18,7 +18,7 @@ sidebar_label: "FinalExecutionStatusBasic" • **Failure**: = "Failure" -*Defined in [src.ts/providers/provider.ts:40](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L40)* +*Defined in [src.ts/providers/provider.ts:46](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L46)* ___ @@ -26,7 +26,7 @@ ___ • **NotStarted**: = "NotStarted" -*Defined in [src.ts/providers/provider.ts:38](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L38)* +*Defined in [src.ts/providers/provider.ts:44](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L44)* ___ @@ -34,4 +34,4 @@ ___ • **Started**: = "Started" -*Defined in [src.ts/providers/provider.ts:39](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L39)* +*Defined in [src.ts/providers/provider.ts:45](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L45)* diff --git a/docs/nearlib/enums/_providers_provider_.legacyfinaltransactionstatus.md b/docs/nearlib/enums/_providers_provider_.legacyfinaltransactionstatus.md index 65b731ab8d..36131cc657 100644 --- a/docs/nearlib/enums/_providers_provider_.legacyfinaltransactionstatus.md +++ b/docs/nearlib/enums/_providers_provider_.legacyfinaltransactionstatus.md @@ -19,7 +19,7 @@ sidebar_label: "LegacyFinalTransactionStatus" • **Completed**: = "Completed" -*Defined in [src.ts/providers/provider.ts:145](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L145)* +*Defined in [src.ts/providers/provider.ts:151](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L151)* ___ @@ -27,7 +27,7 @@ ___ • **Failed**: = "Failed" -*Defined in [src.ts/providers/provider.ts:144](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L144)* +*Defined in [src.ts/providers/provider.ts:150](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L150)* ___ @@ -35,7 +35,7 @@ ___ • **Started**: = "Started" -*Defined in [src.ts/providers/provider.ts:143](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L143)* +*Defined in [src.ts/providers/provider.ts:149](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L149)* ___ @@ -43,4 +43,4 @@ ___ • **Unknown**: = "Unknown" -*Defined in [src.ts/providers/provider.ts:142](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L142)* +*Defined in [src.ts/providers/provider.ts:148](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L148)* diff --git a/docs/nearlib/enums/_providers_provider_.legacytransactionstatus.md b/docs/nearlib/enums/_providers_provider_.legacytransactionstatus.md index b1a2a6d90f..3dc852e756 100644 --- a/docs/nearlib/enums/_providers_provider_.legacytransactionstatus.md +++ b/docs/nearlib/enums/_providers_provider_.legacytransactionstatus.md @@ -18,7 +18,7 @@ sidebar_label: "LegacyTransactionStatus" • **Completed**: = "Completed" -*Defined in [src.ts/providers/provider.ts:151](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L151)* +*Defined in [src.ts/providers/provider.ts:157](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L157)* ___ @@ -26,7 +26,7 @@ ___ • **Failed**: = "Failed" -*Defined in [src.ts/providers/provider.ts:152](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L152)* +*Defined in [src.ts/providers/provider.ts:158](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L158)* ___ @@ -34,4 +34,4 @@ ___ • **Unknown**: = "Unknown" -*Defined in [src.ts/providers/provider.ts:150](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L150)* +*Defined in [src.ts/providers/provider.ts:156](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L156)* diff --git a/docs/nearlib/enums/_utils_key_pair_.keytype.md b/docs/nearlib/enums/_utils_key_pair_.keytype.md index d3ad6624e7..ce569d81b5 100644 --- a/docs/nearlib/enums/_utils_key_pair_.keytype.md +++ b/docs/nearlib/enums/_utils_key_pair_.keytype.md @@ -18,4 +18,4 @@ All supported key types • **ED25519**: = 0 -*Defined in [src.ts/utils/key_pair.ts:16](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L16)* +*Defined in [src.ts/utils/key_pair.ts:16](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L16)* diff --git a/docs/nearlib/globals.md b/docs/nearlib/globals.md index 58d41cd2b4..dc919c0c27 100644 --- a/docs/nearlib/globals.md +++ b/docs/nearlib/globals.md @@ -26,6 +26,7 @@ sidebar_label: "Globals" * ["signer"](modules/_signer_.md) * ["transaction"](modules/_transaction_.md) * ["utils/enums"](modules/_utils_enums_.md) +* ["utils/errors"](modules/_utils_errors_.md) * ["utils/format"](modules/_utils_format_.md) * ["utils/index"](modules/_utils_index_.md) * ["utils/key_pair"](modules/_utils_key_pair_.md) diff --git a/docs/nearlib/interfaces/_account_.accountstate.md b/docs/nearlib/interfaces/_account_.accountstate.md index 2f03d7b868..4e8fd56aad 100644 --- a/docs/nearlib/interfaces/_account_.accountstate.md +++ b/docs/nearlib/interfaces/_account_.accountstate.md @@ -23,7 +23,7 @@ sidebar_label: "AccountState" • **account_id**: *string* -*Defined in [src.ts/account.ts:31](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L31)* +*Defined in [src.ts/account.ts:32](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L32)* ___ @@ -31,7 +31,7 @@ ___ • **amount**: *string* -*Defined in [src.ts/account.ts:32](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L32)* +*Defined in [src.ts/account.ts:33](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L33)* ___ @@ -39,7 +39,7 @@ ___ • **code_hash**: *string* -*Defined in [src.ts/account.ts:34](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L34)* +*Defined in [src.ts/account.ts:35](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L35)* ___ @@ -47,4 +47,4 @@ ___ • **staked**: *string* -*Defined in [src.ts/account.ts:33](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L33)* +*Defined in [src.ts/account.ts:34](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L34)* diff --git a/docs/nearlib/interfaces/_key_stores_unencrypted_file_system_keystore_.accountinfo.md b/docs/nearlib/interfaces/_key_stores_unencrypted_file_system_keystore_.accountinfo.md index c4dac863cb..20dfe3a7ff 100644 --- a/docs/nearlib/interfaces/_key_stores_unencrypted_file_system_keystore_.accountinfo.md +++ b/docs/nearlib/interfaces/_key_stores_unencrypted_file_system_keystore_.accountinfo.md @@ -23,7 +23,7 @@ Format of the account stored on disk. • **account_id**: *string* -*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:29](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/unencrypted_file_system_keystore.ts#L29)* +*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:29](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/unencrypted_file_system_keystore.ts#L29)* ___ @@ -31,4 +31,4 @@ ___ • **private_key**: *string* -*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:30](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/unencrypted_file_system_keystore.ts#L30)* +*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:30](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/unencrypted_file_system_keystore.ts#L30)* diff --git a/docs/nearlib/interfaces/_providers_provider_.blockheader.md b/docs/nearlib/interfaces/_providers_provider_.blockheader.md index aa4622a2b1..62d43987a1 100644 --- a/docs/nearlib/interfaces/_providers_provider_.blockheader.md +++ b/docs/nearlib/interfaces/_providers_provider_.blockheader.md @@ -28,7 +28,7 @@ sidebar_label: "BlockHeader" • **approval_mask**: *string* -*Defined in [src.ts/providers/provider.ts:76](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L76)* +*Defined in [src.ts/providers/provider.ts:82](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L82)* ___ @@ -36,7 +36,7 @@ ___ • **approval_sigs**: *string* -*Defined in [src.ts/providers/provider.ts:77](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L77)* +*Defined in [src.ts/providers/provider.ts:83](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L83)* ___ @@ -44,7 +44,7 @@ ___ • **hash**: *string* -*Defined in [src.ts/providers/provider.ts:78](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L78)* +*Defined in [src.ts/providers/provider.ts:84](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L84)* ___ @@ -52,7 +52,7 @@ ___ • **height**: *number* -*Defined in [src.ts/providers/provider.ts:79](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L79)* +*Defined in [src.ts/providers/provider.ts:85](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L85)* ___ @@ -60,7 +60,7 @@ ___ • **prev_hash**: *string* -*Defined in [src.ts/providers/provider.ts:80](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L80)* +*Defined in [src.ts/providers/provider.ts:86](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L86)* ___ @@ -68,7 +68,7 @@ ___ • **prev_state_root**: *string* -*Defined in [src.ts/providers/provider.ts:81](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L81)* +*Defined in [src.ts/providers/provider.ts:87](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L87)* ___ @@ -76,7 +76,7 @@ ___ • **timestamp**: *number* -*Defined in [src.ts/providers/provider.ts:82](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L82)* +*Defined in [src.ts/providers/provider.ts:88](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L88)* ___ @@ -84,7 +84,7 @@ ___ • **total_weight**: *[TotalWeight](_providers_provider_.totalweight.md)* -*Defined in [src.ts/providers/provider.ts:83](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L83)* +*Defined in [src.ts/providers/provider.ts:89](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L89)* ___ @@ -92,4 +92,4 @@ ___ • **tx_root**: *string* -*Defined in [src.ts/providers/provider.ts:84](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L84)* +*Defined in [src.ts/providers/provider.ts:90](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L90)* diff --git a/docs/nearlib/interfaces/_providers_provider_.blockresult.md b/docs/nearlib/interfaces/_providers_provider_.blockresult.md index 816ec48218..caaaf542e4 100644 --- a/docs/nearlib/interfaces/_providers_provider_.blockresult.md +++ b/docs/nearlib/interfaces/_providers_provider_.blockresult.md @@ -21,7 +21,7 @@ sidebar_label: "BlockResult" • **header**: *[BlockHeader](_providers_provider_.blockheader.md)* -*Defined in [src.ts/providers/provider.ts:162](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L162)* +*Defined in [src.ts/providers/provider.ts:168](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L168)* ___ @@ -29,4 +29,4 @@ ___ • **transactions**: *[Transaction](_providers_provider_.transaction.md)[]* -*Defined in [src.ts/providers/provider.ts:163](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L163)* +*Defined in [src.ts/providers/provider.ts:169](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L169)* diff --git a/docs/nearlib/interfaces/_providers_provider_.chunkheader.md b/docs/nearlib/interfaces/_providers_provider_.chunkheader.md index 995654d4ad..e127471f81 100644 --- a/docs/nearlib/interfaces/_providers_provider_.chunkheader.md +++ b/docs/nearlib/interfaces/_providers_provider_.chunkheader.md @@ -37,7 +37,7 @@ sidebar_label: "ChunkHeader" • **balance_burnt**: *string* -*Defined in [src.ts/providers/provider.ts:93](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L93)* +*Defined in [src.ts/providers/provider.ts:99](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L99)* ___ @@ -45,7 +45,7 @@ ___ • **chunk_hash**: *[ChunkHash](../modules/_providers_provider_.md#chunkhash)* -*Defined in [src.ts/providers/provider.ts:94](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L94)* +*Defined in [src.ts/providers/provider.ts:100](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L100)* ___ @@ -53,7 +53,7 @@ ___ • **encoded_length**: *number* -*Defined in [src.ts/providers/provider.ts:95](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L95)* +*Defined in [src.ts/providers/provider.ts:101](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L101)* ___ @@ -61,7 +61,7 @@ ___ • **encoded_merkle_root**: *string* -*Defined in [src.ts/providers/provider.ts:96](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L96)* +*Defined in [src.ts/providers/provider.ts:102](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L102)* ___ @@ -69,7 +69,7 @@ ___ • **gas_limit**: *number* -*Defined in [src.ts/providers/provider.ts:97](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L97)* +*Defined in [src.ts/providers/provider.ts:103](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L103)* ___ @@ -77,7 +77,7 @@ ___ • **gas_used**: *number* -*Defined in [src.ts/providers/provider.ts:98](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L98)* +*Defined in [src.ts/providers/provider.ts:104](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L104)* ___ @@ -85,7 +85,7 @@ ___ • **height_created**: *number* -*Defined in [src.ts/providers/provider.ts:99](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L99)* +*Defined in [src.ts/providers/provider.ts:105](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L105)* ___ @@ -93,7 +93,7 @@ ___ • **height_included**: *number* -*Defined in [src.ts/providers/provider.ts:100](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L100)* +*Defined in [src.ts/providers/provider.ts:106](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L106)* ___ @@ -101,7 +101,7 @@ ___ • **outgoing_receipts_root**: *string* -*Defined in [src.ts/providers/provider.ts:101](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L101)* +*Defined in [src.ts/providers/provider.ts:107](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L107)* ___ @@ -109,7 +109,7 @@ ___ • **prev_block_hash**: *string* -*Defined in [src.ts/providers/provider.ts:102](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L102)* +*Defined in [src.ts/providers/provider.ts:108](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L108)* ___ @@ -117,7 +117,7 @@ ___ • **prev_state_num_parts**: *number* -*Defined in [src.ts/providers/provider.ts:103](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L103)* +*Defined in [src.ts/providers/provider.ts:109](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L109)* ___ @@ -125,7 +125,7 @@ ___ • **prev_state_root_hash**: *string* -*Defined in [src.ts/providers/provider.ts:104](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L104)* +*Defined in [src.ts/providers/provider.ts:110](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L110)* ___ @@ -133,7 +133,7 @@ ___ • **rent_paid**: *string* -*Defined in [src.ts/providers/provider.ts:105](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L105)* +*Defined in [src.ts/providers/provider.ts:111](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L111)* ___ @@ -141,7 +141,7 @@ ___ • **shard_id**: *number* -*Defined in [src.ts/providers/provider.ts:106](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L106)* +*Defined in [src.ts/providers/provider.ts:112](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L112)* ___ @@ -149,7 +149,7 @@ ___ • **signature**: *string* -*Defined in [src.ts/providers/provider.ts:107](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L107)* +*Defined in [src.ts/providers/provider.ts:113](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L113)* ___ @@ -157,7 +157,7 @@ ___ • **tx_root**: *string* -*Defined in [src.ts/providers/provider.ts:108](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L108)* +*Defined in [src.ts/providers/provider.ts:114](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L114)* ___ @@ -165,7 +165,7 @@ ___ • **validator_proposals**: *any[]* -*Defined in [src.ts/providers/provider.ts:109](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L109)* +*Defined in [src.ts/providers/provider.ts:115](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L115)* ___ @@ -173,4 +173,4 @@ ___ • **validator_reward**: *string* -*Defined in [src.ts/providers/provider.ts:110](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L110)* +*Defined in [src.ts/providers/provider.ts:116](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L116)* diff --git a/docs/nearlib/interfaces/_providers_provider_.chunkresult.md b/docs/nearlib/interfaces/_providers_provider_.chunkresult.md index dc931c04be..46a4b89cb4 100644 --- a/docs/nearlib/interfaces/_providers_provider_.chunkresult.md +++ b/docs/nearlib/interfaces/_providers_provider_.chunkresult.md @@ -22,7 +22,7 @@ sidebar_label: "ChunkResult" • **header**: *[ChunkHeader](_providers_provider_.chunkheader.md)* -*Defined in [src.ts/providers/provider.ts:114](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L114)* +*Defined in [src.ts/providers/provider.ts:120](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L120)* ___ @@ -30,7 +30,7 @@ ___ • **receipts**: *any[]* -*Defined in [src.ts/providers/provider.ts:115](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L115)* +*Defined in [src.ts/providers/provider.ts:121](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L121)* ___ @@ -38,4 +38,4 @@ ___ • **transactions**: *[Transaction](_providers_provider_.transaction.md)[]* -*Defined in [src.ts/providers/provider.ts:116](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L116)* +*Defined in [src.ts/providers/provider.ts:122](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L122)* diff --git a/docs/nearlib/interfaces/_providers_provider_.executionerror.md b/docs/nearlib/interfaces/_providers_provider_.executionerror.md index e78dbcd4ba..7affc95b8c 100644 --- a/docs/nearlib/interfaces/_providers_provider_.executionerror.md +++ b/docs/nearlib/interfaces/_providers_provider_.executionerror.md @@ -21,7 +21,7 @@ sidebar_label: "ExecutionError" • **error_message**: *string* -*Defined in [src.ts/providers/provider.ts:44](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L44)* +*Defined in [src.ts/providers/provider.ts:50](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L50)* ___ @@ -29,4 +29,4 @@ ___ • **error_type**: *string* -*Defined in [src.ts/providers/provider.ts:45](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L45)* +*Defined in [src.ts/providers/provider.ts:51](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L51)* diff --git a/docs/nearlib/interfaces/_providers_provider_.executionoutcome.md b/docs/nearlib/interfaces/_providers_provider_.executionoutcome.md index 686bd02013..1b8f4aed72 100644 --- a/docs/nearlib/interfaces/_providers_provider_.executionoutcome.md +++ b/docs/nearlib/interfaces/_providers_provider_.executionoutcome.md @@ -23,7 +23,7 @@ sidebar_label: "ExecutionOutcome" • **gas_burnt**: *number* -*Defined in [src.ts/providers/provider.ts:62](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L62)* +*Defined in [src.ts/providers/provider.ts:68](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L68)* ___ @@ -31,7 +31,7 @@ ___ • **logs**: *string[]* -*Defined in [src.ts/providers/provider.ts:60](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L60)* +*Defined in [src.ts/providers/provider.ts:66](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L66)* ___ @@ -39,7 +39,7 @@ ___ • **receipt_ids**: *string[]* -*Defined in [src.ts/providers/provider.ts:61](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L61)* +*Defined in [src.ts/providers/provider.ts:67](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L67)* ___ @@ -47,4 +47,4 @@ ___ • **status**: *[ExecutionStatus](_providers_provider_.executionstatus.md) | [ExecutionStatusBasic](../enums/_providers_provider_.executionstatusbasic.md)* -*Defined in [src.ts/providers/provider.ts:59](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L59)* +*Defined in [src.ts/providers/provider.ts:65](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L65)* diff --git a/docs/nearlib/interfaces/_providers_provider_.executionoutcomewithid.md b/docs/nearlib/interfaces/_providers_provider_.executionoutcomewithid.md index 77bfcaa9e6..139cbc2c9b 100644 --- a/docs/nearlib/interfaces/_providers_provider_.executionoutcomewithid.md +++ b/docs/nearlib/interfaces/_providers_provider_.executionoutcomewithid.md @@ -21,7 +21,7 @@ sidebar_label: "ExecutionOutcomeWithId" • **id**: *string* -*Defined in [src.ts/providers/provider.ts:54](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L54)* +*Defined in [src.ts/providers/provider.ts:60](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L60)* ___ @@ -29,4 +29,4 @@ ___ • **outcome**: *[ExecutionOutcome](_providers_provider_.executionoutcome.md)* -*Defined in [src.ts/providers/provider.ts:55](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L55)* +*Defined in [src.ts/providers/provider.ts:61](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L61)* diff --git a/docs/nearlib/interfaces/_providers_provider_.executionstatus.md b/docs/nearlib/interfaces/_providers_provider_.executionstatus.md index cfe541ac12..eed15f797b 100644 --- a/docs/nearlib/interfaces/_providers_provider_.executionstatus.md +++ b/docs/nearlib/interfaces/_providers_provider_.executionstatus.md @@ -22,7 +22,7 @@ sidebar_label: "ExecutionStatus" • **Failure**? : *[ExecutionError](_providers_provider_.executionerror.md)* -*Defined in [src.ts/providers/provider.ts:34](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L34)* +*Defined in [src.ts/providers/provider.ts:40](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L40)* ___ @@ -30,7 +30,7 @@ ___ • **SuccessReceiptId**? : *string* -*Defined in [src.ts/providers/provider.ts:33](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L33)* +*Defined in [src.ts/providers/provider.ts:39](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L39)* ___ @@ -38,4 +38,4 @@ ___ • **SuccessValue**? : *string* -*Defined in [src.ts/providers/provider.ts:32](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L32)* +*Defined in [src.ts/providers/provider.ts:38](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L38)* diff --git a/docs/nearlib/interfaces/_providers_provider_.finalexecutionoutcome.md b/docs/nearlib/interfaces/_providers_provider_.finalexecutionoutcome.md index 3a5d28fcdd..62c064f18d 100644 --- a/docs/nearlib/interfaces/_providers_provider_.finalexecutionoutcome.md +++ b/docs/nearlib/interfaces/_providers_provider_.finalexecutionoutcome.md @@ -22,7 +22,7 @@ sidebar_label: "FinalExecutionOutcome" • **receipts**: *[ExecutionOutcomeWithId](_providers_provider_.executionoutcomewithid.md)[]* -*Defined in [src.ts/providers/provider.ts:68](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L68)* +*Defined in [src.ts/providers/provider.ts:74](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L74)* ___ @@ -30,7 +30,7 @@ ___ • **status**: *[FinalExecutionStatus](_providers_provider_.finalexecutionstatus.md) | [FinalExecutionStatusBasic](../enums/_providers_provider_.finalexecutionstatusbasic.md)* -*Defined in [src.ts/providers/provider.ts:66](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L66)* +*Defined in [src.ts/providers/provider.ts:72](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L72)* ___ @@ -38,4 +38,4 @@ ___ • **transaction**: *[ExecutionOutcomeWithId](_providers_provider_.executionoutcomewithid.md)* -*Defined in [src.ts/providers/provider.ts:67](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L67)* +*Defined in [src.ts/providers/provider.ts:73](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L73)* diff --git a/docs/nearlib/interfaces/_providers_provider_.finalexecutionstatus.md b/docs/nearlib/interfaces/_providers_provider_.finalexecutionstatus.md index aeaa16d0ca..2af43c8377 100644 --- a/docs/nearlib/interfaces/_providers_provider_.finalexecutionstatus.md +++ b/docs/nearlib/interfaces/_providers_provider_.finalexecutionstatus.md @@ -21,7 +21,7 @@ sidebar_label: "FinalExecutionStatus" • **Failure**? : *[ExecutionError](_providers_provider_.executionerror.md)* -*Defined in [src.ts/providers/provider.ts:50](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L50)* +*Defined in [src.ts/providers/provider.ts:56](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L56)* ___ @@ -29,4 +29,4 @@ ___ • **SuccessValue**? : *string* -*Defined in [src.ts/providers/provider.ts:49](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L49)* +*Defined in [src.ts/providers/provider.ts:55](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L55)* diff --git a/docs/nearlib/interfaces/_providers_provider_.legacyfinaltransactionresult.md b/docs/nearlib/interfaces/_providers_provider_.legacyfinaltransactionresult.md index 28c355bca5..bd10c5936b 100644 --- a/docs/nearlib/interfaces/_providers_provider_.legacyfinaltransactionresult.md +++ b/docs/nearlib/interfaces/_providers_provider_.legacyfinaltransactionresult.md @@ -21,7 +21,7 @@ sidebar_label: "LegacyFinalTransactionResult" • **status**: *[LegacyFinalTransactionStatus](../enums/_providers_provider_.legacyfinaltransactionstatus.md)* -*Defined in [src.ts/providers/provider.ts:157](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L157)* +*Defined in [src.ts/providers/provider.ts:163](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L163)* ___ @@ -29,4 +29,4 @@ ___ • **transactions**: *[LegacyTransactionLog](_providers_provider_.legacytransactionlog.md)[]* -*Defined in [src.ts/providers/provider.ts:158](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L158)* +*Defined in [src.ts/providers/provider.ts:164](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L164)* diff --git a/docs/nearlib/interfaces/_providers_provider_.legacytransactionlog.md b/docs/nearlib/interfaces/_providers_provider_.legacytransactionlog.md index 492afcd102..7e7065cb92 100644 --- a/docs/nearlib/interfaces/_providers_provider_.legacytransactionlog.md +++ b/docs/nearlib/interfaces/_providers_provider_.legacytransactionlog.md @@ -21,7 +21,7 @@ sidebar_label: "LegacyTransactionLog" • **hash**: *string* -*Defined in [src.ts/providers/provider.ts:128](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L128)* +*Defined in [src.ts/providers/provider.ts:134](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L134)* ___ @@ -29,4 +29,4 @@ ___ • **result**: *[LegacyTransactionResult](_providers_provider_.legacytransactionresult.md)* -*Defined in [src.ts/providers/provider.ts:129](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L129)* +*Defined in [src.ts/providers/provider.ts:135](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L135)* diff --git a/docs/nearlib/interfaces/_providers_provider_.legacytransactionresult.md b/docs/nearlib/interfaces/_providers_provider_.legacytransactionresult.md index cd8730388c..f91a0b03c3 100644 --- a/docs/nearlib/interfaces/_providers_provider_.legacytransactionresult.md +++ b/docs/nearlib/interfaces/_providers_provider_.legacytransactionresult.md @@ -23,7 +23,7 @@ sidebar_label: "LegacyTransactionResult" • **logs**: *string[]* -*Defined in [src.ts/providers/provider.ts:135](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L135)* +*Defined in [src.ts/providers/provider.ts:141](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L141)* ___ @@ -31,7 +31,7 @@ ___ • **receipts**: *string[]* -*Defined in [src.ts/providers/provider.ts:136](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L136)* +*Defined in [src.ts/providers/provider.ts:142](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L142)* ___ @@ -39,7 +39,7 @@ ___ • **result**? : *string* -*Defined in [src.ts/providers/provider.ts:137](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L137)* +*Defined in [src.ts/providers/provider.ts:143](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L143)* ___ @@ -47,4 +47,4 @@ ___ • **status**: *[LegacyTransactionStatus](../enums/_providers_provider_.legacytransactionstatus.md)* -*Defined in [src.ts/providers/provider.ts:134](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L134)* +*Defined in [src.ts/providers/provider.ts:140](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L140)* diff --git a/docs/nearlib/interfaces/_providers_provider_.nodestatusresult.md b/docs/nearlib/interfaces/_providers_provider_.nodestatusresult.md index 755c1aa8b0..04795c8016 100644 --- a/docs/nearlib/interfaces/_providers_provider_.nodestatusresult.md +++ b/docs/nearlib/interfaces/_providers_provider_.nodestatusresult.md @@ -16,6 +16,7 @@ sidebar_label: "NodeStatusResult" * [rpc_addr](_providers_provider_.nodestatusresult.md#rpc_addr) * [sync_info](_providers_provider_.nodestatusresult.md#sync_info) * [validators](_providers_provider_.nodestatusresult.md#validators) +* [version](_providers_provider_.nodestatusresult.md#version) ## Properties @@ -23,7 +24,7 @@ sidebar_label: "NodeStatusResult" • **chain_id**: *string* -*Defined in [src.ts/providers/provider.ts:15](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L15)* +*Defined in [src.ts/providers/provider.ts:20](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L20)* ___ @@ -31,7 +32,7 @@ ___ • **rpc_addr**: *string* -*Defined in [src.ts/providers/provider.ts:16](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L16)* +*Defined in [src.ts/providers/provider.ts:21](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L21)* ___ @@ -39,7 +40,7 @@ ___ • **sync_info**: *[SyncInfo](_providers_provider_.syncinfo.md)* -*Defined in [src.ts/providers/provider.ts:17](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L17)* +*Defined in [src.ts/providers/provider.ts:22](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L22)* ___ @@ -47,4 +48,12 @@ ___ • **validators**: *string[]* -*Defined in [src.ts/providers/provider.ts:18](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L18)* +*Defined in [src.ts/providers/provider.ts:23](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L23)* + +___ + +### version + +• **version**: *[Version](_providers_provider_.version.md)* + +*Defined in [src.ts/providers/provider.ts:24](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L24)* diff --git a/docs/nearlib/interfaces/_providers_provider_.syncinfo.md b/docs/nearlib/interfaces/_providers_provider_.syncinfo.md index 647a8b2358..d02f87960c 100644 --- a/docs/nearlib/interfaces/_providers_provider_.syncinfo.md +++ b/docs/nearlib/interfaces/_providers_provider_.syncinfo.md @@ -24,7 +24,7 @@ sidebar_label: "SyncInfo" • **latest_block_hash**: *string* -*Defined in [src.ts/providers/provider.ts:7](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L7)* +*Defined in [src.ts/providers/provider.ts:7](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L7)* ___ @@ -32,7 +32,7 @@ ___ • **latest_block_height**: *number* -*Defined in [src.ts/providers/provider.ts:8](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L8)* +*Defined in [src.ts/providers/provider.ts:8](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L8)* ___ @@ -40,7 +40,7 @@ ___ • **latest_block_time**: *string* -*Defined in [src.ts/providers/provider.ts:9](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L9)* +*Defined in [src.ts/providers/provider.ts:9](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L9)* ___ @@ -48,7 +48,7 @@ ___ • **latest_state_root**: *string* -*Defined in [src.ts/providers/provider.ts:10](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L10)* +*Defined in [src.ts/providers/provider.ts:10](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L10)* ___ @@ -56,4 +56,4 @@ ___ • **syncing**: *boolean* -*Defined in [src.ts/providers/provider.ts:11](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L11)* +*Defined in [src.ts/providers/provider.ts:11](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L11)* diff --git a/docs/nearlib/interfaces/_providers_provider_.totalweight.md b/docs/nearlib/interfaces/_providers_provider_.totalweight.md index 63072fd150..84c13d5378 100644 --- a/docs/nearlib/interfaces/_providers_provider_.totalweight.md +++ b/docs/nearlib/interfaces/_providers_provider_.totalweight.md @@ -20,4 +20,4 @@ sidebar_label: "TotalWeight" • **num**: *number* -*Defined in [src.ts/providers/provider.ts:72](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L72)* +*Defined in [src.ts/providers/provider.ts:78](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L78)* diff --git a/docs/nearlib/interfaces/_providers_provider_.transaction.md b/docs/nearlib/interfaces/_providers_provider_.transaction.md index 9a8fe9f365..0906e04ae7 100644 --- a/docs/nearlib/interfaces/_providers_provider_.transaction.md +++ b/docs/nearlib/interfaces/_providers_provider_.transaction.md @@ -23,7 +23,7 @@ sidebar_label: "Transaction" • **body**: *any* -*Defined in [src.ts/providers/provider.ts:123](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L123)* +*Defined in [src.ts/providers/provider.ts:129](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L129)* ___ @@ -31,7 +31,7 @@ ___ • **hash**: *string* -*Defined in [src.ts/providers/provider.ts:120](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L120)* +*Defined in [src.ts/providers/provider.ts:126](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L126)* ___ @@ -39,7 +39,7 @@ ___ • **public_key**: *string* -*Defined in [src.ts/providers/provider.ts:121](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L121)* +*Defined in [src.ts/providers/provider.ts:127](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L127)* ___ @@ -47,4 +47,4 @@ ___ • **signature**: *string* -*Defined in [src.ts/providers/provider.ts:122](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L122)* +*Defined in [src.ts/providers/provider.ts:128](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L128)* diff --git a/docs/nearlib/interfaces/_providers_provider_.version.md b/docs/nearlib/interfaces/_providers_provider_.version.md new file mode 100644 index 0000000000..a6db7ba3fa --- /dev/null +++ b/docs/nearlib/interfaces/_providers_provider_.version.md @@ -0,0 +1,32 @@ +--- +id: "_providers_provider_.version" +title: "Version" +sidebar_label: "Version" +--- + +## Hierarchy + +* **Version** + +## Index + +### Properties + +* [build](_providers_provider_.version.md#build) +* [version](_providers_provider_.version.md#version) + +## Properties + +### build + +• **build**: *string* + +*Defined in [src.ts/providers/provider.ts:16](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L16)* + +___ + +### version + +• **version**: *string* + +*Defined in [src.ts/providers/provider.ts:15](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L15)* diff --git a/docs/nearlib/interfaces/_utils_key_pair_.signature.md b/docs/nearlib/interfaces/_utils_key_pair_.signature.md index 792fcdf5dc..d03ce45e32 100644 --- a/docs/nearlib/interfaces/_utils_key_pair_.signature.md +++ b/docs/nearlib/interfaces/_utils_key_pair_.signature.md @@ -21,7 +21,7 @@ sidebar_label: "Signature" • **publicKey**: *[PublicKey](../classes/_utils_key_pair_.publickey.md)* -*Defined in [src.ts/utils/key_pair.ts:11](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L11)* +*Defined in [src.ts/utils/key_pair.ts:11](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L11)* ___ @@ -29,4 +29,4 @@ ___ • **signature**: *Uint8Array* -*Defined in [src.ts/utils/key_pair.ts:10](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L10)* +*Defined in [src.ts/utils/key_pair.ts:10](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L10)* diff --git a/docs/nearlib/interfaces/_utils_network_.network.md b/docs/nearlib/interfaces/_utils_network_.network.md index 6df6481e0c..8ce51c9390 100644 --- a/docs/nearlib/interfaces/_utils_network_.network.md +++ b/docs/nearlib/interfaces/_utils_network_.network.md @@ -22,7 +22,7 @@ sidebar_label: "Network" • **_defaultProvider**? : *function* -*Defined in [src.ts/utils/network.ts:6](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/network.ts#L6)* +*Defined in [src.ts/utils/network.ts:6](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/network.ts#L6)* #### Type declaration: @@ -40,7 +40,7 @@ ___ • **chainId**: *string* -*Defined in [src.ts/utils/network.ts:5](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/network.ts#L5)* +*Defined in [src.ts/utils/network.ts:5](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/network.ts#L5)* ___ @@ -48,4 +48,4 @@ ___ • **name**: *string* -*Defined in [src.ts/utils/network.ts:4](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/network.ts#L4)* +*Defined in [src.ts/utils/network.ts:4](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/network.ts#L4)* diff --git a/docs/nearlib/interfaces/_utils_web_.connectioninfo.md b/docs/nearlib/interfaces/_utils_web_.connectioninfo.md index edbdaaee64..c357f4a2e1 100644 --- a/docs/nearlib/interfaces/_utils_web_.connectioninfo.md +++ b/docs/nearlib/interfaces/_utils_web_.connectioninfo.md @@ -25,7 +25,7 @@ sidebar_label: "ConnectionInfo" • **allowInsecure**? : *boolean* -*Defined in [src.ts/utils/web.ts:9](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/web.ts#L9)* +*Defined in [src.ts/utils/web.ts:9](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/web.ts#L9)* ___ @@ -33,7 +33,7 @@ ___ • **headers**? : *object* -*Defined in [src.ts/utils/web.ts:11](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/web.ts#L11)* +*Defined in [src.ts/utils/web.ts:11](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/web.ts#L11)* #### Type declaration: @@ -45,7 +45,7 @@ ___ • **password**? : *string* -*Defined in [src.ts/utils/web.ts:8](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/web.ts#L8)* +*Defined in [src.ts/utils/web.ts:8](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/web.ts#L8)* ___ @@ -53,7 +53,7 @@ ___ • **timeout**? : *number* -*Defined in [src.ts/utils/web.ts:10](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/web.ts#L10)* +*Defined in [src.ts/utils/web.ts:10](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/web.ts#L10)* ___ @@ -61,7 +61,7 @@ ___ • **url**: *string* -*Defined in [src.ts/utils/web.ts:6](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/web.ts#L6)* +*Defined in [src.ts/utils/web.ts:6](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/web.ts#L6)* ___ @@ -69,4 +69,4 @@ ___ • **user**? : *string* -*Defined in [src.ts/utils/web.ts:7](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/web.ts#L7)* +*Defined in [src.ts/utils/web.ts:7](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/web.ts#L7)* diff --git a/docs/nearlib/modules/_account_.md b/docs/nearlib/modules/_account_.md index 3cac6741a1..664065f4dc 100644 --- a/docs/nearlib/modules/_account_.md +++ b/docs/nearlib/modules/_account_.md @@ -31,7 +31,7 @@ sidebar_label: "account" • **DEFAULT_FUNC_CALL_AMOUNT**: *2000000* = 2000000 -*Defined in [src.ts/account.ts:14](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L14)* +*Defined in [src.ts/account.ts:15](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L15)* ___ @@ -39,7 +39,7 @@ ___ • **TX_STATUS_RETRY_NUMBER**: *10* = 10 -*Defined in [src.ts/account.ts:17](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L17)* +*Defined in [src.ts/account.ts:18](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L18)* ___ @@ -47,7 +47,7 @@ ___ • **TX_STATUS_RETRY_WAIT**: *500* = 500 -*Defined in [src.ts/account.ts:20](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L20)* +*Defined in [src.ts/account.ts:21](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L21)* ___ @@ -55,7 +55,7 @@ ___ • **TX_STATUS_RETRY_WAIT_BACKOFF**: *1.5* = 1.5 -*Defined in [src.ts/account.ts:23](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L23)* +*Defined in [src.ts/account.ts:24](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L24)* ## Functions @@ -63,7 +63,7 @@ ___ ▸ **sleep**(`millis`: number): *Promise‹any›* -*Defined in [src.ts/account.ts:26](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/account.ts#L26)* +*Defined in [src.ts/account.ts:27](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/account.ts#L27)* **Parameters:** diff --git a/docs/nearlib/modules/_connection_.md b/docs/nearlib/modules/_connection_.md index 52845060fb..20c65caa9b 100644 --- a/docs/nearlib/modules/_connection_.md +++ b/docs/nearlib/modules/_connection_.md @@ -21,7 +21,7 @@ sidebar_label: "connection" ▸ **getProvider**(`config`: any): *[Provider](../classes/_providers_provider_.provider.md)* -*Defined in [src.ts/connection.ts:6](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/connection.ts#L6)* +*Defined in [src.ts/connection.ts:6](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/connection.ts#L6)* **Parameters:** @@ -37,7 +37,7 @@ ___ ▸ **getSigner**(`config`: any): *[Signer](../classes/_signer_.signer.md)* -*Defined in [src.ts/connection.ts:15](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/connection.ts#L15)* +*Defined in [src.ts/connection.ts:15](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/connection.ts#L15)* **Parameters:** diff --git a/docs/nearlib/modules/_contract_.md b/docs/nearlib/modules/_contract_.md index a8a76e4bf9..5201eb907a 100644 --- a/docs/nearlib/modules/_contract_.md +++ b/docs/nearlib/modules/_contract_.md @@ -9,3 +9,23 @@ sidebar_label: "contract" ### Classes * [Contract](../classes/_contract_.contract.md) + +### Functions + +* [validateBNLike](_contract_.md#validatebnlike) + +## Functions + +### validateBNLike + +▸ **validateBNLike**(`argMap`: object): *void* + +*Defined in [src.ts/contract.ts:44](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/contract.ts#L44)* + +**Parameters:** + +Name | Type | +------ | ------ | +`argMap` | object | + +**Returns:** *void* diff --git a/docs/nearlib/modules/_key_stores_browser_local_storage_key_store_.md b/docs/nearlib/modules/_key_stores_browser_local_storage_key_store_.md index aacf752710..76ad834614 100644 --- a/docs/nearlib/modules/_key_stores_browser_local_storage_key_store_.md +++ b/docs/nearlib/modules/_key_stores_browser_local_storage_key_store_.md @@ -20,4 +20,4 @@ sidebar_label: "key_stores/browser_local_storage_key_store" • **LOCAL_STORAGE_KEY_PREFIX**: *"nearlib:keystore:"* = "nearlib:keystore:" -*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:6](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/browser_local_storage_key_store.ts#L6)* +*Defined in [src.ts/key_stores/browser_local_storage_key_store.ts:6](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/browser_local_storage_key_store.ts#L6)* diff --git a/docs/nearlib/modules/_key_stores_unencrypted_file_system_keystore_.md b/docs/nearlib/modules/_key_stores_unencrypted_file_system_keystore_.md index e6cace84fb..4dd233a0c5 100644 --- a/docs/nearlib/modules/_key_stores_unencrypted_file_system_keystore_.md +++ b/docs/nearlib/modules/_key_stores_unencrypted_file_system_keystore_.md @@ -36,7 +36,7 @@ sidebar_label: "key_stores/unencrypted_file_system_keystore" • **exists**: *Function* = promisify(fs.exists) -*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:18](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/unencrypted_file_system_keystore.ts#L18)* +*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:18](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/unencrypted_file_system_keystore.ts#L18)* ___ @@ -44,7 +44,7 @@ ___ • **mkdir**: *Function* = promisify(fs.mkdir) -*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:23](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/unencrypted_file_system_keystore.ts#L23)* +*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:23](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/unencrypted_file_system_keystore.ts#L23)* ___ @@ -52,7 +52,7 @@ ___ • **readFile**: *Function* = promisify(fs.readFile) -*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:19](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/unencrypted_file_system_keystore.ts#L19)* +*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:19](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/unencrypted_file_system_keystore.ts#L19)* ___ @@ -60,7 +60,7 @@ ___ • **readdir**: *Function* = promisify(fs.readdir) -*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:22](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/unencrypted_file_system_keystore.ts#L22)* +*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:22](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/unencrypted_file_system_keystore.ts#L22)* ___ @@ -68,7 +68,7 @@ ___ • **unlink**: *Function* = promisify(fs.unlink) -*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:21](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/unencrypted_file_system_keystore.ts#L21)* +*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:21](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/unencrypted_file_system_keystore.ts#L21)* ___ @@ -76,7 +76,7 @@ ___ • **writeFile**: *Function* = promisify(fs.writeFile) -*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:20](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/unencrypted_file_system_keystore.ts#L20)* +*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:20](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/unencrypted_file_system_keystore.ts#L20)* ## Functions @@ -84,7 +84,7 @@ ___ ▸ **ensureDir**(`path`: string): *Promise‹void›* -*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:38](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/unencrypted_file_system_keystore.ts#L38)* +*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:38](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/unencrypted_file_system_keystore.ts#L38)* **Parameters:** @@ -100,7 +100,7 @@ ___ ▸ **loadJsonFile**(`path`: string): *Promise‹any›* -*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:33](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/unencrypted_file_system_keystore.ts#L33)* +*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:33](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/unencrypted_file_system_keystore.ts#L33)* **Parameters:** @@ -116,7 +116,7 @@ ___ ▸ **promisify**(`fn`: any): *Function* -*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:9](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/unencrypted_file_system_keystore.ts#L9)* +*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:9](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/unencrypted_file_system_keystore.ts#L9)* **Parameters:** @@ -132,7 +132,7 @@ ___ ▸ **readKeyFile**(`path`: string): *Promise‹[string, [KeyPair](../classes/_utils_key_pair_.keypair.md)]›* -*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:46](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/key_stores/unencrypted_file_system_keystore.ts#L46)* +*Defined in [src.ts/key_stores/unencrypted_file_system_keystore.ts:46](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/key_stores/unencrypted_file_system_keystore.ts#L46)* **Parameters:** diff --git a/docs/nearlib/modules/_near_.md b/docs/nearlib/modules/_near_.md index b16512355f..f74408326b 100644 --- a/docs/nearlib/modules/_near_.md +++ b/docs/nearlib/modules/_near_.md @@ -20,7 +20,7 @@ sidebar_label: "near" ▸ **connect**(`config`: any): *Promise‹[Near](../classes/_near_.near.md)›* -*Defined in [src.ts/near.ts:72](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/near.ts#L72)* +*Defined in [src.ts/near.ts:72](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/near.ts#L72)* **Parameters:** diff --git a/docs/nearlib/modules/_providers_json_rpc_provider_.md b/docs/nearlib/modules/_providers_json_rpc_provider_.md index a78c3f247a..f2beeb9ce2 100644 --- a/docs/nearlib/modules/_providers_json_rpc_provider_.md +++ b/docs/nearlib/modules/_providers_json_rpc_provider_.md @@ -21,4 +21,4 @@ sidebar_label: "providers/json-rpc-provider" • **_nextId**: *number* = 123 -*Defined in [src.ts/providers/json-rpc-provider.ts:13](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/json-rpc-provider.ts#L13)* +*Defined in [src.ts/providers/json-rpc-provider.ts:13](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/json-rpc-provider.ts#L13)* diff --git a/docs/nearlib/modules/_providers_provider_.md b/docs/nearlib/modules/_providers_provider_.md index 19bf1cb584..9065e234dd 100644 --- a/docs/nearlib/modules/_providers_provider_.md +++ b/docs/nearlib/modules/_providers_provider_.md @@ -36,6 +36,7 @@ sidebar_label: "providers/provider" * [SyncInfo](../interfaces/_providers_provider_.syncinfo.md) * [TotalWeight](../interfaces/_providers_provider_.totalweight.md) * [Transaction](../interfaces/_providers_provider_.transaction.md) +* [Version](../interfaces/_providers_provider_.version.md) ### Type aliases @@ -60,7 +61,7 @@ sidebar_label: "providers/provider" Ƭ **BlockHash**: *string* -*Defined in [src.ts/providers/provider.ts:21](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L21)* +*Defined in [src.ts/providers/provider.ts:27](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L27)* ___ @@ -68,7 +69,7 @@ ___ Ƭ **BlockHeight**: *number* -*Defined in [src.ts/providers/provider.ts:22](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L22)* +*Defined in [src.ts/providers/provider.ts:28](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L28)* ___ @@ -76,7 +77,7 @@ ___ Ƭ **BlockId**: *[BlockHash](_providers_provider_.md#blockhash) | [BlockHeight](_providers_provider_.md#blockheight)* -*Defined in [src.ts/providers/provider.ts:23](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L23)* +*Defined in [src.ts/providers/provider.ts:29](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L29)* ___ @@ -84,7 +85,7 @@ ___ Ƭ **BlockShardId**: *[[BlockId](_providers_provider_.md#blockid), [ShardId](_providers_provider_.md#shardid)]* -*Defined in [src.ts/providers/provider.ts:89](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L89)* +*Defined in [src.ts/providers/provider.ts:95](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L95)* ___ @@ -92,7 +93,7 @@ ___ Ƭ **ChunkHash**: *string* -*Defined in [src.ts/providers/provider.ts:87](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L87)* +*Defined in [src.ts/providers/provider.ts:93](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L93)* ___ @@ -100,7 +101,7 @@ ___ Ƭ **ChunkId**: *[ChunkHash](_providers_provider_.md#chunkhash) | [BlockShardId](_providers_provider_.md#blockshardid)* -*Defined in [src.ts/providers/provider.ts:90](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L90)* +*Defined in [src.ts/providers/provider.ts:96](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L96)* ___ @@ -108,7 +109,7 @@ ___ Ƭ **ShardId**: *number* -*Defined in [src.ts/providers/provider.ts:88](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L88)* +*Defined in [src.ts/providers/provider.ts:94](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L94)* ## Functions @@ -116,7 +117,7 @@ ___ ▸ **adaptTransactionResult**(`txResult`: [FinalExecutionOutcome](../interfaces/_providers_provider_.finalexecutionoutcome.md) | [LegacyFinalTransactionResult](../interfaces/_providers_provider_.legacyfinaltransactionresult.md)): *[FinalExecutionOutcome](../interfaces/_providers_provider_.finalexecutionoutcome.md)* -*Defined in [src.ts/providers/provider.ts:204](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L204)* +*Defined in [src.ts/providers/provider.ts:210](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L210)* **Parameters:** @@ -132,7 +133,7 @@ ___ ▸ **fixLegacyBasicExecutionOutcomeFailure**(`t`: [ExecutionOutcomeWithId](../interfaces/_providers_provider_.executionoutcomewithid.md)): *[ExecutionOutcomeWithId](../interfaces/_providers_provider_.executionoutcomewithid.md)* -*Defined in [src.ts/providers/provider.ts:190](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L190)* +*Defined in [src.ts/providers/provider.ts:196](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L196)* **Parameters:** @@ -148,7 +149,7 @@ ___ ▸ **getTransactionLastResult**(`txResult`: [FinalExecutionOutcome](../interfaces/_providers_provider_.finalexecutionoutcome.md)): *any* -*Defined in [src.ts/providers/provider.ts:263](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L263)* +*Defined in [src.ts/providers/provider.ts:269](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L269)* **Parameters:** @@ -164,7 +165,7 @@ ___ ▸ **mapLegacyTransactionLog**(`tl`: [LegacyTransactionLog](../interfaces/_providers_provider_.legacytransactionlog.md)): *[ExecutionOutcomeWithId](../interfaces/_providers_provider_.executionoutcomewithid.md)* -*Defined in [src.ts/providers/provider.ts:167](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/providers/provider.ts#L167)* +*Defined in [src.ts/providers/provider.ts:173](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/providers/provider.ts#L173)* **Parameters:** diff --git a/docs/nearlib/modules/_transaction_.md b/docs/nearlib/modules/_transaction_.md index d2072855f7..479ae0a5a2 100644 --- a/docs/nearlib/modules/_transaction_.md +++ b/docs/nearlib/modules/_transaction_.md @@ -34,6 +34,7 @@ sidebar_label: "transaction" * [addKey](_transaction_.md#addkey) * [createAccount](_transaction_.md#createaccount) +* [createTransaction](_transaction_.md#createtransaction) * [deleteAccount](_transaction_.md#deleteaccount) * [deleteKey](_transaction_.md#deletekey) * [deployContract](_transaction_.md#deploycontract) @@ -122,7 +123,7 @@ sidebar_label: "transaction" ]}], ]) -*Defined in [src.ts/transaction.ts:119](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L119)* +*Defined in [src.ts/transaction.ts:126](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L126)* ## Functions @@ -130,7 +131,7 @@ sidebar_label: "transaction" ▸ **addKey**(`publicKey`: [PublicKey](../classes/_utils_key_pair_.publickey.md), `accessKey`: [AccessKey](../classes/_transaction_.accesskey.md)): *[Action](../classes/_transaction_.action.md)* -*Defined in [src.ts/transaction.ts:68](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L68)* +*Defined in [src.ts/transaction.ts:68](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L68)* **Parameters:** @@ -147,17 +148,38 @@ ___ ▸ **createAccount**(): *[Action](../classes/_transaction_.action.md)* -*Defined in [src.ts/transaction.ts:48](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L48)* +*Defined in [src.ts/transaction.ts:48](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L48)* **Returns:** *[Action](../classes/_transaction_.action.md)* ___ +### createTransaction + +▸ **createTransaction**(`signerId`: string, `publicKey`: [PublicKey](../classes/_utils_key_pair_.publickey.md), `receiverId`: string, `nonce`: number, `actions`: [Action](../classes/_transaction_.action.md)[], `blockHash`: Uint8Array): *[Transaction](../classes/_transaction_.transaction.md)* + +*Defined in [src.ts/transaction.ts:200](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L200)* + +**Parameters:** + +Name | Type | +------ | ------ | +`signerId` | string | +`publicKey` | [PublicKey](../classes/_utils_key_pair_.publickey.md) | +`receiverId` | string | +`nonce` | number | +`actions` | [Action](../classes/_transaction_.action.md)[] | +`blockHash` | Uint8Array | + +**Returns:** *[Transaction](../classes/_transaction_.transaction.md)* + +___ + ### deleteAccount ▸ **deleteAccount**(`beneficiaryId`: string): *[Action](../classes/_transaction_.action.md)* -*Defined in [src.ts/transaction.ts:76](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L76)* +*Defined in [src.ts/transaction.ts:76](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L76)* **Parameters:** @@ -173,7 +195,7 @@ ___ ▸ **deleteKey**(`publicKey`: [PublicKey](../classes/_utils_key_pair_.publickey.md)): *[Action](../classes/_transaction_.action.md)* -*Defined in [src.ts/transaction.ts:72](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L72)* +*Defined in [src.ts/transaction.ts:72](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L72)* **Parameters:** @@ -189,7 +211,7 @@ ___ ▸ **deployContract**(`code`: Uint8Array): *[Action](../classes/_transaction_.action.md)* -*Defined in [src.ts/transaction.ts:52](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L52)* +*Defined in [src.ts/transaction.ts:52](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L52)* **Parameters:** @@ -205,7 +227,7 @@ ___ ▸ **fullAccessKey**(): *[AccessKey](../classes/_transaction_.accesskey.md)* -*Defined in [src.ts/transaction.ts:29](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L29)* +*Defined in [src.ts/transaction.ts:29](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L29)* **Returns:** *[AccessKey](../classes/_transaction_.accesskey.md)* @@ -215,7 +237,7 @@ ___ ▸ **functionCall**(`methodName`: string, `args`: Uint8Array, `gas`: number, `deposit`: BN): *[Action](../classes/_transaction_.action.md)* -*Defined in [src.ts/transaction.ts:56](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L56)* +*Defined in [src.ts/transaction.ts:56](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L56)* **Parameters:** @@ -234,7 +256,7 @@ ___ ▸ **functionCallAccessKey**(`receiverId`: string, `methodNames`: String[], `allowance?`: BN): *[AccessKey](../classes/_transaction_.accesskey.md)* -*Defined in [src.ts/transaction.ts:33](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L33)* +*Defined in [src.ts/transaction.ts:33](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L33)* **Parameters:** @@ -252,7 +274,7 @@ ___ ▸ **signTransaction**(`receiverId`: string, `nonce`: number, `actions`: [Action](../classes/_transaction_.action.md)[], `blockHash`: Uint8Array, `signer`: [Signer](../classes/_signer_.signer.md), `accountId?`: string, `networkId?`: string): *Promise‹[Uint8Array, [SignedTransaction](../classes/_transaction_.signedtransaction.md)]›* -*Defined in [src.ts/transaction.ts:193](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L193)* +*Defined in [src.ts/transaction.ts:204](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L204)* **Parameters:** @@ -274,7 +296,7 @@ ___ ▸ **stake**(`stake`: BN, `publicKey`: [PublicKey](../classes/_utils_key_pair_.publickey.md)): *[Action](../classes/_transaction_.action.md)* -*Defined in [src.ts/transaction.ts:64](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L64)* +*Defined in [src.ts/transaction.ts:64](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L64)* **Parameters:** @@ -291,7 +313,7 @@ ___ ▸ **transfer**(`deposit`: BN): *[Action](../classes/_transaction_.action.md)* -*Defined in [src.ts/transaction.ts:60](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/transaction.ts#L60)* +*Defined in [src.ts/transaction.ts:60](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/transaction.ts#L60)* **Parameters:** diff --git a/docs/nearlib/modules/_utils_errors_.md b/docs/nearlib/modules/_utils_errors_.md new file mode 100644 index 0000000000..d827562572 --- /dev/null +++ b/docs/nearlib/modules/_utils_errors_.md @@ -0,0 +1,12 @@ +--- +id: "_utils_errors_" +title: "utils/errors" +sidebar_label: "utils/errors" +--- + +## Index + +### Classes + +* [ArgumentTypeError](../classes/_utils_errors_.argumenttypeerror.md) +* [PositionalArgsError](../classes/_utils_errors_.positionalargserror.md) diff --git a/docs/nearlib/modules/_utils_format_.md b/docs/nearlib/modules/_utils_format_.md index cd6fc9a949..7d59a5ed9f 100644 --- a/docs/nearlib/modules/_utils_format_.md +++ b/docs/nearlib/modules/_utils_format_.md @@ -9,13 +9,17 @@ sidebar_label: "utils/format" ### Variables * [BN](_utils_format_.md#const-bn) +* [BN10](_utils_format_.md#const-bn10) * [NEAR_NOMINATION](_utils_format_.md#const-near_nomination) * [NEAR_NOMINATION_EXP](_utils_format_.md#const-near_nomination_exp) +* [ROUNDING_OFFSETS](_utils_format_.md#const-rounding_offsets) ### Functions * [formatNearAmount](_utils_format_.md#formatnearamount) +* [formatWithCommas](_utils_format_.md#formatwithcommas) * [parseNearAmount](_utils_format_.md#parsenearamount) +* [trimTrailingZeroes](_utils_format_.md#trimtrailingzeroes) ## Variables @@ -23,7 +27,15 @@ sidebar_label: "utils/format" • **BN**: *any* = require ('bn.js') -*Defined in [src.ts/utils/format.ts:1](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/format.ts#L1)* +*Defined in [src.ts/utils/format.ts:1](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/format.ts#L1)* + +___ + +### `Const` BN10 + +• **BN10**: *any* = new BN(10) + +*Defined in [src.ts/utils/format.ts:15](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/format.ts#L15)* ___ @@ -31,7 +43,9 @@ ___ • **NEAR_NOMINATION**: *any* = new BN('10', 10).pow(new BN(NEAR_NOMINATION_EXP, 10)) -*Defined in [src.ts/utils/format.ts:6](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/format.ts#L6)* +*Defined in [src.ts/utils/format.ts:11](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/format.ts#L11)* + +Number of indivisible units in one NEAR. Derived from [NEAR_NOMINATION_EXP](_utils_format_.md#const-near_nomination_exp). ___ @@ -39,23 +53,51 @@ ___ • **NEAR_NOMINATION_EXP**: *24* = 24 -*Defined in [src.ts/utils/format.ts:4](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/format.ts#L4)* +*Defined in [src.ts/utils/format.ts:6](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/format.ts#L6)* + +Exponent for calculating how many indivisible units are there in one NEAR. See [NEAR_NOMINATION](_utils_format_.md#const-near_nomination). + +___ + +### `Const` ROUNDING_OFFSETS + +• **ROUNDING_OFFSETS**: *any[]* = [] + +*Defined in [src.ts/utils/format.ts:14](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/format.ts#L14)* ## Functions ### formatNearAmount -▸ **formatNearAmount**(`balance`: string): *string* +▸ **formatNearAmount**(`balance`: string, `fracDigits`: number): *string* -*Defined in [src.ts/utils/format.ts:12](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/format.ts#L12)* +*Defined in [src.ts/utils/format.ts:27](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/format.ts#L27)* -Convert account balance value from internal units (currently yoctoNEAR) to NEAR. +Convert account balance value from internal indivisible units to NEAR. 1 NEAR is defined by [NEAR_NOMINATION](_utils_format_.md#const-near_nomination). +Effectively this divides given amount by [NEAR_NOMINATION](_utils_format_.md#const-near_nomination). **Parameters:** -Name | Type | Description | ------- | ------ | ------ | -`balance` | string | | +Name | Type | Default | Description | +------ | ------ | ------ | ------ | +`balance` | string | - | decimal string representing balance in smallest non-divisible NEAR units (as specified by [NEAR_NOMINATION](_utils_format_.md#const-near_nomination)) | +`fracDigits` | number | NEAR_NOMINATION_EXP | number of fractional digits to preserve in formatted string. Balance is rounded to match given number of digits. | + +**Returns:** *string* + +___ + +### formatWithCommas + +▸ **formatWithCommas**(`value`: string): *string* + +*Defined in [src.ts/utils/format.ts:70](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/format.ts#L70)* + +**Parameters:** + +Name | Type | +------ | ------ | +`value` | string | **Returns:** *string* @@ -65,14 +107,31 @@ ___ ▸ **parseNearAmount**(`amt?`: string): *string | null* -*Defined in [src.ts/utils/format.ts:24](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/format.ts#L24)* +*Defined in [src.ts/utils/format.ts:51](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/format.ts#L51)* -Convert human readable near amount to internal account balance units. +Convert human readable NEAR amount to internal indivisible units. +Effectively this multiplies given amount by [NEAR_NOMINATION](_utils_format_.md#const-near_nomination). **Parameters:** Name | Type | Description | ------ | ------ | ------ | -`amt?` | string | | +`amt?` | string | decimal string (potentially fractional) denominated in NEAR. | **Returns:** *string | null* + +___ + +### trimTrailingZeroes + +▸ **trimTrailingZeroes**(`value`: string): *string* + +*Defined in [src.ts/utils/format.ts:66](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/format.ts#L66)* + +**Parameters:** + +Name | Type | +------ | ------ | +`value` | string | + +**Returns:** *string* diff --git a/docs/nearlib/modules/_utils_key_pair_.md b/docs/nearlib/modules/_utils_key_pair_.md index d94776a7af..3bf8ac5c8a 100644 --- a/docs/nearlib/modules/_utils_key_pair_.md +++ b/docs/nearlib/modules/_utils_key_pair_.md @@ -35,7 +35,7 @@ sidebar_label: "utils/key_pair" Ƭ **Arrayish**: *string | ArrayLike‹number›* -*Defined in [src.ts/utils/key_pair.ts:7](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L7)* +*Defined in [src.ts/utils/key_pair.ts:7](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L7)* ## Functions @@ -43,7 +43,7 @@ sidebar_label: "utils/key_pair" ▸ **key_type_to_str**(`keyType`: [KeyType](../enums/_utils_key_pair_.keytype.md)): *String* -*Defined in [src.ts/utils/key_pair.ts:19](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L19)* +*Defined in [src.ts/utils/key_pair.ts:19](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L19)* **Parameters:** @@ -59,7 +59,7 @@ ___ ▸ **str_to_key_type**(`keyType`: string): *[KeyType](../enums/_utils_key_pair_.keytype.md)* -*Defined in [src.ts/utils/key_pair.ts:26](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/key_pair.ts#L26)* +*Defined in [src.ts/utils/key_pair.ts:26](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/key_pair.ts#L26)* **Parameters:** diff --git a/docs/nearlib/modules/_utils_serialize_.md b/docs/nearlib/modules/_utils_serialize_.md index b01e255c77..3ec94cd1a6 100644 --- a/docs/nearlib/modules/_utils_serialize_.md +++ b/docs/nearlib/modules/_utils_serialize_.md @@ -19,6 +19,7 @@ sidebar_label: "utils/serialize" ### Variables * [INITIAL_LENGTH](_utils_serialize_.md#const-initial_length) +* [TextDecoder](_utils_serialize_.md#const-textdecoder) * [textDecoder](_utils_serialize_.md#const-textdecoder) ### Functions @@ -39,7 +40,7 @@ sidebar_label: "utils/serialize" Ƭ **Schema**: *Map‹Function, any›* -*Defined in [src.ts/utils/serialize.ts:27](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L27)* +*Defined in [src.ts/utils/serialize.ts:24](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L24)* ## Variables @@ -47,15 +48,23 @@ sidebar_label: "utils/serialize" • **INITIAL_LENGTH**: *1024* = 1024 -*Defined in [src.ts/utils/serialize.ts:25](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L25)* +*Defined in [src.ts/utils/serialize.ts:22](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L22)* + +___ + +### `Const` TextDecoder + +• **TextDecoder**: *any* = (typeof (global as any).TextDecoder !== 'function') ? encoding.TextDecoder : (global as any).TextDecoder + +*Defined in [src.ts/utils/serialize.ts:8](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L8)* ___ ### `Const` textDecoder -• **textDecoder**: *TextDecoder* = new TextDecoder('utf-8', { fatal: true }) +• **textDecoder**: *any* = new TextDecoder('utf-8', { fatal: true }) -*Defined in [src.ts/utils/serialize.ts:12](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L12)* +*Defined in [src.ts/utils/serialize.ts:9](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L9)* ## Functions @@ -63,7 +72,7 @@ ___ ▸ **base_decode**(`value`: string): *Uint8Array* -*Defined in [src.ts/utils/serialize.ts:21](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L21)* +*Defined in [src.ts/utils/serialize.ts:18](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L18)* **Parameters:** @@ -79,7 +88,7 @@ ___ ▸ **base_encode**(`value`: Uint8Array | string): *string* -*Defined in [src.ts/utils/serialize.ts:14](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L14)* +*Defined in [src.ts/utils/serialize.ts:11](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L11)* **Parameters:** @@ -95,7 +104,7 @@ ___ ▸ **deserialize**(`schema`: [Schema](_utils_serialize_.md#schema), `classType`: any, `buffer`: Buffer): *any* -*Defined in [src.ts/utils/serialize.ts:324](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L324)* +*Defined in [src.ts/utils/serialize.ts:321](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L321)* **Parameters:** @@ -113,7 +122,7 @@ ___ ▸ **deserializeField**(`schema`: [Schema](_utils_serialize_.md#schema), `fieldName`: string, `fieldType`: any, `reader`: [BinaryReader](../classes/_utils_serialize_.binaryreader.md)): *any* -*Defined in [src.ts/utils/serialize.ts:273](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L273)* +*Defined in [src.ts/utils/serialize.ts:270](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L270)* **Parameters:** @@ -132,7 +141,7 @@ ___ ▸ **deserializeStruct**(`schema`: [Schema](_utils_serialize_.md#schema), `classType`: any, `reader`: [BinaryReader](../classes/_utils_serialize_.binaryreader.md)): *any* -*Defined in [src.ts/utils/serialize.ts:296](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L296)* +*Defined in [src.ts/utils/serialize.ts:293](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L293)* **Parameters:** @@ -150,7 +159,7 @@ ___ ▸ **handlingRangeError**(`target`: any, `propertyKey`: string, `propertyDescriptor`: PropertyDescriptor): *void* -*Defined in [src.ts/utils/serialize.ts:114](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L114)* +*Defined in [src.ts/utils/serialize.ts:111](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L111)* **Parameters:** @@ -168,7 +177,7 @@ ___ ▸ **serialize**(`schema`: [Schema](_utils_serialize_.md#schema), `obj`: any): *Uint8Array* -*Defined in [src.ts/utils/serialize.ts:267](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L267)* +*Defined in [src.ts/utils/serialize.ts:264](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L264)* **Parameters:** @@ -185,7 +194,7 @@ ___ ▸ **serializeField**(`schema`: [Schema](_utils_serialize_.md#schema), `fieldName`: string, `value`: any, `fieldType`: any, `writer`: any): *void* -*Defined in [src.ts/utils/serialize.ts:203](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L203)* +*Defined in [src.ts/utils/serialize.ts:200](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L200)* **Parameters:** @@ -205,7 +214,7 @@ ___ ▸ **serializeStruct**(`schema`: [Schema](_utils_serialize_.md#schema), `obj`: any, `writer`: any): *void* -*Defined in [src.ts/utils/serialize.ts:241](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/serialize.ts#L241)* +*Defined in [src.ts/utils/serialize.ts:238](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/serialize.ts#L238)* **Parameters:** diff --git a/docs/nearlib/modules/_utils_web_.md b/docs/nearlib/modules/_utils_web_.md index b5e772c2d4..461032b2fb 100644 --- a/docs/nearlib/modules/_utils_web_.md +++ b/docs/nearlib/modules/_utils_web_.md @@ -24,7 +24,7 @@ sidebar_label: "utils/web" • **fetch**: *any* -*Defined in [src.ts/utils/web.ts:15](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/web.ts#L15)* +*Defined in [src.ts/utils/web.ts:15](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/web.ts#L15)* ## Functions @@ -32,7 +32,7 @@ sidebar_label: "utils/web" ▸ **fetchJson**(`connection`: string | [ConnectionInfo](../interfaces/_utils_web_.connectioninfo.md), `json?`: string): *Promise‹any›* -*Defined in [src.ts/utils/web.ts:39](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/utils/web.ts#L39)* +*Defined in [src.ts/utils/web.ts:39](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/utils/web.ts#L39)* **Parameters:** diff --git a/docs/nearlib/modules/_wallet_account_.md b/docs/nearlib/modules/_wallet_account_.md index bdbd1ac817..a43cd353e5 100644 --- a/docs/nearlib/modules/_wallet_account_.md +++ b/docs/nearlib/modules/_wallet_account_.md @@ -22,7 +22,7 @@ sidebar_label: "wallet-account" • **LOCAL_STORAGE_KEY_SUFFIX**: *"_wallet_auth_key"* = "_wallet_auth_key" -*Defined in [src.ts/wallet-account.ts:10](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/wallet-account.ts#L10)* +*Defined in [src.ts/wallet-account.ts:10](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/wallet-account.ts#L10)* ___ @@ -30,7 +30,7 @@ ___ • **LOGIN_WALLET_URL_SUFFIX**: *"/login/"* = "/login/" -*Defined in [src.ts/wallet-account.ts:8](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/wallet-account.ts#L8)* +*Defined in [src.ts/wallet-account.ts:8](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/wallet-account.ts#L8)* ___ @@ -38,4 +38,4 @@ ___ • **PENDING_ACCESS_KEY_PREFIX**: *"pending_key"* = "pending_key" -*Defined in [src.ts/wallet-account.ts:11](https://github.com/nearprotocol/nearlib/blob/fe97eb6/src.ts/wallet-account.ts#L11)* +*Defined in [src.ts/wallet-account.ts:11](https://github.com/nearprotocol/nearlib/blob/476d416/src.ts/wallet-account.ts#L11)* diff --git a/lib/utils/format.d.ts b/lib/utils/format.d.ts index 2aeaf5bcf9..2e17f8e00c 100644 --- a/lib/utils/format.d.ts +++ b/lib/utils/format.d.ts @@ -1,7 +1,7 @@ /** * Exponent for calculating how many indivisible units are there in one NEAR. See {@link NEAR_NOMINATION}. */ -export declare const NEAR_NOMINATION_EXP = 18; +export declare const NEAR_NOMINATION_EXP = 24; /** * Number of indivisible units in one NEAR. Derived from {@link NEAR_NOMINATION_EXP}. */ diff --git a/lib/utils/format.js b/lib/utils/format.js index 3162324297..1bf4b2671a 100644 --- a/lib/utils/format.js +++ b/lib/utils/format.js @@ -4,7 +4,7 @@ const BN = require('bn.js'); /** * Exponent for calculating how many indivisible units are there in one NEAR. See {@link NEAR_NOMINATION}. */ -exports.NEAR_NOMINATION_EXP = 18; +exports.NEAR_NOMINATION_EXP = 24; /** * Number of indivisible units in one NEAR. Derived from {@link NEAR_NOMINATION_EXP}. */ diff --git a/src.ts/utils/format.ts b/src.ts/utils/format.ts index b8426b44ad..b5004b4dd3 100644 --- a/src.ts/utils/format.ts +++ b/src.ts/utils/format.ts @@ -3,7 +3,7 @@ const BN = require ('bn.js'); /** * Exponent for calculating how many indivisible units are there in one NEAR. See {@link NEAR_NOMINATION}. */ -export const NEAR_NOMINATION_EXP = 18; +export const NEAR_NOMINATION_EXP = 24; /** * Number of indivisible units in one NEAR. Derived from {@link NEAR_NOMINATION_EXP}. diff --git a/test/utils/format.test.js b/test/utils/format.test.js index 2faa03537c..e88d59b3e8 100644 --- a/test/utils/format.test.js +++ b/test/utils/format.test.js @@ -4,33 +4,29 @@ const nearlib = require('../../lib/index'); jasmine.DEFAULT_TIMEOUT_INTERVAL = 50000; -xtest('formatting yoctonear amounts', async() => { +test('formatting yoctonear amounts', async() => { expect(nearlib.utils.format.formatNearAmount('8999999999837087887')).toEqual('0.000008999999999837087887'); expect(nearlib.utils.format.formatNearAmount('8099099999837087887')).toEqual('0.000008099099999837087887'); expect(nearlib.utils.format.formatNearAmount('8099099999837087887')).not.toEqual('0.000008099099999837087888'); expect(nearlib.utils.format.formatNearAmount('999998999999999837087887000')).toEqual('999.998999999999837087887'); expect(nearlib.utils.format.formatNearAmount('1'+'0'.repeat(13))).toEqual('0.00000000001'); expect(nearlib.utils.format.formatNearAmount('9999989999999998370878870000000')).toEqual('9,999,989.99999999837087887'); -}); - -test('formatting attonear amounts', async() => { - // These tests are in atto near right now. Need to update when the constant changes. - expect(nearlib.utils.format.formatNearAmount('000000000000000000')).toEqual('0'); - expect(nearlib.utils.format.formatNearAmount('1000000000000000000')).toEqual('1'); - expect(nearlib.utils.format.formatNearAmount('999999999999999999')).toEqual('0.999999999999999999'); - expect(nearlib.utils.format.formatNearAmount('999999999999999999', 10)).toEqual('1'); - expect(nearlib.utils.format.formatNearAmount('1003000000000000000', 3)).toEqual('1.003'); - expect(nearlib.utils.format.formatNearAmount('3000000000000000', 3)).toEqual('0.003'); - expect(nearlib.utils.format.formatNearAmount('3000000000000000', 4)).toEqual('0.003'); - expect(nearlib.utils.format.formatNearAmount('3500000000000000', 3)).toEqual('0.004'); - expect(nearlib.utils.format.formatNearAmount('03500000000000000', 3)).toEqual('0.004'); - expect(nearlib.utils.format.formatNearAmount('10000000999999997410')).toEqual('10.00000099999999741'); - expect(nearlib.utils.format.formatNearAmount('10100000999999997410')).toEqual('10.10000099999999741'); - expect(nearlib.utils.format.formatNearAmount('10040000999999997410', 2)).toEqual('10.04'); - expect(nearlib.utils.format.formatNearAmount('10999000999999997410', 2)).toEqual('11'); - expect(nearlib.utils.format.formatNearAmount('1000000100000000000000000')).toEqual('1,000,000.1'); - expect(nearlib.utils.format.formatNearAmount('1000100000000000000000000')).toEqual('1,000,100'); - expect(nearlib.utils.format.formatNearAmount('910000000000000000', 0)).toEqual('1'); + expect(nearlib.utils.format.formatNearAmount('000000000000000000000000')).toEqual('0'); + expect(nearlib.utils.format.formatNearAmount('1000000000000000000000000')).toEqual('1'); + expect(nearlib.utils.format.formatNearAmount('999999999999999999000000')).toEqual('0.999999999999999999'); + expect(nearlib.utils.format.formatNearAmount('999999999999999999000000', 10)).toEqual('1'); + expect(nearlib.utils.format.formatNearAmount('1003000000000000000000000', 3)).toEqual('1.003'); + expect(nearlib.utils.format.formatNearAmount('3000000000000000000000', 3)).toEqual('0.003'); + expect(nearlib.utils.format.formatNearAmount('3000000000000000000000', 4)).toEqual('0.003'); + expect(nearlib.utils.format.formatNearAmount('3500000000000000000000', 3)).toEqual('0.004'); + expect(nearlib.utils.format.formatNearAmount('03500000000000000000000', 3)).toEqual('0.004'); + expect(nearlib.utils.format.formatNearAmount('10000000999999997410000000')).toEqual('10.00000099999999741'); + expect(nearlib.utils.format.formatNearAmount('10100000999999997410000000')).toEqual('10.10000099999999741'); + expect(nearlib.utils.format.formatNearAmount('10040000999999997410000000', 2)).toEqual('10.04'); + expect(nearlib.utils.format.formatNearAmount('10999000999999997410000000', 2)).toEqual('11'); + expect(nearlib.utils.format.formatNearAmount('1000000100000000000000000000000')).toEqual('1,000,000.1'); + expect(nearlib.utils.format.formatNearAmount('1000100000000000000000000000000')).toEqual('1,000,100'); + expect(nearlib.utils.format.formatNearAmount('910000000000000000000000', 0)).toEqual('1'); }); // TODO: Renable after moving to yoctonear diff --git a/website/sidebars.json b/website/sidebars.json index c6fdb17e27..7c634f82e6 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -58,6 +58,7 @@ "nearlib/interfaces/_providers_provider_.syncinfo", "nearlib/interfaces/_providers_provider_.totalweight", "nearlib/interfaces/_providers_provider_.transaction", + "nearlib/interfaces/_providers_provider_.version", "nearlib/modules/_signer_", "nearlib/classes/_signer_.inmemorysigner", "nearlib/classes/_signer_.signer", @@ -82,6 +83,9 @@ "nearlib/modules/_utils_enums_", "nearlib/classes/_utils_enums_.assignable", "nearlib/classes/_utils_enums_.enum", + "nearlib/modules/_utils_errors_", + "nearlib/classes/_utils_errors_.argumenttypeerror", + "nearlib/classes/_utils_errors_.positionalargserror", "nearlib/modules/_utils_format_", "nearlib/modules/_utils_index_", "nearlib/modules/_utils_key_pair_", @@ -138,6 +142,8 @@ "nearlib/classes/_transaction_.transfer", "nearlib/classes/_utils_enums_.assignable", "nearlib/classes/_utils_enums_.enum", + "nearlib/classes/_utils_errors_.argumenttypeerror", + "nearlib/classes/_utils_errors_.positionalargserror", "nearlib/classes/_utils_key_pair_.keypair", "nearlib/classes/_utils_key_pair_.keypaired25519", "nearlib/classes/_utils_key_pair_.publickey", @@ -173,6 +179,7 @@ "nearlib/interfaces/_providers_provider_.syncinfo", "nearlib/interfaces/_providers_provider_.totalweight", "nearlib/interfaces/_providers_provider_.transaction", + "nearlib/interfaces/_providers_provider_.version", "nearlib/interfaces/_utils_key_pair_.signature", "nearlib/interfaces/_utils_network_.network", "nearlib/interfaces/_utils_web_.connectioninfo" From d578981bf11399796478ae8333ff577e2bb676ec Mon Sep 17 00:00:00 2001 From: Jane Date: Wed, 18 Dec 2019 12:45:59 -0500 Subject: [PATCH 2/2] Reenable tests for input --- test/utils/format.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils/format.test.js b/test/utils/format.test.js index e88d59b3e8..bc893c39f6 100644 --- a/test/utils/format.test.js +++ b/test/utils/format.test.js @@ -30,7 +30,7 @@ test('formatting yoctonear amounts', async() => { }); // TODO: Renable after moving to yoctonear -xtest('converting near to account balance units', async() => { +test('converting near to account balance units', async() => { expect(nearlib.utils.format.parseNearAmount(null)).toEqual(null); expect(nearlib.utils.format.parseNearAmount('5.3')).toEqual('5300000000000000000000000'); expect(nearlib.utils.format.parseNearAmount('5')).toEqual('5000000000000000000000000');