@fuel-ts/interfaces
Advanced tools
Comparing version 0.0.0-master-7e615a34 to 0.0.0-master-92cc35d4
@@ -5,2 +5,6 @@ import { BytesLike } from '@ethersproject/bytes'; | ||
declare type ContractId = string; | ||
declare abstract class AbstractScript<T> { | ||
abstract bytes: Uint8Array; | ||
abstract encodeScriptData: (data: T) => Uint8Array; | ||
} | ||
declare abstract class AbstractContract { | ||
@@ -17,2 +21,2 @@ abstract id: ContractId; | ||
export { AbstractContract, AbstractWallet, Address, AddressLike, ContractId, ContractIdLike, addressify, contractIdify }; | ||
export { AbstractContract, AbstractScript, AbstractWallet, Address, AddressLike, ContractId, ContractIdLike, addressify, contractIdify }; |
@@ -1,2 +0,2 @@ | ||
(()=>{var y="logger/5.6.0";var I=!1,w=!1,u={debug:1,default:2,info:2,warning:3,error:4,off:5},P=u.default,N=null;function b(){try{let r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(r){return r.message}return null}var U=b(),g;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(g||(g={}));var f;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED"})(f||(f={}));var _="0123456789abcdef",i=class{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){let n=t.toLowerCase();u[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(P>u[n])&&console.log.apply(console,e)}debug(...t){this._log(i.levels.DEBUG,t)}info(...t){this._log(i.levels.INFO,t)}warn(...t){this._log(i.levels.WARNING,t)}makeError(t,e,n){if(w)return this.makeError("censored error",e,{});e||(e=i.errors.UNKNOWN_ERROR),n||(n={});let s=[];Object.keys(n).forEach(o=>{let l=n[o];try{if(l instanceof Uint8Array){let E="";for(let a=0;a<l.length;a++)E+=_[l[a]>>4],E+=_[l[a]&15];s.push(o+"=Uint8Array(0x"+E+")")}else s.push(o+"="+JSON.stringify(l))}catch{s.push(o+"="+JSON.stringify(n[o].toString()))}}),s.push(`code=${e}`),s.push(`version=${this.version}`);let O=t,c="";switch(e){case f.NUMERIC_FAULT:{c="NUMERIC_FAULT";let o=t;switch(o){case"overflow":case"underflow":case"division-by-zero":c+="-"+o;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case f.CALL_EXCEPTION:case f.INSUFFICIENT_FUNDS:case f.MISSING_NEW:case f.NONCE_EXPIRED:case f.REPLACEMENT_UNDERPRICED:case f.TRANSACTION_REPLACED:case f.UNPREDICTABLE_GAS_LIMIT:c=e;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),s.length&&(t+=" ("+s.join(", ")+")");let h=new Error(t);return h.reason=O,h.code=e,Object.keys(n).forEach(function(o){h[o]=n[o]}),h}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,i.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,s){t||this.throwError(e,n,s)}assertArgument(t,e,n,s){t||this.throwArgumentError(e,n,s)}checkNormalize(t){t==null&&(t="platform missing String.prototype.normalize"),U&&this.throwError("platform missing String.prototype.normalize",i.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:U})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,i.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,i.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,i.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,i.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",i.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",i.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",i.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return N||(N=new i(y)),N}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",i.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),I){if(!t)return;this.globalLogger().throwError("error censorship permanent",i.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}w=!!t,I=!!e}static setLogLevel(t){let e=u[t.toLowerCase()];if(e==null){i.globalLogger().warn("invalid log level - "+t);return}P=e}static from(t){return new i(t)}};i.errors=f;i.levels=g;var S="bytes/5.6.1";var m=new i(S);function D(r){return!!r.toHexString}function T(r){return typeof r=="number"&&r==r&&r%1===0}function C(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!T(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){let e=r[t];if(!T(e)||e<0||e>=256)return!1}return!0}function d(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||t&&r.length!==2+2*t)}var x="0123456789abcdef";function A(r,t){if(t||(t={}),typeof r=="number"){m.checkSafeUint53(r,"invalid hexlify value");let e="";for(;r;)e=x[r&15]+e,r=Math.floor(r/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),D(r))return r.toHexString();if(d(r))return r.length%2&&(t.hexPad==="left"?r="0x0"+r.substring(2):t.hexPad==="right"?r+="0":m.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(C(r)){let e="0x";for(let n=0;n<r.length;n++){let s=r[n];e+=x[(s&240)>>4]+x[s&15]}return e}return m.throwArgumentError("invalid hexlify value","value",r)}var R=class{},p=class{},z=r=>r instanceof p?r.address:A(r),X=r=>r instanceof R?r.id:A(r);})(); | ||
(()=>{var p="logger/5.6.0";var I=!1,w=!1,u={debug:1,default:2,info:2,warning:3,error:4,off:5},U=u.default,N=null;function D(){try{let r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(r){return r.message}return null}var P=D(),g;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(g||(g={}));var f;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED"})(f||(f={}));var _="0123456789abcdef",i=class{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){let n=t.toLowerCase();u[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(U>u[n])&&console.log.apply(console,e)}debug(...t){this._log(i.levels.DEBUG,t)}info(...t){this._log(i.levels.INFO,t)}warn(...t){this._log(i.levels.WARNING,t)}makeError(t,e,n){if(w)return this.makeError("censored error",e,{});e||(e=i.errors.UNKNOWN_ERROR),n||(n={});let s=[];Object.keys(n).forEach(o=>{let l=n[o];try{if(l instanceof Uint8Array){let a="";for(let E=0;E<l.length;E++)a+=_[l[E]>>4],a+=_[l[E]&15];s.push(o+"=Uint8Array(0x"+a+")")}else s.push(o+"="+JSON.stringify(l))}catch{s.push(o+"="+JSON.stringify(n[o].toString()))}}),s.push(`code=${e}`),s.push(`version=${this.version}`);let O=t,c="";switch(e){case f.NUMERIC_FAULT:{c="NUMERIC_FAULT";let o=t;switch(o){case"overflow":case"underflow":case"division-by-zero":c+="-"+o;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case f.CALL_EXCEPTION:case f.INSUFFICIENT_FUNDS:case f.MISSING_NEW:case f.NONCE_EXPIRED:case f.REPLACEMENT_UNDERPRICED:case f.TRANSACTION_REPLACED:case f.UNPREDICTABLE_GAS_LIMIT:c=e;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),s.length&&(t+=" ("+s.join(", ")+")");let h=new Error(t);return h.reason=O,h.code=e,Object.keys(n).forEach(function(o){h[o]=n[o]}),h}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,i.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,s){t||this.throwError(e,n,s)}assertArgument(t,e,n,s){t||this.throwArgumentError(e,n,s)}checkNormalize(t){t==null&&(t="platform missing String.prototype.normalize"),P&&this.throwError("platform missing String.prototype.normalize",i.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:P})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,i.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,i.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,i.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,i.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",i.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",i.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",i.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return N||(N=new i(p)),N}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",i.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),I){if(!t)return;this.globalLogger().throwError("error censorship permanent",i.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}w=!!t,I=!!e}static setLogLevel(t){let e=u[t.toLowerCase()];if(e==null){i.globalLogger().warn("invalid log level - "+t);return}U=e}static from(t){return new i(t)}};i.errors=f;i.levels=g;var S="bytes/5.6.1";var m=new i(S);function d(r){return!!r.toHexString}function T(r){return typeof r=="number"&&r==r&&r%1===0}function C(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!T(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){let e=r[t];if(!T(e)||e<0||e>=256)return!1}return!0}function v(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||t&&r.length!==2+2*t)}var x="0123456789abcdef";function A(r,t){if(t||(t={}),typeof r=="number"){m.checkSafeUint53(r,"invalid hexlify value");let e="";for(;r;)e=x[r&15]+e,r=Math.floor(r/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),d(r))return r.toHexString();if(v(r))return r.length%2&&(t.hexPad==="left"?r="0x0"+r.substring(2):t.hexPad==="right"?r+="0":m.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(C(r)){let e="0x";for(let n=0;n<r.length;n++){let s=r[n];e+=x[(s&240)>>4]+x[s&15]}return e}return m.throwArgumentError("invalid hexlify value","value",r)}var b=class{},R=class{},y=class{},X=r=>r instanceof y?r.address:A(r),j=r=>r instanceof R?r.id:A(r);})(); | ||
//# sourceMappingURL=index.global.js.map |
@@ -1,2 +0,2 @@ | ||
var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var f=(t,r)=>{for(var s in r)a(t,s,{get:r[s],enumerable:!0})},x=(t,r,s,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of c(r))!y.call(t,e)&&e!==s&&a(t,e,{get:()=>r[e],enumerable:!(i=p(r,e))||i.enumerable});return t};var C=t=>x(a({},"__esModule",{value:!0}),t);var I={};f(I,{AbstractContract:()=>o,AbstractWallet:()=>d,addressify:()=>b,contractIdify:()=>A});module.exports=C(I);var n=require("@ethersproject/bytes"),o=class{},d=class{},b=t=>t instanceof d?t.address:(0,n.hexlify)(t),A=t=>t instanceof o?t.id:(0,n.hexlify)(t);0&&(module.exports={AbstractContract,AbstractWallet,addressify,contractIdify}); | ||
var d=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var f=(t,r)=>{for(var s in r)d(t,s,{get:r[s],enumerable:!0})},b=(t,r,s,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of y(r))!x.call(t,e)&&e!==s&&d(t,e,{get:()=>r[e],enumerable:!(i=p(r,e))||i.enumerable});return t};var A=t=>b(d({},"__esModule",{value:!0}),t);var l={};f(l,{AbstractContract:()=>a,AbstractScript:()=>n,AbstractWallet:()=>o,addressify:()=>C,contractIdify:()=>I});module.exports=A(l);var c=require("@ethersproject/bytes"),n=class{},a=class{},o=class{},C=t=>t instanceof o?t.address:(0,c.hexlify)(t),I=t=>t instanceof a?t.id:(0,c.hexlify)(t);0&&(module.exports={AbstractContract,AbstractScript,AbstractWallet,addressify,contractIdify}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@fuel-ts/interfaces", | ||
"version": "0.0.0-master-7e615a34", | ||
"version": "0.0.0-master-92cc35d4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
31254
46