tronlink-gasfree-sdk-js 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +85 -85
- package/LICENSE +0 -191
- package/README.md +0 -273
package/dist/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("TronLinkExtensionCore",[],r):"object"==typeof exports?exports.TronLinkExtensionCore=r():e.TronLinkExtensionCore=r()}(this,()=>(()=>{"use strict";var e={158:e=>{e.exports=require("buffer")}},r={};function a(t){var n=r[t];if(void 0!==n)return n.exports;var f=r[t]={exports:{}};return e[t](f,f.exports,a),f.exports}a.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return a.d(r,{a:r}),r},a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};a.r(t),a.d(t,{TronGasFree:()=>K});const n=require("@babel/runtime-corejs3/core-js/object/define-property");var f=a.n(n);const o=require("@babel/runtime-corejs3/core-js/symbol");var i=a.n(o);const d=require("@babel/runtime-corejs3/core-js/object/create");var c=a.n(d);const b=require("@babel/runtime-corejs3/core-js/instance/bind");var s=a.n(b);const u=require("@babel/runtime-corejs3/core-js/object/get-prototype-of");var l=a.n(u);const h=require("@babel/runtime-corejs3/core-js/object/set-prototype-of");var v=a.n(h);const m=require("@babel/runtime-corejs3/helpers/extends");var p=a.n(m);const y=require("@babel/runtime-corejs3/helpers/asyncToGenerator");var I=a.n(y);const g=require("@babel/runtime-corejs3/helpers/inheritsLoose");var T=a.n(g);const x=require("tronweb");var k=a.n(x);const A=require("@ethereumjs/util"),j=require("@babel/runtime-corejs3/core-js/number/is-integer");var C=a.n(j);const E=require("@babel/runtime-corejs3/core-js/instance/starts-with");var w=a.n(E);const F=require("@babel/runtime-corejs3/core-js/instance/slice");var S=a.n(F);const N=require("@babel/runtime-corejs3/core-js/instance/pad-start");var q=a.n(N);const P=require("@babel/runtime-corejs3/core-js/instance/concat");var V=a.n(P);const G=require("eth-sig-util"),H=require("ethereum-cryptography/keccak"),M=require("ethereumjs-abi");var B,L=a.n(M);function D(e){var r;return(0,A.toChecksumAddress)("0x"+S()(r=k().address.toHex(e)).call(r,2))}function _(e){return k().address.fromHex(e)}function Q(e){return null!=e}var U=function(e){return e[e.MAINNET=Number("0x2b6653dc")]="MAINNET",e[e.SHASTA=Number("0x94a9059e")]="SHASTA",e[e.NILE=Number("0xcd8690dc")]="NILE",e}({}),O=((B={})[U.MAINNET]={chainId:U.MAINNET,gasFreeController:"TFFAMQLZybALaLb4uxHA9RBE7pxhUAjF3U",beacon:"TSP9UW6FQhT76XD2jWA6ipGMx3yGbjDffP",creationCode:"0x60a06040908082526103e5803803809161001982856101d6565b833981019082818303126101d2576100308161020d565b91602091828101519060018060401b0382116101d2570181601f820112156101d25780519061005e8261022a565b9261006b875194856101d6565b8284528483830101116101d25783905f5b8381106101be5750505f9183010152823b1561017a5780516100b3575b50506080525161013c90816102a982396080518160180152f35b8351635c60da1b60e01b81529082826004816001600160a01b0388165afa918215610170575f9261012d575b50905f80838561011c9695519101845af4903d15610124573d6101018161022a565b9061010e885192836101d6565b81525f81943d92013e610245565b505f80610099565b60609250610245565b90918382813d8311610169575b61014481836101d6565b810103126101665750905f8061015d61011c959461020d565b939450506100df565b80fd5b503d61013a565b85513d5f823e3d90fd5b835162461bcd60e51b815260048101839052601b60248201527f626561636f6e2073686f756c64206265206120636f6e747261637400000000006044820152606490fd5b81810183015185820184015285920161007c565b5f80fd5b601f909101601f19168101906001600160401b038211908210176101f957604052565b634e487b7160e01b5f52604160045260245ffd5b516001600160a81b03811681036101d2576001600160a01b031690565b6001600160401b0381116101f957601f01601f191660200190565b9061026c575080511561025a57805190602001fd5b604051630a12f52160e11b8152600490fd5b8151158061029f575b61027d575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b1561027556fe60806040819052635c60da1b60e01b81526020816004817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa9081156100ae575f91610056575b506100e8565b6020903d82116100a6575b601f8201601f1916810167ffffffffffffffff8111828210176100925761008c9350604052016100b9565b5f610050565b634e487b7160e01b84526041600452602484fd5b3d9150610061565b6040513d5f823e3d90fd5b602090607f1901126100e4576080516001600160a81b03811681036100e4576001600160a01b031690565b5f80fd5b5f808092368280378136915af43d82803e15610102573d90f35b3d90fdfea26474726f6e58221220309a2919b7a1b203f1a7a1c544a7d671bb94b0adf8a39e4c9b6eeb6d03939ffe64736f6c63430008140033"},B[U.SHASTA]={chainId:U.SHASTA,gasFreeController:"TQghdCeVDA6CnuNVTUhfaAyPfTetqZWNpm",beacon:"TQ1jvA3nLDMDNbJoMPLzTPoqAg8NvZ5CCW",creationCode:"0x60a06040908082526104b8803803809161001982856102a9565b833981019082818303126102a557610030816102e0565b91602091828101519060018060401b0382116102a5570181601f820112156102a55780519061005e826102fd565b9261006b875194856102a9565b8284528483830101116102a55783905f5b8381106102915750505f9183010152823b15610271577fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080546001600160a01b0319166001600160a01b038581169182179092558551635c60da1b60e01b8082529193928582600481885afa918215610267575f92610230575b50813b156102175750508551837f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e5f80a28251156101f857508390600487518095819382525afa9182156101ee575f926101ab575b50905f8083856101889695519101845af4903d156101a2573d61016d816102fd565b9061017a885192836102a9565b81525f81943d92013e610318565b505b6080525161013c908161037c82396080518160180152f35b60609250610318565b90918382813d83116101e7575b6101c281836102a9565b810103126101e45750905f806101db61018895946102e0565b9394505061014b565b80fd5b503d6101b8565b85513d5f823e3d90fd5b935050505034610208575061018a565b63b398979f60e01b8152600490fd5b8751634c9c8ce360e01b81529116600482015260249150fd5b90918682813d8311610260575b61024781836102a9565b810103126101e45750610259906102e0565b905f6100f6565b503d61023d565b88513d5f823e3d90fd5b8351631933b43b60e21b81526001600160a01b0384166004820152602490fd5b81810183015185820184015285920161007c565b5f80fd5b601f909101601f19168101906001600160401b038211908210176102cc57604052565b634e487b7160e01b5f52604160045260245ffd5b516001600160a81b03811681036102a5576001600160a01b031690565b6001600160401b0381116102cc57601f01601f191660200190565b9061033f575080511561032d57805190602001fd5b604051630a12f52160e11b8152600490fd5b81511580610372575b610350575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b1561034856fe60806040819052635c60da1b60e01b81526020816004817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa9081156100ae575f91610056575b506100e8565b6020903d82116100a6575b601f8201601f1916810167ffffffffffffffff8111828210176100925761008c9350604052016100b9565b5f610050565b634e487b7160e01b84526041600452602484fd5b3d9150610061565b6040513d5f823e3d90fd5b602090607f1901126100e4576080516001600160a81b03811681036100e4576001600160a01b031690565b5f80fd5b5f808092368280378136915af43d82803e15610102573d90f35b3d90fdfea26474726f6e58221220b3a0a0f4043f8fe355d62319dafed2ba5d611d7bb6dfe21d6d935af1510ce27964736f6c63430008140033"},B[U.NILE]={chainId:U.NILE,gasFreeController:"THQGuFzL87ZqhxkgqYEryRAd7gqFqL5rdc",beacon:"TLtCGmaxH3PbuaF6kbybwteZcHptEdgQGC",creationCode:"0x60a06040908082526103e5803803809161001982856101d6565b833981019082818303126101d2576100308161020d565b91602091828101519060018060401b0382116101d2570181601f820112156101d25780519061005e8261022a565b9261006b875194856101d6565b8284528483830101116101d25783905f5b8381106101be5750505f9183010152823b1561017a5780516100b3575b50506080525161013c90816102a982396080518160180152f35b8351635c60da1b60e01b81529082826004816001600160a01b0388165afa918215610170575f9261012d575b50905f80838561011c9695519101845af4903d15610124573d6101018161022a565b9061010e885192836101d6565b81525f81943d92013e610245565b505f80610099565b60609250610245565b90918382813d8311610169575b61014481836101d6565b810103126101665750905f8061015d61011c959461020d565b939450506100df565b80fd5b503d61013a565b85513d5f823e3d90fd5b835162461bcd60e51b815260048101839052601b60248201527f626561636f6e2073686f756c64206265206120636f6e747261637400000000006044820152606490fd5b81810183015185820184015285920161007c565b5f80fd5b601f909101601f19168101906001600160401b038211908210176101f957604052565b634e487b7160e01b5f52604160045260245ffd5b516001600160a81b03811681036101d2576001600160a01b031690565b6001600160401b0381116101f957601f01601f191660200190565b9061026c575080511561025a57805190602001fd5b604051630a12f52160e11b8152600490fd5b8151158061029f575b61027d575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b1561027556fe60806040819052635c60da1b60e01b81526020816004817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa9081156100ae575f91610056575b506100e8565b6020903d82116100a6575b601f8201601f1916810167ffffffffffffffff8111828210176100925761008c9350604052016100b9565b5f610050565b634e487b7160e01b84526041600452602484fd5b3d9150610061565b6040513d5f823e3d90fd5b602090607f1901126100e4576080516001600160a81b03811681036100e4576001600160a01b031690565b5f80fd5b5f808092368280378136915af43d82803e15610102573d90f35b3d90fdfea26474726f6e5822122019fba3a984dfef08920adc4d0e531dbd369df1dec237bfb02ce668f5d8e2704064736f6c63430008140033"},B),Z=[{name:"token",type:"address"},{name:"serviceProvider",type:"address"},{name:"user",type:"address"},{name:"receiver",type:"address"},{name:"value",type:"uint256"},{name:"maxFee",type:"uint256"},{name:"deadline",type:"uint256"},{name:"version",type:"uint256"},{name:"nonce",type:"uint256"}],J=[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],W=a(158).Buffer,z=function(){function e(e){this.chainInfo=void 0;var r=e.chainId,a=e.chainInfo;if(Q(r)&&Q(a)||!Q(r)&&!Q(a))throw Error("Invalid arguments provided. This function requires exactly one argument: either chainId or chainInfo, but not both.");if(Q(r)){if(!this.checkIsValidChainId(r))throw Error("Invalid chainId: "+r);var t=O[r];if(!t)throw Error("Invalid chainId: "+r);this.chainInfo=t}else{var n=a,f=n.chainId,o=n.gasFreeController,i=n.beacon,d=n.creationCode;if(!this.checkIsValidChainId(f))throw Error("Invalid chainId: "+f);if(!this.checkIsValidAddress(o))throw Error("Invalid gasFreeController: "+o);if(!this.checkIsValidAddress(i))throw Error("Invalid beacon: "+i);if(!this.checkIsValidCreationCode(d))throw Error("Invalid creationCode: "+d);this.chainInfo={chainId:f,gasFreeController:o,beacon:i,creationCode:d}}}var r=e.prototype;return r.checkIsValidChainId=function(e){var r=Number(e);return!(!C()(r)||r<=0)&&!(r>Number("0xffffffff"))},r.checkIsValidCreationCode=function(e){try{return!!e&&(e=w()(e).call(e,"0x")?S()(e).call(e,2):e,!!/^[0-9a-fA-F]*$/.test(e)&&e.length%2==0)}catch(e){return!1}},r.assembleStandard712GasFreeTransactionJson=function(e){var r=e.token,a=e.serviceProvider,t=e.user,n=e.receiver,f=e.value,o=e.maxFee,i=e.deadline,d=e.version,c=e.nonce;if(!this.checkIsValidAddress(r))throw Error("Invalid token: "+r);if(!this.checkIsValidAddress(a))throw Error("Invalid serviceProvider: "+a);if(!this.checkIsValidAddress(t))throw Error("Invalid user: "+t);if(!this.checkIsValidAddress(n))throw Error("Invalid receiver: "+n);if("string"!=typeof f)throw Error("'value' must be a string of numbers: "+f);if("string"!=typeof o)throw Error("'maxFee' must be a string of numbers: "+o);if(!this.checkIsValidMessageNumber(f))throw Error("Invalid value: "+f);if(!this.checkIsValidMessageNumber(o))throw Error("Invalid maxFee: "+o);if(!this.checkIsValidMessageNumber(i))throw Error("Invalid deadline: "+i);if(!this.checkIsValidMessageNumber(d))throw Error("Invalid version: "+d);if(!this.checkIsValidMessageNumber(c))throw Error("Invalid nonce: "+c);var b=this.getGasFreeTypedDataDomain();return{types:{PermitTransfer:Z,EIP712Domain:J},domain:b,message:{token:D(r),serviceProvider:D(a),user:D(t),receiver:D(n),value:f,maxFee:o,deadline:i,version:d,nonce:c},primaryType:"PermitTransfer"}},r.checkIsValidMessageNumber=function(e){if("string"!=typeof e&&"number"!=typeof e)return!1;try{if(BigInt(e)<0n)return!1}catch(e){return!1}return!0},r.calculateSalt=function(e){var r;if(!this.checkIsValidAddress(e))throw Error("Invalid address: "+e);var a=D(e);return"0x"+q()(r=S()(a).call(a,2)).call(r,64,"0")},r.addFunctionSelectorToAddress=function(e){var r;if(!w()(e).call(e,"0x")||66!==e.length)throw new Error("Invalid address format");return S()(r=(0,A.bufferToHex)((0,H.keccak256)(W.from("initialize(address)")))).call(r,0,10)+S()(e).call(e,2)},r.calculateBytecodeHash=function(e,r,a){if(!this.checkIsValidAddress(e))throw Error("Invalid address: "+e);var t=this.addFunctionSelectorToAddress(this.calculateSalt(e)),n=D(r),f=V()(W).call(W,[(0,A.toBuffer)(a),(0,A.toBuffer)(L().rawEncode(["address","bytes"],[n,(0,A.toBuffer)(t)]))]);return""+(0,A.bufferToHex)((0,H.keccak256)(W.from(f)))},r.calculateCreate2Address=function(e,r,a){var t,n=D(a),f=V()(W).call(W,[(0,A.toBuffer)(this.getCreate2PrefixByte()),(0,A.toBuffer)(n),(0,A.toBuffer)(e),(0,A.toBuffer)(r)]);return"0x"+S()(t=(0,A.bufferToHex)((0,H.keccak256)(f))).call(t,26)},r.calculateGasFreeContractAddress=function(e,r,a,t){if(!this.checkIsValidAddress(e))throw Error("Invalid userAddress: "+e);var n=this.calculateSalt(e),f=this.calculateBytecodeHash(e,a,t);return this.calculateCreate2Address(n,f,r)},r.getGasFreeLedgerRawHash=function(e){var r=e.message,a=this.getGasFreeTypedDataDomain(),t="0x"+G.TypedDataUtils.hashStruct("EIP712Domain",a,{EIP712Domain:J}).toString("hex"),n="0x"+G.TypedDataUtils.hashStruct("PermitTransfer",r,{PermitTransfer:Z}).toString("hex");return{domainSeparatorHex:t,hashStructMessageHex:n,permitTransferMessageHash:(0,A.bufferToHex)((0,H.keccak256)(V()(W).call(W,[(0,A.toBuffer)("0x1901"),(0,A.toBuffer)(t),(0,A.toBuffer)(n)])))}},r.getGasFreeTypedDataDomain=function(){return{name:"GasFreeController",version:"V1.0.0",chainId:Number(this.chainInfo.chainId),verifyingContract:D(this.chainInfo.gasFreeController)}},e}();const R=require("signature-transaction");var X=a.n(R);function Y(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,r,a="function"==typeof i()?i():{},t=a.iterator||"@@iterator",n=a.toStringTag||"@@toStringTag";function f(a,t,n,f){var i=t&&t.prototype instanceof d?t:d,b=c()(i.prototype);return $(b,"_invoke",function(a,t,n){var f,i,d,c=0,b=n||[],u=!1,l={p:0,n:0,v:e,a:h,f:s()(h).call(h,e,4),d:function(r,a){return f=r,i=0,d=e,l.n=a,o}};function h(a,t){for(i=a,d=t,r=0;!u&&c&&!n&&r<b.length;r++){var n,f=b[r],s=l.p,h=f[2];a>3?(n=h===t)&&(d=f[(i=f[4])?5:(i=3,3)],f[4]=f[5]=e):f[0]<=s&&((n=a<2&&s<f[1])?(i=0,l.v=t,l.n=f[1]):s<h&&(n=a<3||f[0]>t||t>h)&&(f[4]=a,f[5]=t,l.n=h,i=0))}if(n||a>1)return o;throw u=!0,t}return function(n,b,s){if(c>1)throw TypeError("Generator is already running");for(u&&1===b&&h(b,s),i=b,d=s;(r=i<2?e:d)||!u;){f||(i?i<3?(i>1&&(l.n=-1),h(i,d)):l.n=d:l.v=d);try{if(c=2,f){if(i||(n="next"),r=f[n]){if(!(r=r.call(f,d)))throw TypeError("iterator result is not an object");if(!r.done)return r;d=r.value,i<2&&(i=0)}else 1===i&&(r=f.return)&&r.call(f),i<2&&(d=TypeError("The iterator does not provide a '"+n+"' method"),i=1);f=e}else if((r=(u=l.n<0)?d:a.call(t,l))!==o)break}catch(r){f=e,i=1,d=r}finally{c=1}}return{value:r,done:u}}}(a,n,f),!0),b}var o={};function d(){}function b(){}function u(){}r=l();var h=[][t]?r(r([][t]())):($(r={},t,function(){return this}),r),m=u.prototype=d.prototype=c()(h);function p(e){return v()?v()(e,u):(e.__proto__=u,$(e,n,"GeneratorFunction")),e.prototype=c()(m),e}return b.prototype=u,$(m,"constructor",u),$(u,"constructor",b),b.displayName="GeneratorFunction",$(u,n,"GeneratorFunction"),$(m),$(m,n,"Generator"),$(m,t,function(){return this}),$(m,"toString",function(){return"[object Generator]"}),(Y=function(){return{w:f,m:p}})()}function $(e,r,a,t){var n=f();try{n({},"",{})}catch(e){n=0}$=function(e,r,a,t){function f(r,a){$(e,r,function(e){return this._invoke(r,a,e)})}r?n?n(e,r,{value:a,enumerable:!t,configurable:!t,writable:!t}):e[r]=a:(f("next",0),f("throw",1),f("return",2))},$(e,r,a,t)}var K=function(e){function r(r){return e.call(this,r)||this}T()(r,e);var a=r.prototype;return a.checkIsValidAddress=function(e){return!!e&&(k().isAddress(e)||(0,A.isValidChecksumAddress)(e))},a.generateGasFreeAddress=function(e){if(!k().isAddress(e))throw Error("Invalid user address: "+e);var r=this.calculateSalt(e),a=this.calculateBytecodeHash(e,this.chainInfo.beacon,this.chainInfo.creationCode);return _(this.calculateCreate2Address(r,a,this.chainInfo.gasFreeController))},a.signatureTransaction=function(){var e=I()(Y().m(function e(r,a){var t;return Y().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,X()(r,a);case 1:return t=e.v,e.a(2,t)}},e)}));return function(r,a){return e.apply(this,arguments)}}(),a.getCreate2PrefixByte=function(){return"0x41"},a.assembleGasFreeTransactionJson=function(r){var a=e.prototype.assembleStandard712GasFreeTransactionJson.call(this,r),t=a.domain,n=a.types,f=a.message,o=p()({},f,{token:_(f.token),serviceProvider:_(f.serviceProvider),user:_(f.user),receiver:_(f.receiver)});return{domain:p()({},t,{verifyingContract:_(t.verifyingContract)}),types:{PermitTransfer:n.PermitTransfer},message:o}},r}(z);return t})());
|
1
|
+
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("TronLinkExtensionCore",[],r):"object"==typeof exports?exports.TronLinkExtensionCore=r():e.TronLinkExtensionCore=r()}(this,(()=>(()=>{"use strict";var e={158:e=>{e.exports=require("buffer")}},r={};function a(t){var f=r[t];if(void 0!==f)return f.exports;var n=r[t]={exports:{}};return e[t](n,n.exports,a),n.exports}a.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return a.d(r,{a:r}),r},a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};a.r(t),a.d(t,{TronGasFree:()=>Q});const f=require("@babel/runtime-corejs3/helpers/extends");var n=a.n(f);const d=require("@babel/runtime-corejs3/helpers/asyncToGenerator");var b=a.n(d);const i=require("@babel/runtime-corejs3/helpers/inheritsLoose");var s=a.n(i);const o=require("@babel/runtime-corejs3/regenerator");var c=a.n(o);const u=require("tronweb");var l=a.n(u);const h=require("@ethereumjs/util"),v=require("@babel/runtime-corejs3/core-js/number/is-integer");var m=a.n(v);const I=require("@babel/runtime-corejs3/core-js/instance/starts-with");var p=a.n(I);const y=require("@babel/runtime-corejs3/core-js/instance/slice");var g=a.n(y);const x=require("@babel/runtime-corejs3/core-js/instance/pad-start");var T=a.n(x);const k=require("@babel/runtime-corejs3/core-js/instance/concat");var A=a.n(k);const C=require("eth-sig-util"),E=require("ethereum-cryptography/keccak"),F=require("ethereumjs-abi");var w,N=a.n(F);function S(e){var r;return(0,h.toChecksumAddress)("0x"+g()(r=l().address.toHex(e)).call(r,2))}function j(e){return l().address.fromHex(e)}function P(e){return null!=e}var V=function(e){return e[e.MAINNET=Number("0x2b6653dc")]="MAINNET",e[e.SHASTA=Number("0x94a9059e")]="SHASTA",e[e.NILE=Number("0xcd8690dc")]="NILE",e}({}),q=((w={})[V.MAINNET]={chainId:V.MAINNET,gasFreeController:"TFFAMQLZybALaLb4uxHA9RBE7pxhUAjF3U",beacon:"TSP9UW6FQhT76XD2jWA6ipGMx3yGbjDffP",creationCode:"0x60a06040908082526103e5803803809161001982856101d6565b833981019082818303126101d2576100308161020d565b91602091828101519060018060401b0382116101d2570181601f820112156101d25780519061005e8261022a565b9261006b875194856101d6565b8284528483830101116101d25783905f5b8381106101be5750505f9183010152823b1561017a5780516100b3575b50506080525161013c90816102a982396080518160180152f35b8351635c60da1b60e01b81529082826004816001600160a01b0388165afa918215610170575f9261012d575b50905f80838561011c9695519101845af4903d15610124573d6101018161022a565b9061010e885192836101d6565b81525f81943d92013e610245565b505f80610099565b60609250610245565b90918382813d8311610169575b61014481836101d6565b810103126101665750905f8061015d61011c959461020d565b939450506100df565b80fd5b503d61013a565b85513d5f823e3d90fd5b835162461bcd60e51b815260048101839052601b60248201527f626561636f6e2073686f756c64206265206120636f6e747261637400000000006044820152606490fd5b81810183015185820184015285920161007c565b5f80fd5b601f909101601f19168101906001600160401b038211908210176101f957604052565b634e487b7160e01b5f52604160045260245ffd5b516001600160a81b03811681036101d2576001600160a01b031690565b6001600160401b0381116101f957601f01601f191660200190565b9061026c575080511561025a57805190602001fd5b604051630a12f52160e11b8152600490fd5b8151158061029f575b61027d575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b1561027556fe60806040819052635c60da1b60e01b81526020816004817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa9081156100ae575f91610056575b506100e8565b6020903d82116100a6575b601f8201601f1916810167ffffffffffffffff8111828210176100925761008c9350604052016100b9565b5f610050565b634e487b7160e01b84526041600452602484fd5b3d9150610061565b6040513d5f823e3d90fd5b602090607f1901126100e4576080516001600160a81b03811681036100e4576001600160a01b031690565b5f80fd5b5f808092368280378136915af43d82803e15610102573d90f35b3d90fdfea26474726f6e58221220309a2919b7a1b203f1a7a1c544a7d671bb94b0adf8a39e4c9b6eeb6d03939ffe64736f6c63430008140033"},w[V.SHASTA]={chainId:V.SHASTA,gasFreeController:"TQghdCeVDA6CnuNVTUhfaAyPfTetqZWNpm",beacon:"TQ1jvA3nLDMDNbJoMPLzTPoqAg8NvZ5CCW",creationCode:"0x60a06040908082526104b8803803809161001982856102a9565b833981019082818303126102a557610030816102e0565b91602091828101519060018060401b0382116102a5570181601f820112156102a55780519061005e826102fd565b9261006b875194856102a9565b8284528483830101116102a55783905f5b8381106102915750505f9183010152823b15610271577fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080546001600160a01b0319166001600160a01b038581169182179092558551635c60da1b60e01b8082529193928582600481885afa918215610267575f92610230575b50813b156102175750508551837f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e5f80a28251156101f857508390600487518095819382525afa9182156101ee575f926101ab575b50905f8083856101889695519101845af4903d156101a2573d61016d816102fd565b9061017a885192836102a9565b81525f81943d92013e610318565b505b6080525161013c908161037c82396080518160180152f35b60609250610318565b90918382813d83116101e7575b6101c281836102a9565b810103126101e45750905f806101db61018895946102e0565b9394505061014b565b80fd5b503d6101b8565b85513d5f823e3d90fd5b935050505034610208575061018a565b63b398979f60e01b8152600490fd5b8751634c9c8ce360e01b81529116600482015260249150fd5b90918682813d8311610260575b61024781836102a9565b810103126101e45750610259906102e0565b905f6100f6565b503d61023d565b88513d5f823e3d90fd5b8351631933b43b60e21b81526001600160a01b0384166004820152602490fd5b81810183015185820184015285920161007c565b5f80fd5b601f909101601f19168101906001600160401b038211908210176102cc57604052565b634e487b7160e01b5f52604160045260245ffd5b516001600160a81b03811681036102a5576001600160a01b031690565b6001600160401b0381116102cc57601f01601f191660200190565b9061033f575080511561032d57805190602001fd5b604051630a12f52160e11b8152600490fd5b81511580610372575b610350575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b1561034856fe60806040819052635c60da1b60e01b81526020816004817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa9081156100ae575f91610056575b506100e8565b6020903d82116100a6575b601f8201601f1916810167ffffffffffffffff8111828210176100925761008c9350604052016100b9565b5f610050565b634e487b7160e01b84526041600452602484fd5b3d9150610061565b6040513d5f823e3d90fd5b602090607f1901126100e4576080516001600160a81b03811681036100e4576001600160a01b031690565b5f80fd5b5f808092368280378136915af43d82803e15610102573d90f35b3d90fdfea26474726f6e58221220b3a0a0f4043f8fe355d62319dafed2ba5d611d7bb6dfe21d6d935af1510ce27964736f6c63430008140033"},w[V.NILE]={chainId:V.NILE,gasFreeController:"THQGuFzL87ZqhxkgqYEryRAd7gqFqL5rdc",beacon:"TLtCGmaxH3PbuaF6kbybwteZcHptEdgQGC",creationCode:"0x60a06040908082526103e5803803809161001982856101d6565b833981019082818303126101d2576100308161020d565b91602091828101519060018060401b0382116101d2570181601f820112156101d25780519061005e8261022a565b9261006b875194856101d6565b8284528483830101116101d25783905f5b8381106101be5750505f9183010152823b1561017a5780516100b3575b50506080525161013c90816102a982396080518160180152f35b8351635c60da1b60e01b81529082826004816001600160a01b0388165afa918215610170575f9261012d575b50905f80838561011c9695519101845af4903d15610124573d6101018161022a565b9061010e885192836101d6565b81525f81943d92013e610245565b505f80610099565b60609250610245565b90918382813d8311610169575b61014481836101d6565b810103126101665750905f8061015d61011c959461020d565b939450506100df565b80fd5b503d61013a565b85513d5f823e3d90fd5b835162461bcd60e51b815260048101839052601b60248201527f626561636f6e2073686f756c64206265206120636f6e747261637400000000006044820152606490fd5b81810183015185820184015285920161007c565b5f80fd5b601f909101601f19168101906001600160401b038211908210176101f957604052565b634e487b7160e01b5f52604160045260245ffd5b516001600160a81b03811681036101d2576001600160a01b031690565b6001600160401b0381116101f957601f01601f191660200190565b9061026c575080511561025a57805190602001fd5b604051630a12f52160e11b8152600490fd5b8151158061029f575b61027d575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b1561027556fe60806040819052635c60da1b60e01b81526020816004817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa9081156100ae575f91610056575b506100e8565b6020903d82116100a6575b601f8201601f1916810167ffffffffffffffff8111828210176100925761008c9350604052016100b9565b5f610050565b634e487b7160e01b84526041600452602484fd5b3d9150610061565b6040513d5f823e3d90fd5b602090607f1901126100e4576080516001600160a81b03811681036100e4576001600160a01b031690565b5f80fd5b5f808092368280378136915af43d82803e15610102573d90f35b3d90fdfea26474726f6e5822122019fba3a984dfef08920adc4d0e531dbd369df1dec237bfb02ce668f5d8e2704064736f6c63430008140033"},w),H=[{name:"token",type:"address"},{name:"serviceProvider",type:"address"},{name:"user",type:"address"},{name:"receiver",type:"address"},{name:"value",type:"uint256"},{name:"maxFee",type:"uint256"},{name:"deadline",type:"uint256"},{name:"version",type:"uint256"},{name:"nonce",type:"uint256"}],M=[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],B=a(158).Buffer,G=function(){function e(e){this.chainInfo=void 0;var r=e.chainId,a=e.chainInfo;if(P(r)&&P(a)||!P(r)&&!P(a))throw Error("Invalid arguments provided. This function requires exactly one argument: either chainId or chainInfo, but not both.");if(P(r)){if(!this.checkIsValidChainId(r))throw Error("Invalid chainId: "+r);var t=q[r];if(!t)throw Error("Invalid chainId: "+r);this.chainInfo=t}else{var f=a,n=f.chainId,d=f.gasFreeController,b=f.beacon,i=f.creationCode;if(!this.checkIsValidChainId(n))throw Error("Invalid chainId: "+n);if(!this.checkIsValidAddress(d))throw Error("Invalid gasFreeController: "+d);if(!this.checkIsValidAddress(b))throw Error("Invalid beacon: "+b);if(!this.checkIsValidCreationCode(i))throw Error("Invalid creationCode: "+i);this.chainInfo={chainId:n,gasFreeController:d,beacon:b,creationCode:i}}}var r=e.prototype;return r.checkIsValidChainId=function(e){var r=Number(e);return!(!m()(r)||r<=0)&&!(r>Number("0xffffffff"))},r.checkIsValidCreationCode=function(e){try{return!!e&&(e=p()(e).call(e,"0x")?g()(e).call(e,2):e,!!/^[0-9a-fA-F]*$/.test(e)&&e.length%2==0)}catch(e){return!1}},r.assembleStandard712GasFreeTransactionJson=function(e){var r=e.token,a=e.serviceProvider,t=e.user,f=e.receiver,n=e.value,d=e.maxFee,b=e.deadline,i=e.version,s=e.nonce;if(!this.checkIsValidAddress(r))throw Error("Invalid token: "+r);if(!this.checkIsValidAddress(a))throw Error("Invalid serviceProvider: "+a);if(!this.checkIsValidAddress(t))throw Error("Invalid user: "+t);if(!this.checkIsValidAddress(f))throw Error("Invalid receiver: "+f);if("string"!=typeof n)throw Error("'value' must be a string of numbers: "+n);if("string"!=typeof d)throw Error("'maxFee' must be a string of numbers: "+d);if(!this.checkIsValidMessageNumber(n))throw Error("Invalid value: "+n);if(!this.checkIsValidMessageNumber(d))throw Error("Invalid maxFee: "+d);if(!this.checkIsValidMessageNumber(b))throw Error("Invalid deadline: "+b);if(!this.checkIsValidMessageNumber(i))throw Error("Invalid version: "+i);if(!this.checkIsValidMessageNumber(s))throw Error("Invalid nonce: "+s);var o=this.getGasFreeTypedDataDomain();return{types:{PermitTransfer:H,EIP712Domain:M},domain:o,message:{token:S(r),serviceProvider:S(a),user:S(t),receiver:S(f),value:n,maxFee:d,deadline:b,version:i,nonce:s},primaryType:"PermitTransfer"}},r.checkIsValidMessageNumber=function(e){if("string"!=typeof e&&"number"!=typeof e)return!1;try{if(BigInt(e)<0n)return!1}catch(e){return!1}return!0},r.calculateSalt=function(e){var r;if(!this.checkIsValidAddress(e))throw Error("Invalid address: "+e);var a=S(e);return"0x"+T()(r=g()(a).call(a,2)).call(r,64,"0")},r.addFunctionSelectorToAddress=function(e){var r;if(!p()(e).call(e,"0x")||66!==e.length)throw new Error("Invalid address format");return g()(r=(0,h.bufferToHex)((0,E.keccak256)(B.from("initialize(address)")))).call(r,0,10)+g()(e).call(e,2)},r.calculateBytecodeHash=function(e,r,a){if(!this.checkIsValidAddress(e))throw Error("Invalid address: "+e);var t=this.addFunctionSelectorToAddress(this.calculateSalt(e)),f=S(r),n=A()(B).call(B,[(0,h.toBuffer)(a),(0,h.toBuffer)(N().rawEncode(["address","bytes"],[f,(0,h.toBuffer)(t)]))]);return""+(0,h.bufferToHex)((0,E.keccak256)(B.from(n)))},r.calculateCreate2Address=function(e,r,a){var t,f=S(a),n=A()(B).call(B,[(0,h.toBuffer)(this.getCreate2PrefixByte()),(0,h.toBuffer)(f),(0,h.toBuffer)(e),(0,h.toBuffer)(r)]);return"0x"+g()(t=(0,h.bufferToHex)((0,E.keccak256)(n))).call(t,26)},r.calculateGasFreeContractAddress=function(e,r,a,t){if(!this.checkIsValidAddress(e))throw Error("Invalid userAddress: "+e);var f=this.calculateSalt(e),n=this.calculateBytecodeHash(e,a,t);return this.calculateCreate2Address(f,n,r)},r.getGasFreeLedgerRawHash=function(e){var r=e.message,a=this.getGasFreeTypedDataDomain(),t="0x"+C.TypedDataUtils.hashStruct("EIP712Domain",a,{EIP712Domain:M}).toString("hex"),f="0x"+C.TypedDataUtils.hashStruct("PermitTransfer",r,{PermitTransfer:H}).toString("hex");return{domainSeparatorHex:t,hashStructMessageHex:f,permitTransferMessageHash:(0,h.bufferToHex)((0,E.keccak256)(A()(B).call(B,[(0,h.toBuffer)("0x1901"),(0,h.toBuffer)(t),(0,h.toBuffer)(f)])))}},r.getGasFreeTypedDataDomain=function(){return{name:"GasFreeController",version:"V1.0.0",chainId:Number(this.chainInfo.chainId),verifyingContract:S(this.chainInfo.gasFreeController)}},e}();const L=require("signature-transaction");var D=a.n(L),Q=function(e){function r(r){return e.call(this,r)||this}s()(r,e);var a=r.prototype;return a.checkIsValidAddress=function(e){return!!e&&(l().isAddress(e)||(0,h.isValidChecksumAddress)(e))},a.generateGasFreeAddress=function(e){if(!l().isAddress(e))throw Error("Invalid user address: "+e);var r=this.calculateSalt(e),a=this.calculateBytecodeHash(e,this.chainInfo.beacon,this.chainInfo.creationCode);return j(this.calculateCreate2Address(r,a,this.chainInfo.gasFreeController))},a.signatureTransaction=function(){var e=b()(c().mark((function e(r,a){var t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,D()(r,a);case 2:return t=e.sent,e.abrupt("return",t);case 4:case"end":return e.stop()}}),e)})));return function(r,a){return e.apply(this,arguments)}}(),a.getCreate2PrefixByte=function(){return"0x41"},a.assembleGasFreeTransactionJson=function(r){var a=e.prototype.assembleStandard712GasFreeTransactionJson.call(this,r),t=a.domain,f=a.types,d=a.message,b=n()({},d,{token:j(d.token),serviceProvider:j(d.serviceProvider),user:j(d.user),receiver:j(d.receiver)});return{domain:n()({},t,{verifyingContract:j(t.verifyingContract)}),types:{PermitTransfer:f.PermitTransfer},message:b}},r}(G);return t})()));
|
package/package.json
CHANGED
@@ -1,85 +1,85 @@
|
|
1
|
-
{
|
2
|
-
"name": "tronlink-gasfree-sdk-js",
|
3
|
-
"version": "1.
|
4
|
-
"description": "",
|
5
|
-
"author": "",
|
6
|
-
"repository": {
|
7
|
-
"type": "git",
|
8
|
-
"url": "https://github.com/TronLink/tronlink-gasfree-sdk-js.git"
|
9
|
-
},
|
10
|
-
"bugs": {
|
11
|
-
"url": "https://github.com/TronLink/tronlink-gasfree-sdk-js/issues"
|
12
|
-
},
|
13
|
-
"homepage": "https://github.com/TronLink/tronlink-gasfree-sdk-js#readme",
|
14
|
-
"keywords": [
|
15
|
-
"TRON",
|
16
|
-
"gasFree"
|
17
|
-
],
|
18
|
-
"main": "dist/index.js",
|
19
|
-
"engines": {
|
20
|
-
"node": "18.19.0",
|
21
|
-
"pnpm": "7.32.0"
|
22
|
-
},
|
23
|
-
"scripts": {
|
24
|
-
"test": "jest --coverage",
|
25
|
-
"build": "pnpm run clean && cross-env NODE_ENV=production webpack --progress --color && tsc",
|
26
|
-
"build:dev": "pnpm run clean && cross-env NODE_ENV=development webpack --progress --color && tsc",
|
27
|
-
"build:prod": "pnpm run clean && cross-env NODE_ENV=production webpack --progress --color && tsc",
|
28
|
-
"start": "cross-env NODE_ENV=development npx webpack serve",
|
29
|
-
"lint": "eslint './src/**/*.{ts,tsx}'",
|
30
|
-
"clean": "rimraf dist"
|
31
|
-
},
|
32
|
-
"license": "Apache-2.0",
|
33
|
-
"dependencies": {
|
34
|
-
"@babel/runtime-corejs3": "7.21.0",
|
35
|
-
"@ethereumjs/util": "8.0.3",
|
36
|
-
"buffer": "6.0.3",
|
37
|
-
"eth-sig-util": "3.0.1",
|
38
|
-
"ethereum-cryptography": "1.1.2",
|
39
|
-
"ethereumjs-abi": "0.6.8",
|
40
|
-
"signature-transaction": "1.1.2",
|
41
|
-
"tronweb": "5.3.2"
|
42
|
-
},
|
43
|
-
"devDependencies": {
|
44
|
-
"@babel/core": "7.23.7",
|
45
|
-
"@babel/plugin-transform-class-properties": "7.23.3",
|
46
|
-
"@babel/plugin-transform-classes": "7.23.5",
|
47
|
-
"@babel/plugin-transform-optional-chaining": "7.23.4",
|
48
|
-
"@babel/plugin-transform-runtime": "7.23.7",
|
49
|
-
"@babel/plugin-transform-template-literals": "7.18.9",
|
50
|
-
"@babel/preset-env": "7.23.7",
|
51
|
-
"@babel/preset-typescript": "7.23.3",
|
52
|
-
"@types/jest": "29.5.11",
|
53
|
-
"@types/node": "20.10.7",
|
54
|
-
"@typescript-eslint/eslint-plugin": "6.17.0",
|
55
|
-
"@typescript-eslint/parser": "6.17.0",
|
56
|
-
"babel-loader": "8.3.0",
|
57
|
-
"cross-env": "7.0.3",
|
58
|
-
"eslint": "8.56.0",
|
59
|
-
"eslint-config-prettier": "9.1.0",
|
60
|
-
"eslint-plugin-prettier": "5.1.2",
|
61
|
-
"ethers": "5.7.2",
|
62
|
-
"jest": "29.7.0",
|
63
|
-
"prettier": "3.1.1",
|
64
|
-
"rimraf": "5.0.5",
|
65
|
-
"terser-webpack-plugin": "5.3.10",
|
66
|
-
"ts-jest": "29.1.1",
|
67
|
-
"ts-node": "10.9.2",
|
68
|
-
"typescript": "4.9.5",
|
69
|
-
"webpack": "5.94.0",
|
70
|
-
"webpack-cli": "4.10.0",
|
71
|
-
"webpack-node-externals": "3.0.0"
|
72
|
-
},
|
73
|
-
"pnpm": {
|
74
|
-
"overrides": {
|
75
|
-
"@ethersproject/providers@5.7.2>ws": "7.5.10",
|
76
|
-
"elliptic": "6.6.1",
|
77
|
-
"secp256k1": "4.0.4",
|
78
|
-
"cross-spawn": "7.0.5",
|
79
|
-
"pbkdf2": "3.1.3",
|
80
|
-
"axios": "1.10.0",
|
81
|
-
"base-x": "3.0.11",
|
82
|
-
"form-data": "4.0.4"
|
83
|
-
}
|
84
|
-
}
|
85
|
-
}
|
1
|
+
{
|
2
|
+
"name": "tronlink-gasfree-sdk-js",
|
3
|
+
"version": "1.1.0",
|
4
|
+
"description": "",
|
5
|
+
"author": "",
|
6
|
+
"repository": {
|
7
|
+
"type": "git",
|
8
|
+
"url": "https://github.com/TronLink/tronlink-gasfree-sdk-js.git"
|
9
|
+
},
|
10
|
+
"bugs": {
|
11
|
+
"url": "https://github.com/TronLink/tronlink-gasfree-sdk-js/issues"
|
12
|
+
},
|
13
|
+
"homepage": "https://github.com/TronLink/tronlink-gasfree-sdk-js#readme",
|
14
|
+
"keywords": [
|
15
|
+
"TRON",
|
16
|
+
"gasFree"
|
17
|
+
],
|
18
|
+
"main": "dist/index.js",
|
19
|
+
"engines": {
|
20
|
+
"node": "18.19.0",
|
21
|
+
"pnpm": "7.32.0"
|
22
|
+
},
|
23
|
+
"scripts": {
|
24
|
+
"test": "jest --coverage",
|
25
|
+
"build": "pnpm run clean && cross-env NODE_ENV=production webpack --progress --color && tsc",
|
26
|
+
"build:dev": "pnpm run clean && cross-env NODE_ENV=development webpack --progress --color && tsc",
|
27
|
+
"build:prod": "pnpm run clean && cross-env NODE_ENV=production webpack --progress --color && tsc",
|
28
|
+
"start": "cross-env NODE_ENV=development npx webpack serve",
|
29
|
+
"lint": "eslint './src/**/*.{ts,tsx}'",
|
30
|
+
"clean": "rimraf dist"
|
31
|
+
},
|
32
|
+
"license": "Apache-2.0",
|
33
|
+
"dependencies": {
|
34
|
+
"@babel/runtime-corejs3": "7.21.0",
|
35
|
+
"@ethereumjs/util": "8.0.3",
|
36
|
+
"buffer": "6.0.3",
|
37
|
+
"eth-sig-util": "3.0.1",
|
38
|
+
"ethereum-cryptography": "1.1.2",
|
39
|
+
"ethereumjs-abi": "0.6.8",
|
40
|
+
"signature-transaction": "^1.1.2",
|
41
|
+
"tronweb": "5.3.2"
|
42
|
+
},
|
43
|
+
"devDependencies": {
|
44
|
+
"@babel/core": "7.23.7",
|
45
|
+
"@babel/plugin-transform-class-properties": "7.23.3",
|
46
|
+
"@babel/plugin-transform-classes": "7.23.5",
|
47
|
+
"@babel/plugin-transform-optional-chaining": "7.23.4",
|
48
|
+
"@babel/plugin-transform-runtime": "7.23.7",
|
49
|
+
"@babel/plugin-transform-template-literals": "7.18.9",
|
50
|
+
"@babel/preset-env": "7.23.7",
|
51
|
+
"@babel/preset-typescript": "7.23.3",
|
52
|
+
"@types/jest": "29.5.11",
|
53
|
+
"@types/node": "20.10.7",
|
54
|
+
"@typescript-eslint/eslint-plugin": "6.17.0",
|
55
|
+
"@typescript-eslint/parser": "6.17.0",
|
56
|
+
"babel-loader": "8.3.0",
|
57
|
+
"cross-env": "7.0.3",
|
58
|
+
"eslint": "8.56.0",
|
59
|
+
"eslint-config-prettier": "9.1.0",
|
60
|
+
"eslint-plugin-prettier": "5.1.2",
|
61
|
+
"ethers": "5.7.2",
|
62
|
+
"jest": "29.7.0",
|
63
|
+
"prettier": "3.1.1",
|
64
|
+
"rimraf": "5.0.5",
|
65
|
+
"terser-webpack-plugin": "5.3.10",
|
66
|
+
"ts-jest": "29.1.1",
|
67
|
+
"ts-node": "10.9.2",
|
68
|
+
"typescript": "4.9.5",
|
69
|
+
"webpack": "5.94.0",
|
70
|
+
"webpack-cli": "4.10.0",
|
71
|
+
"webpack-node-externals": "3.0.0"
|
72
|
+
},
|
73
|
+
"pnpm": {
|
74
|
+
"overrides": {
|
75
|
+
"@ethersproject/providers@5.7.2>ws": "7.5.10",
|
76
|
+
"elliptic": "6.6.1",
|
77
|
+
"secp256k1": "4.0.4",
|
78
|
+
"cross-spawn": "7.0.5",
|
79
|
+
"pbkdf2": "3.1.3",
|
80
|
+
"axios": "1.10.0",
|
81
|
+
"base-x": "3.0.11",
|
82
|
+
"form-data": "4.0.4"
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
package/LICENSE
DELETED
@@ -1,191 +0,0 @@
|
|
1
|
-
|
2
|
-
Apache License
|
3
|
-
Version 2.0, January 2004
|
4
|
-
http://www.apache.org/licenses/
|
5
|
-
|
6
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
7
|
-
|
8
|
-
1. Definitions.
|
9
|
-
|
10
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
11
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
12
|
-
|
13
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
14
|
-
the copyright owner that is granting the License.
|
15
|
-
|
16
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
17
|
-
other entities that control, are controlled by, or are under common
|
18
|
-
control with that entity. For the purposes of this definition,
|
19
|
-
"control" means (i) the power, direct or indirect, to cause the
|
20
|
-
direction or management of such entity, whether by contract or
|
21
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
22
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
23
|
-
|
24
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
25
|
-
exercising permissions granted by this License.
|
26
|
-
|
27
|
-
"Source" form shall mean the preferred form for making modifications,
|
28
|
-
including but not limited to software source code, documentation
|
29
|
-
source, and configuration files.
|
30
|
-
|
31
|
-
"Object" form shall mean any form resulting from mechanical
|
32
|
-
transformation or translation of a Source form, including but
|
33
|
-
not limited to compiled object code, generated documentation,
|
34
|
-
and conversions to other media types.
|
35
|
-
|
36
|
-
"Work" shall mean the work of authorship, whether in Source or
|
37
|
-
Object form, made available under the License, as indicated by a
|
38
|
-
copyright notice that is included in or attached to the work
|
39
|
-
(an example is provided in the Appendix below).
|
40
|
-
|
41
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
42
|
-
form, that is based on (or derived from) the Work and for which the
|
43
|
-
editorial revisions, annotations, elaborations, or other modifications
|
44
|
-
represent, as a whole, an original work of authorship. For the purposes
|
45
|
-
of this License, Derivative Works shall not include works that remain
|
46
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
47
|
-
the Work and Derivative Works thereof.
|
48
|
-
|
49
|
-
"Contribution" shall mean any work of authorship, including
|
50
|
-
the original version of the Work and any modifications or additions
|
51
|
-
to that Work or Derivative Works thereof, that is intentionally
|
52
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
53
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
54
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
55
|
-
means any form of electronic, verbal, or written communication sent
|
56
|
-
to the Licensor or its representatives, including but not limited to
|
57
|
-
communication on electronic mailing lists, source code control systems,
|
58
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
59
|
-
Licensor for the purpose of discussing and improving the Work, but
|
60
|
-
excluding communication that is conspicuously marked or otherwise
|
61
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
62
|
-
|
63
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
64
|
-
on behalf of whom a Contribution has been received by Licensor and
|
65
|
-
subsequently incorporated within the Work.
|
66
|
-
|
67
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
68
|
-
this License, each Contributor hereby grants to You a perpetual,
|
69
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
70
|
-
copyright license to reproduce, prepare Derivative Works of,
|
71
|
-
publicly display, publicly perform, sublicense, and distribute the
|
72
|
-
Work and such Derivative Works in Source or Object form.
|
73
|
-
|
74
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
75
|
-
this License, each Contributor hereby grants to You a perpetual,
|
76
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
77
|
-
(except as stated in this section) patent license to make, have made,
|
78
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
79
|
-
where such license applies only to those patent claims licensable
|
80
|
-
by such Contributor that are necessarily infringed by their
|
81
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
82
|
-
with the Work to which such Contribution(s) was submitted. If You
|
83
|
-
institute patent litigation against any entity (including a
|
84
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
85
|
-
or a Contribution incorporated within the Work constitutes direct
|
86
|
-
or contributory patent infringement, then any patent licenses
|
87
|
-
granted to You under this License for that Work shall terminate
|
88
|
-
as of the date such litigation is filed.
|
89
|
-
|
90
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
91
|
-
Work or Derivative Works thereof in any medium, with or without
|
92
|
-
modifications, and in Source or Object form, provided that You
|
93
|
-
meet the following conditions:
|
94
|
-
|
95
|
-
(a) You must give any other recipients of the Work or
|
96
|
-
Derivative Works a copy of this License; and
|
97
|
-
|
98
|
-
(b) You must cause any modified files to carry prominent notices
|
99
|
-
stating that You changed the files; and
|
100
|
-
|
101
|
-
(c) You must retain, in the Source form of any Derivative Works
|
102
|
-
that You distribute, all copyright, patent, trademark, and
|
103
|
-
attribution notices from the Source form of the Work,
|
104
|
-
excluding those notices that do not pertain to any part of
|
105
|
-
the Derivative Works; and
|
106
|
-
|
107
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
108
|
-
distribution, then any Derivative Works that You distribute must
|
109
|
-
include a readable copy of the attribution notices contained
|
110
|
-
within such NOTICE file, excluding those notices that do not
|
111
|
-
pertain to any part of the Derivative Works, in at least one
|
112
|
-
of the following places: within a NOTICE text file distributed
|
113
|
-
as part of the Derivative Works; within the Source form or
|
114
|
-
documentation, if provided along with the Derivative Works; or,
|
115
|
-
within a display generated by the Derivative Works, if and
|
116
|
-
wherever such third-party notices normally appear. The contents
|
117
|
-
of the NOTICE file are for informational purposes only and
|
118
|
-
do not modify the License. You may add Your own attribution
|
119
|
-
notices within Derivative Works that You distribute, alongside
|
120
|
-
or as an addendum to the NOTICE text from the Work, provided
|
121
|
-
that such additional attribution notices cannot be construed
|
122
|
-
as modifying the License.
|
123
|
-
|
124
|
-
You may add Your own copyright statement to Your modifications and
|
125
|
-
may provide additional or different license terms and conditions
|
126
|
-
for use, reproduction, or distribution of Your modifications, or
|
127
|
-
for any such Derivative Works as a whole, provided Your use,
|
128
|
-
reproduction, and distribution of the Work otherwise complies with
|
129
|
-
the conditions stated in this License.
|
130
|
-
|
131
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
132
|
-
any Contribution intentionally submitted for inclusion in the Work
|
133
|
-
by You to the Licensor shall be under the terms and conditions of
|
134
|
-
this License, without any additional terms or conditions.
|
135
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
136
|
-
the terms of any separate license agreement you may have executed
|
137
|
-
with Licensor regarding such Contributions.
|
138
|
-
|
139
|
-
6. Trademarks. This License does not grant permission to use the trade
|
140
|
-
names, trademarks, service marks, or product names of the Licensor,
|
141
|
-
except as required for reasonable and customary use in describing the
|
142
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
143
|
-
|
144
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
145
|
-
agreed to in writing, Licensor provides the Work (and each
|
146
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
147
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
148
|
-
implied, including, without limitation, any warranties or conditions
|
149
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
150
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
151
|
-
appropriateness of using or redistributing the Work and assume any
|
152
|
-
risks associated with Your exercise of permissions under this License.
|
153
|
-
|
154
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
155
|
-
whether in tort (including negligence), contract, or otherwise,
|
156
|
-
unless required by applicable law (such as deliberate and grossly
|
157
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
158
|
-
liable to You for damages, including any direct, indirect, special,
|
159
|
-
incidental, or consequential damages of any character arising as a
|
160
|
-
result of this License or out of the use or inability to use the
|
161
|
-
Work (including but not limited to damages for loss of goodwill,
|
162
|
-
work stoppage, computer failure or malfunction, or any and all
|
163
|
-
other commercial damages or losses), even if such Contributor
|
164
|
-
has been advised of the possibility of such damages.
|
165
|
-
|
166
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
167
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
168
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
169
|
-
or other liability obligations and/or rights consistent with this
|
170
|
-
License. However, in accepting such obligations, You may act only
|
171
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
172
|
-
of any other Contributor, and only if You agree to indemnify,
|
173
|
-
defend, and hold each Contributor harmless for any liability
|
174
|
-
incurred by, or claims asserted against, such Contributor by reason
|
175
|
-
of your accepting any such warranty or additional liability.
|
176
|
-
|
177
|
-
END OF TERMS AND CONDITIONS
|
178
|
-
|
179
|
-
Copyright 2025 Helix Tech Company Limited
|
180
|
-
|
181
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
182
|
-
you may not use this file except in compliance with the License.
|
183
|
-
You may obtain a copy of the License at
|
184
|
-
|
185
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
186
|
-
|
187
|
-
Unless required by applicable law or agreed to in writing, software
|
188
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
189
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
190
|
-
See the License for the specific language governing permissions and
|
191
|
-
limitations under the License.
|
package/README.md
DELETED
@@ -1,273 +0,0 @@
|
|
1
|
-
# tronlink-gasfree-sdk-js
|
2
|
-
tronlink-gasfree-sdk-js is a toolkit developed by TronLink based on the GasFree API specification. It facilitates the integration of the non-gas TRC20 token transfer service for the web & browser extension platform.
|
3
|
-
|
4
|
-
This SDK is provided by TronLink, while the definition & maintenance of the APIs are managed by the official GasFree project. For more information, visit [https://gasfree.io](https://gasfree.io).
|
5
|
-
|
6
|
-
Key Features:
|
7
|
-
- Generate GasFree Addresses from User Addresses
|
8
|
-
- Generate GasFree Transfer Message Hash
|
9
|
-
|
10
|
-
|
11
|
-
## Demo
|
12
|
-
- [tronGenerateGasFreeAddress](demo/tronGenerateGasFreeAddress.ts)
|
13
|
-
- [tronGetGasFreeTransactionJson](demo/tronGetGasFreeTransactionJson.ts)
|
14
|
-
- [tronGetGasFreeLedgerRawHash](demo/tronGetGasFreeLedgerRawHash.ts)
|
15
|
-
|
16
|
-
|
17
|
-
## Usage
|
18
|
-
|
19
|
-
#### quick start
|
20
|
-
initialization:
|
21
|
-
```javascript
|
22
|
-
const tronGasFree = new TronGasFree({
|
23
|
-
chainId: Number('0x2b6653dc'), // use mainnet default config
|
24
|
-
});
|
25
|
-
```
|
26
|
-
|
27
|
-
generate gas free address:
|
28
|
-
```javascript
|
29
|
-
import { TronGasFree } from '@tronlink/gasfree-sdk-js'
|
30
|
-
|
31
|
-
try {
|
32
|
-
const userAddress = 'your tron wallet address'
|
33
|
-
const tronGasFree = new TronGasFree({
|
34
|
-
chainId: Number('0x2b6653dc'), // use mainnet default config
|
35
|
-
});
|
36
|
-
const tronGasFreeAddress = tronGasFree.generateGasFreeAddress(userAddress);
|
37
|
-
} catch (error) {
|
38
|
-
console.log(error);
|
39
|
-
}
|
40
|
-
```
|
41
|
-
|
42
|
-
get standard TIP712 gas free transaction json object:
|
43
|
-
```typescript
|
44
|
-
|
45
|
-
try {
|
46
|
-
const tronGasFree = new TronGasFree({
|
47
|
-
chainId: Number('0x2b6653dc'), // use mainnet default config
|
48
|
-
});
|
49
|
-
const transactionJson = tronGasFree.assembleGasFreeTransactionJson({
|
50
|
-
token: 'transaction token contract address',
|
51
|
-
serviceProvider: 'gas free transaction service provider',
|
52
|
-
user: 'your tron wallet address, NOT your gas free address',
|
53
|
-
receiver: 'tron receiver address, it can be a wallet address or a gasfree contract address',
|
54
|
-
value: 'transfer value, decimal string number',
|
55
|
-
maxFee: 'max transfer gas fee, decimal string number',
|
56
|
-
deadline: 'timestamp, transaction deadline',
|
57
|
-
version: "version of the signature algorithm used by gasfree offline transaction, the current version is 1",
|
58
|
-
nonce: 'gas free transaction nonce, decimal string number',
|
59
|
-
});
|
60
|
-
} catch (error) {
|
61
|
-
}
|
62
|
-
```
|
63
|
-
|
64
|
-
#### initialization
|
65
|
-
use Tron mainnet default config:
|
66
|
-
```typescript
|
67
|
-
const tronGasFree = new TronGasFree({
|
68
|
-
chainId: Number('0x2b6653dc'),
|
69
|
-
});
|
70
|
-
```
|
71
|
-
|
72
|
-
if you want to use testnet config:
|
73
|
-
```typescript
|
74
|
-
const tronGasFree = new TronGasFree({
|
75
|
-
chainId: Number('0xcd8690dc'), // nile
|
76
|
-
});
|
77
|
-
```
|
78
|
-
or
|
79
|
-
```typescript
|
80
|
-
const tronGasFree = new TronGasFree({
|
81
|
-
chainId: Number('0x94a9059e'), // shasta
|
82
|
-
});
|
83
|
-
```
|
84
|
-
|
85
|
-
If you have your own GasFreeController contract, or your own chain:
|
86
|
-
```typescript
|
87
|
-
const tronGasFree = new TronGasFree({
|
88
|
-
chainId: 0, // your chainId, number
|
89
|
-
gasFreeController: 'your gas free controller address contract, should deployed on the chain in advance',
|
90
|
-
beacon: 'your beacon',
|
91
|
-
creationCode: 'your GasFreeController creation code',
|
92
|
-
});
|
93
|
-
```
|
94
|
-
#### generate GasFree address
|
95
|
-
```javascript
|
96
|
-
import { TronGasFree } from '@tronlink/gasfree-sdk-js'
|
97
|
-
|
98
|
-
try {
|
99
|
-
const userAddress = 'your tron wallet address'
|
100
|
-
const tronGasFree = new TronGasFree({
|
101
|
-
chainId: Number('0x2b6653dc'), // use mainnet default config
|
102
|
-
});
|
103
|
-
const tronGasFreeAddress = tronGasFree.generateGasFreeAddress(userAddress);
|
104
|
-
} catch (error) {
|
105
|
-
console.log(error);
|
106
|
-
}
|
107
|
-
```
|
108
|
-
|
109
|
-
different chains and different GasFreeControllers will result in inconsistent GasFree addresses.
|
110
|
-
```javascript
|
111
|
-
const userAddress = 'your tron wallet address'
|
112
|
-
const tronGasFree = new TronGasFree({
|
113
|
-
chainId: Number('0xcd8690dc'), // nile
|
114
|
-
});
|
115
|
-
const tronGasFreeAddress2 = tronGasFree.generateGasFreeAddress(userAddress);
|
116
|
-
// tronGasFreeAddress2 is different from tronGasFreeAddress
|
117
|
-
```
|
118
|
-
|
119
|
-
|
120
|
-
#### Get standard TIP712 gas free transaction json object
|
121
|
-
```typescript
|
122
|
-
try {
|
123
|
-
const tronGasFree = new TronGasFree({
|
124
|
-
chainId: Number('0x2b6653dc'), // use mainnet default config
|
125
|
-
});
|
126
|
-
const transactionJson = tronGasFree.assembleGasFreeTransactionJson({
|
127
|
-
token: 'transaction token contract address',
|
128
|
-
serviceProvider: 'gas free transaction service provider',
|
129
|
-
user: 'your tron wallet address, NOT your gas free address',
|
130
|
-
receiver: 'tron receiver address, it can be a wallet address or a gasfree contract address',
|
131
|
-
value: 'transfer value, decimal string number',
|
132
|
-
maxFee: 'max transfer gas fee, decimal string number',
|
133
|
-
deadline: 'timestamp, transaction deadline',
|
134
|
-
version: "version of the signature algorithm used by gasfree offline transaction, the current version is 1",
|
135
|
-
nonce: 'gas free transaction nonce, decimal string number',
|
136
|
-
});
|
137
|
-
} catch (error) {
|
138
|
-
}
|
139
|
-
```
|
140
|
-
|
141
|
-
#### normal GasFree signature
|
142
|
-
```typescript
|
143
|
-
import TronWeb from 'tronweb';
|
144
|
-
import { TronGasFree } from '@tronlink/gasfree-sdk-js';
|
145
|
-
|
146
|
-
const PRIVATE_KEY = 'your private key';
|
147
|
-
|
148
|
-
try {
|
149
|
-
const tronGasFree = new TronGasFree({
|
150
|
-
chainId: Number('0x2b6653dc'), // use mainnet default config
|
151
|
-
});
|
152
|
-
|
153
|
-
const { domain, types, message } = tronGasFree.assembleGasFreeTransactionJson({
|
154
|
-
token: 'transaction token contract address',
|
155
|
-
serviceProvider: 'gas free transaction service provider',
|
156
|
-
user: 'your tron wallet address, NOT your gas free address',
|
157
|
-
receiver: 'tron receiver address, it can be a wallet address or a gasfree contract address',
|
158
|
-
value: 'transfer value, decimal string number',
|
159
|
-
maxFee: 'max transfer gas fee, decimal string number',
|
160
|
-
deadline: 'timestamp, transaction deadline',
|
161
|
-
version: "version of the signature algorithm used by gasfree offline transaction, the current version is 1",
|
162
|
-
nonce: 'gas free transaction nonce, decimal string number',
|
163
|
-
});
|
164
|
-
|
165
|
-
const res = await TronWeb.Trx._signTypedData(domain, types, message, PRIVATE_KEY);
|
166
|
-
} catch (error) {
|
167
|
-
}
|
168
|
-
```
|
169
|
-
|
170
|
-
#### ledger GasFree signature
|
171
|
-
```typescript
|
172
|
-
import { TronGasFree } from '@tronlink/gasfree-sdk-js'
|
173
|
-
import AppTrx from '@ledgerhq/hw-app-trx';
|
174
|
-
import TransportWebHID from '@ledgerhq/hw-transport-webhid';
|
175
|
-
|
176
|
-
try {
|
177
|
-
const tronGasFree = new TronGasFree({
|
178
|
-
chainId: Number('0x2b6653dc'), // use mainnet default config
|
179
|
-
});
|
180
|
-
const { permitTransferMessageHash } =
|
181
|
-
tronGasFree.getGasFreeLedgerRawHash({
|
182
|
-
message: {
|
183
|
-
token: 'transaction token contract address',
|
184
|
-
serviceProvider: 'gas free transaction service provider',
|
185
|
-
user: 'your tron wallet address, NOT your gas free address',
|
186
|
-
receiver: 'tron receiver address, it can be a wallet address or a gasfree contract address',
|
187
|
-
value: 'transfer value, decimal string number',
|
188
|
-
maxFee: 'max transfer gas fee, decimal string number',
|
189
|
-
deadline: 'timestamp, transaction deadline',
|
190
|
-
version: "version of the signature algorithm used by gasfree offline transaction, the current version is 1",
|
191
|
-
nonce: 'gas free transaction nonce, decimal string number',
|
192
|
-
},
|
193
|
-
});
|
194
|
-
const transport = await TransportWebHID.create();
|
195
|
-
const app = new AppTrx(transport);
|
196
|
-
const path = 'you ledger address path';
|
197
|
-
const res = await app.signTransactionHash(path, permitTransferMessageHash);
|
198
|
-
} catch (error) {
|
199
|
-
}
|
200
|
-
```
|
201
|
-
|
202
|
-
|
203
|
-
## Running the tests
|
204
|
-
|
205
|
-
The project includes a suite of tests for the Tron GasFree sdk. To run these tests, use the
|
206
|
-
following command:
|
207
|
-
|
208
|
-
```bash
|
209
|
-
pnpm test
|
210
|
-
```
|
211
|
-
|
212
|
-
## Local build
|
213
|
-
|
214
|
-
These instructions will get you a copy of the project up and running on your local machine for
|
215
|
-
development and testing purposes.
|
216
|
-
|
217
|
-
### Prerequisites
|
218
|
-
|
219
|
-
- Node.js >= 18.19.0
|
220
|
-
- pnpm >= 7.32.0
|
221
|
-
- TypeScript >= 4.9.5
|
222
|
-
|
223
|
-
### Build
|
224
|
-
|
225
|
-
##### 1. Install pnpm
|
226
|
-
|
227
|
-
This project recommends using `pnpm` as the build tool Make sure node is installed:
|
228
|
-
|
229
|
-
Make sure the node version meets the requirements:
|
230
|
-
```bash
|
231
|
-
node -v
|
232
|
-
```
|
233
|
-
|
234
|
-
and install `pnpm`:
|
235
|
-
```bash
|
236
|
-
npm i -g pnpm
|
237
|
-
```
|
238
|
-
|
239
|
-
##### 2. Clone the repository
|
240
|
-
|
241
|
-
You can use `git clone` to download or download the code directly
|
242
|
-
|
243
|
-
##### 3. Install dependencies
|
244
|
-
|
245
|
-
```bash
|
246
|
-
pnpm install
|
247
|
-
```
|
248
|
-
|
249
|
-
##### 4. Compile TypeScript files
|
250
|
-
|
251
|
-
```bash
|
252
|
-
pnpm build
|
253
|
-
```
|
254
|
-
|
255
|
-
### Built With
|
256
|
-
|
257
|
-
- [TypeScript](https://www.typescriptlang.org/)
|
258
|
-
- [Node.js](https://nodejs.org/)
|
259
|
-
|
260
|
-
## Integrity Check
|
261
|
-
|
262
|
-
The package files will be signed using a GPG key pair, and the correctness of the signature will be verified using the following public key:
|
263
|
-
|
264
|
-
```
|
265
|
-
pub: 7B910EA80207596075E6D7BA5D34F7A6550473BA
|
266
|
-
uid: build_tronlink <build@tronlink.org>
|
267
|
-
```
|
268
|
-
|
269
|
-
|
270
|
-
## License
|
271
|
-
|
272
|
-
This project is licensed under the Apache License Version 2.0 - see the [LICENSE](LICENSE) file for
|
273
|
-
details
|