@magic-ext/tezos 0.1.9 → 1.0.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/CHANGELOG.md +12 -0
- package/LICENSE +21 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/es/index.js +2 -0
- package/dist/es/index.js.map +1 -0
- package/dist/extension.js +1 -0
- package/dist/modern/index.mjs +2 -0
- package/dist/modern/index.mjs.map +1 -0
- package/dist/react-native/index.native.js +2 -0
- package/dist/react-native/index.native.js.map +1 -0
- package/dist/types/index.cdn.d.ts +2 -0
- package/dist/{src → types}/index.d.ts +26 -14
- package/package.json +27 -13
- package/dist/index.cdn.js +0 -1
- package/dist/index.js +0 -1
- package/dist/src/type.d.ts +0 -7
- package/src/index.ts +0 -139
- package/src/type.ts +0 -8
- package/tsconfig.json +0 -19
- package/webpack.config.js +0 -28
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# v1.0.0 (Fri Dec 10 2021)
|
|
2
|
+
|
|
3
|
+
#### 💥 Breaking Change
|
|
4
|
+
|
|
5
|
+
- Jerryliu sc 44386 migrate web3 related magic ext repos to magic part 2 [#251](https://github.com/magiclabs/magic-js/pull/251) ([@Ethella](https://github.com/Ethella))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Jerry Liu ([@Ethella](https://github.com/Ethella))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018-present Magic Labs, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var t=require("@magic-sdk/commons");function e(t,n){return(e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,n)}exports.TezosExtension=function(t){var n,o;function r(e){var n;return(n=t.call(this)||this).tezosConfig=void 0,n.name="tezos",n.config=void 0,n.sendTransactionOperation=function(t,e,o,r){return n.request({id:42,method:"tezos_sendTransaction",jsonrpc:"2.0",params:{to:t,amount:e,fee:o,derivationPath:r}})},n.sendContractOriginationOperation=function(t,e,o,r,a,i,s,c,u){return n.request({id:42,jsonrpc:"2.0",method:"tezos_sendContractOriginationOperation",params:{amount:t,delegate:e,fee:o,derivationPath:r,storage_limit:a,gas_limit:i,code:s,storage:c,codeFormat:u}})},n.sendContractInvocationOperation=function(t,e,o,r,a,i,s,c,u){return n.request({id:42,jsonrpc:"2.0",method:"tezos_sendContractInvocationOperation",params:{contract:t,amount:e,fee:o,derivationPath:r,storageLimit:a,gasLimit:i,entrypoint:s,parameters:c,parameterFormat:u}})},n.sendContractPing=function(t,e,o,r,a,i){return n.request({id:42,jsonrpc:"2.0",method:"tezos_sendContractPing",params:{contract:t,amount:e,fee:o,derivationPath:r,storageLimit:a,gasLimit:i}})},n.sendDelegationOperation=function(t,e){return n.request({id:42,jsonrpc:"2.0",method:"tezos_sendDelegationOperation",params:{to:t,amount:e}})},n.getAccount=function(){return n.request({id:42,jsonrpc:"2.0",method:"tezos_getAccount",params:[]})},n.tezosConfig=e,n.config={rpcUrl:e.rpcUrl,chainType:"TEZOS"},n}return o=t,(n=r).prototype=Object.create(o.prototype),n.prototype.constructor=n,e(n,o),r}(t.Extension.Internal);
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import { Extension } from '@magic-sdk/commons';\nimport { TezosConfig, ConfigType } from './type';\n\nexport class TezosExtension extends Extension.Internal<'tezos', TezosConfig> {\n name = 'tezos' as const;\n\n config: ConfigType;\n\n constructor(public tezosConfig: TezosConfig) {\n super();\n\n this.config = {\n rpcUrl: tezosConfig.rpcUrl,\n chainType: 'TEZOS',\n };\n }\n\n public sendTransactionOperation = (\n to: string,\n amount: number,\n fee: number,\n derivationPath: string,\n ): Promise<string> => {\n return this.request({\n id: 42,\n method: 'tezos_sendTransaction',\n jsonrpc: '2.0',\n params: {\n to,\n amount,\n fee,\n derivationPath,\n },\n });\n };\n\n public sendContractOriginationOperation = (\n amount: number,\n delegate: any,\n fee: number,\n derivationPath: string,\n storage_limit: number,\n gas_limit: number,\n code: string,\n storage: string,\n codeFormat: string,\n ): Promise<any> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'tezos_sendContractOriginationOperation',\n params: {\n amount,\n delegate,\n fee,\n derivationPath,\n storage_limit,\n gas_limit,\n code,\n storage,\n codeFormat,\n },\n });\n };\n\n public sendContractInvocationOperation = (\n contract: string,\n amount: number,\n fee: number,\n derivationPath: string | undefined,\n storageLimit: number,\n gasLimit: number,\n entrypoint: string | undefined,\n parameters: string | undefined,\n parameterFormat?: string,\n ) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'tezos_sendContractInvocationOperation',\n params: {\n contract,\n amount,\n fee,\n derivationPath,\n storageLimit,\n gasLimit,\n entrypoint,\n parameters,\n parameterFormat,\n },\n });\n };\n\n public sendContractPing = (\n contract: string,\n amount: number,\n fee: number,\n derivationPath: string | undefined,\n storageLimit: number,\n gasLimit: number,\n ) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'tezos_sendContractPing',\n params: {\n contract,\n amount,\n fee,\n derivationPath,\n storageLimit,\n gasLimit,\n },\n });\n };\n\n public sendDelegationOperation = (to: string, amount: number) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'tezos_sendDelegationOperation',\n params: {\n to,\n amount,\n },\n });\n };\n\n public getAccount = (): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'tezos_getAccount',\n params: [],\n });\n };\n}\n"],"names":["tezosConfig","_this","name","config","sendTransactionOperation","to","amount","fee","derivationPath","request","id","method","jsonrpc","params","sendContractOriginationOperation","delegate","storage_limit","gas_limit","code","storage","codeFormat","sendContractInvocationOperation","contract","storageLimit","gasLimit","entrypoint","parameters","parameterFormat","sendContractPing","sendDelegationOperation","getAccount","rpcUrl","chainType","Extension","Internal"],"mappings":"2KAQE,WAAmBA,gBACjBC,sBADiBD,qBAJnBE,KAAO,UAEPC,gBAWOC,yBAA2B,SAChCC,EACAC,EACAC,EACAC,GAEA,SAAYC,QAAQ,CAClBC,GAAI,GACJC,OAAQ,wBACRC,QAAS,MACTC,OAAQ,CACNR,GAAAA,EACAC,OAAAA,EACAC,IAAAA,EACAC,eAAAA,QAKCM,iCAAmC,SACxCR,EACAS,EACAR,EACAC,EACAQ,EACAC,EACAC,EACAC,EACAC,GAEA,SAAYX,QAAQ,CAClBC,GAAI,GACJE,QAAS,MACTD,OAAQ,yCACRE,OAAQ,CACNP,OAAAA,EACAS,SAAAA,EACAR,IAAAA,EACAC,eAAAA,EACAQ,cAAAA,EACAC,UAAAA,EACAC,KAAAA,EACAC,QAAAA,EACAC,WAAAA,QAKCC,gCAAkC,SACvCC,EACAhB,EACAC,EACAC,EACAe,EACAC,EACAC,EACAC,EACAC,GAEA,SAAYlB,QAAQ,CAClBC,GAAI,GACJE,QAAS,MACTD,OAAQ,wCACRE,OAAQ,CACNS,SAAAA,EACAhB,OAAAA,EACAC,IAAAA,EACAC,eAAAA,EACAe,aAAAA,EACAC,SAAAA,EACAC,WAAAA,EACAC,WAAAA,EACAC,gBAAAA,QAKCC,iBAAmB,SACxBN,EACAhB,EACAC,EACAC,EACAe,EACAC,GAEA,SAAYf,QAAQ,CAClBC,GAAI,GACJE,QAAS,MACTD,OAAQ,yBACRE,OAAQ,CACNS,SAAAA,EACAhB,OAAAA,EACAC,IAAAA,EACAC,eAAAA,EACAe,aAAAA,EACAC,SAAAA,QAKCK,wBAA0B,SAACxB,EAAYC,GAC5C,SAAYG,QAAQ,CAClBC,GAAI,GACJE,QAAS,MACTD,OAAQ,gCACRE,OAAQ,CACNR,GAAAA,EACAC,OAAAA,QAKCwB,WAAa,WAClB,SAAYrB,QAAQ,CAClBC,GAAI,GACJE,QAAS,MACTD,OAAQ,mBACRE,OAAQ,MA9HOZ,cAAAD,EAGjBC,EAAKE,OAAS,CACZ4B,OAAQ/B,EAAY+B,OACpBC,UAAW,WAVjB,0FAAoCC,YAAUC"}
|
package/dist/es/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Extension as t}from"@magic-sdk/commons";function o(t,n){return(o=Object.setPrototypeOf||function(t,o){return t.__proto__=o,t})(t,n)}var n=function(t){var n,e;function r(o){var n;return(n=t.call(this)||this).tezosConfig=void 0,n.name="tezos",n.config=void 0,n.sendTransactionOperation=function(t,o,e,r){return n.request({id:42,method:"tezos_sendTransaction",jsonrpc:"2.0",params:{to:t,amount:o,fee:e,derivationPath:r}})},n.sendContractOriginationOperation=function(t,o,e,r,a,i,s,c,p){return n.request({id:42,jsonrpc:"2.0",method:"tezos_sendContractOriginationOperation",params:{amount:t,delegate:o,fee:e,derivationPath:r,storage_limit:a,gas_limit:i,code:s,storage:c,codeFormat:p}})},n.sendContractInvocationOperation=function(t,o,e,r,a,i,s,c,p){return n.request({id:42,jsonrpc:"2.0",method:"tezos_sendContractInvocationOperation",params:{contract:t,amount:o,fee:e,derivationPath:r,storageLimit:a,gasLimit:i,entrypoint:s,parameters:c,parameterFormat:p}})},n.sendContractPing=function(t,o,e,r,a,i){return n.request({id:42,jsonrpc:"2.0",method:"tezos_sendContractPing",params:{contract:t,amount:o,fee:e,derivationPath:r,storageLimit:a,gasLimit:i}})},n.sendDelegationOperation=function(t,o){return n.request({id:42,jsonrpc:"2.0",method:"tezos_sendDelegationOperation",params:{to:t,amount:o}})},n.getAccount=function(){return n.request({id:42,jsonrpc:"2.0",method:"tezos_getAccount",params:[]})},n.tezosConfig=o,n.config={rpcUrl:o.rpcUrl,chainType:"TEZOS"},n}return e=t,(n=r).prototype=Object.create(e.prototype),n.prototype.constructor=n,o(n,e),r}(t.Internal);export{n as TezosExtension};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import { Extension } from '@magic-sdk/commons';\nimport { TezosConfig, ConfigType } from './type';\n\nexport class TezosExtension extends Extension.Internal<'tezos', TezosConfig> {\n name = 'tezos' as const;\n\n config: ConfigType;\n\n constructor(public tezosConfig: TezosConfig) {\n super();\n\n this.config = {\n rpcUrl: tezosConfig.rpcUrl,\n chainType: 'TEZOS',\n };\n }\n\n public sendTransactionOperation = (\n to: string,\n amount: number,\n fee: number,\n derivationPath: string,\n ): Promise<string> => {\n return this.request({\n id: 42,\n method: 'tezos_sendTransaction',\n jsonrpc: '2.0',\n params: {\n to,\n amount,\n fee,\n derivationPath,\n },\n });\n };\n\n public sendContractOriginationOperation = (\n amount: number,\n delegate: any,\n fee: number,\n derivationPath: string,\n storage_limit: number,\n gas_limit: number,\n code: string,\n storage: string,\n codeFormat: string,\n ): Promise<any> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'tezos_sendContractOriginationOperation',\n params: {\n amount,\n delegate,\n fee,\n derivationPath,\n storage_limit,\n gas_limit,\n code,\n storage,\n codeFormat,\n },\n });\n };\n\n public sendContractInvocationOperation = (\n contract: string,\n amount: number,\n fee: number,\n derivationPath: string | undefined,\n storageLimit: number,\n gasLimit: number,\n entrypoint: string | undefined,\n parameters: string | undefined,\n parameterFormat?: string,\n ) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'tezos_sendContractInvocationOperation',\n params: {\n contract,\n amount,\n fee,\n derivationPath,\n storageLimit,\n gasLimit,\n entrypoint,\n parameters,\n parameterFormat,\n },\n });\n };\n\n public sendContractPing = (\n contract: string,\n amount: number,\n fee: number,\n derivationPath: string | undefined,\n storageLimit: number,\n gasLimit: number,\n ) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'tezos_sendContractPing',\n params: {\n contract,\n amount,\n fee,\n derivationPath,\n storageLimit,\n gasLimit,\n },\n });\n };\n\n public sendDelegationOperation = (to: string, amount: number) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'tezos_sendDelegationOperation',\n params: {\n to,\n amount,\n },\n });\n };\n\n public getAccount = (): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'tezos_getAccount',\n params: [],\n });\n };\n}\n"],"names":["TezosExtension","tezosConfig","_this","name","config","sendTransactionOperation","to","amount","fee","derivationPath","request","id","method","jsonrpc","params","sendContractOriginationOperation","delegate","storage_limit","gas_limit","code","storage","codeFormat","sendContractInvocationOperation","contract","storageLimit","gasLimit","entrypoint","parameters","parameterFormat","sendContractPing","sendDelegationOperation","getAccount","rpcUrl","chainType","Extension","Internal"],"mappings":"2IAGaA,IAAAA,sBAKX,WAAmBC,gBACjBC,sBADiBD,qBAJnBE,KAAO,UAEPC,gBAWOC,yBAA2B,SAChCC,EACAC,EACAC,EACAC,GAEA,SAAYC,QAAQ,CAClBC,GAAI,GACJC,OAAQ,wBACRC,QAAS,MACTC,OAAQ,CACNR,GAAAA,EACAC,OAAAA,EACAC,IAAAA,EACAC,eAAAA,QAKCM,iCAAmC,SACxCR,EACAS,EACAR,EACAC,EACAQ,EACAC,EACAC,EACAC,EACAC,GAEA,SAAYX,QAAQ,CAClBC,GAAI,GACJE,QAAS,MACTD,OAAQ,yCACRE,OAAQ,CACNP,OAAAA,EACAS,SAAAA,EACAR,IAAAA,EACAC,eAAAA,EACAQ,cAAAA,EACAC,UAAAA,EACAC,KAAAA,EACAC,QAAAA,EACAC,WAAAA,QAKCC,gCAAkC,SACvCC,EACAhB,EACAC,EACAC,EACAe,EACAC,EACAC,EACAC,EACAC,GAEA,SAAYlB,QAAQ,CAClBC,GAAI,GACJE,QAAS,MACTD,OAAQ,wCACRE,OAAQ,CACNS,SAAAA,EACAhB,OAAAA,EACAC,IAAAA,EACAC,eAAAA,EACAe,aAAAA,EACAC,SAAAA,EACAC,WAAAA,EACAC,WAAAA,EACAC,gBAAAA,QAKCC,iBAAmB,SACxBN,EACAhB,EACAC,EACAC,EACAe,EACAC,GAEA,SAAYf,QAAQ,CAClBC,GAAI,GACJE,QAAS,MACTD,OAAQ,yBACRE,OAAQ,CACNS,SAAAA,EACAhB,OAAAA,EACAC,IAAAA,EACAC,eAAAA,EACAe,aAAAA,EACAC,SAAAA,QAKCK,wBAA0B,SAACxB,EAAYC,GAC5C,SAAYG,QAAQ,CAClBC,GAAI,GACJE,QAAS,MACTD,OAAQ,gCACRE,OAAQ,CACNR,GAAAA,EACAC,OAAAA,QAKCwB,WAAa,WAClB,SAAYrB,QAAQ,CAClBC,GAAI,GACJE,QAAS,MACTD,OAAQ,mBACRE,OAAQ,MA9HOZ,cAAAD,EAGjBC,EAAKE,OAAS,CACZ4B,OAAQ/B,EAAY+B,OACpBC,UAAW,WAVjB,0FAAoCC,EAAUC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var MagicTezosExtension=function(t){function n(t,e){return(n=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,e)}return function(t){var e,o;function r(n){var e;return(e=t.call(this)||this).tezosConfig=void 0,e.name="tezos",e.config=void 0,e.sendTransactionOperation=function(t,n,o,r){return e.request({id:42,method:"tezos_sendTransaction",jsonrpc:"2.0",params:{to:t,amount:n,fee:o,derivationPath:r}})},e.sendContractOriginationOperation=function(t,n,o,r,a,i,s,c,u){return e.request({id:42,jsonrpc:"2.0",method:"tezos_sendContractOriginationOperation",params:{amount:t,delegate:n,fee:o,derivationPath:r,storage_limit:a,gas_limit:i,code:s,storage:c,codeFormat:u}})},e.sendContractInvocationOperation=function(t,n,o,r,a,i,s,c,u){return e.request({id:42,jsonrpc:"2.0",method:"tezos_sendContractInvocationOperation",params:{contract:t,amount:n,fee:o,derivationPath:r,storageLimit:a,gasLimit:i,entrypoint:s,parameters:c,parameterFormat:u}})},e.sendContractPing=function(t,n,o,r,a,i){return e.request({id:42,jsonrpc:"2.0",method:"tezos_sendContractPing",params:{contract:t,amount:n,fee:o,derivationPath:r,storageLimit:a,gasLimit:i}})},e.sendDelegationOperation=function(t,n){return e.request({id:42,jsonrpc:"2.0",method:"tezos_sendDelegationOperation",params:{to:t,amount:n}})},e.getAccount=function(){return e.request({id:42,jsonrpc:"2.0",method:"tezos_getAccount",params:[]})},e.tezosConfig=n,e.config={rpcUrl:n.rpcUrl,chainType:"TEZOS"},e}return o=t,(e=r).prototype=Object.create(o.prototype),e.prototype.constructor=e,n(e,o),r}(Magic.Extension.Internal)}();
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Extension as t}from"@magic-sdk/commons";class e extends t.Internal{constructor(t){super(),this.tezosConfig=void 0,this.name="tezos",this.config=void 0,this.sendTransactionOperation=(t,e,o,i)=>this.request({id:42,method:"tezos_sendTransaction",jsonrpc:"2.0",params:{to:t,amount:e,fee:o,derivationPath:i}}),this.sendContractOriginationOperation=(t,e,o,i,n,s,a,r,c)=>this.request({id:42,jsonrpc:"2.0",method:"tezos_sendContractOriginationOperation",params:{amount:t,delegate:e,fee:o,derivationPath:i,storage_limit:n,gas_limit:s,code:a,storage:r,codeFormat:c}}),this.sendContractInvocationOperation=(t,e,o,i,n,s,a,r,c)=>this.request({id:42,jsonrpc:"2.0",method:"tezos_sendContractInvocationOperation",params:{contract:t,amount:e,fee:o,derivationPath:i,storageLimit:n,gasLimit:s,entrypoint:a,parameters:r,parameterFormat:c}}),this.sendContractPing=(t,e,o,i,n,s)=>this.request({id:42,jsonrpc:"2.0",method:"tezos_sendContractPing",params:{contract:t,amount:e,fee:o,derivationPath:i,storageLimit:n,gasLimit:s}}),this.sendDelegationOperation=(t,e)=>this.request({id:42,jsonrpc:"2.0",method:"tezos_sendDelegationOperation",params:{to:t,amount:e}}),this.getAccount=()=>this.request({id:42,jsonrpc:"2.0",method:"tezos_getAccount",params:[]}),this.tezosConfig=t,this.config={rpcUrl:t.rpcUrl,chainType:"TEZOS"}}}export{e as TezosExtension};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["import { Extension } from '@magic-sdk/commons';\nimport { TezosConfig, ConfigType } from './type';\n\nexport class TezosExtension extends Extension.Internal<'tezos', TezosConfig> {\n name = 'tezos' as const;\n\n config: ConfigType;\n\n constructor(public tezosConfig: TezosConfig) {\n super();\n\n this.config = {\n rpcUrl: tezosConfig.rpcUrl,\n chainType: 'TEZOS',\n };\n }\n\n public sendTransactionOperation = (\n to: string,\n amount: number,\n fee: number,\n derivationPath: string,\n ): Promise<string> => {\n return this.request({\n id: 42,\n method: 'tezos_sendTransaction',\n jsonrpc: '2.0',\n params: {\n to,\n amount,\n fee,\n derivationPath,\n },\n });\n };\n\n public sendContractOriginationOperation = (\n amount: number,\n delegate: any,\n fee: number,\n derivationPath: string,\n storage_limit: number,\n gas_limit: number,\n code: string,\n storage: string,\n codeFormat: string,\n ): Promise<any> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'tezos_sendContractOriginationOperation',\n params: {\n amount,\n delegate,\n fee,\n derivationPath,\n storage_limit,\n gas_limit,\n code,\n storage,\n codeFormat,\n },\n });\n };\n\n public sendContractInvocationOperation = (\n contract: string,\n amount: number,\n fee: number,\n derivationPath: string | undefined,\n storageLimit: number,\n gasLimit: number,\n entrypoint: string | undefined,\n parameters: string | undefined,\n parameterFormat?: string,\n ) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'tezos_sendContractInvocationOperation',\n params: {\n contract,\n amount,\n fee,\n derivationPath,\n storageLimit,\n gasLimit,\n entrypoint,\n parameters,\n parameterFormat,\n },\n });\n };\n\n public sendContractPing = (\n contract: string,\n amount: number,\n fee: number,\n derivationPath: string | undefined,\n storageLimit: number,\n gasLimit: number,\n ) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'tezos_sendContractPing',\n params: {\n contract,\n amount,\n fee,\n derivationPath,\n storageLimit,\n gasLimit,\n },\n });\n };\n\n public sendDelegationOperation = (to: string, amount: number) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'tezos_sendDelegationOperation',\n params: {\n to,\n amount,\n },\n });\n };\n\n public getAccount = (): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'tezos_getAccount',\n params: [],\n });\n };\n}\n"],"names":["TezosExtension","Extension","Internal","constructor","tezosConfig","super","name","config","sendTransactionOperation","to","amount","fee","derivationPath","request","id","method","jsonrpc","params","sendContractOriginationOperation","delegate","storage_limit","gas_limit","code","storage","codeFormat","sendContractInvocationOperation","contract","storageLimit","gasLimit","entrypoint","parameters","parameterFormat","sendContractPing","sendDelegationOperation","getAccount","this","rpcUrl","chainType"],"mappings":"qDAGaA,UAAuBC,EAAUC,SAK5CC,YAAmBC,GACjBC,aADiBD,wBAJnBE,KAAO,aAEPC,mBAWOC,yBAA2B,CAChCC,EACAC,EACAC,EACAC,SAEYC,QAAQ,CAClBC,GAAI,GACJC,OAAQ,wBACRC,QAAS,MACTC,OAAQ,CACNR,GAAAA,EACAC,OAAAA,EACAC,IAAAA,EACAC,eAAAA,UAKCM,iCAAmC,CACxCR,EACAS,EACAR,EACAC,EACAQ,EACAC,EACAC,EACAC,EACAC,SAEYX,QAAQ,CAClBC,GAAI,GACJE,QAAS,MACTD,OAAQ,yCACRE,OAAQ,CACNP,OAAAA,EACAS,SAAAA,EACAR,IAAAA,EACAC,eAAAA,EACAQ,cAAAA,EACAC,UAAAA,EACAC,KAAAA,EACAC,QAAAA,EACAC,WAAAA,UAKCC,gCAAkC,CACvCC,EACAhB,EACAC,EACAC,EACAe,EACAC,EACAC,EACAC,EACAC,SAEYlB,QAAQ,CAClBC,GAAI,GACJE,QAAS,MACTD,OAAQ,wCACRE,OAAQ,CACNS,SAAAA,EACAhB,OAAAA,EACAC,IAAAA,EACAC,eAAAA,EACAe,aAAAA,EACAC,SAAAA,EACAC,WAAAA,EACAC,WAAAA,EACAC,gBAAAA,UAKCC,iBAAmB,CACxBN,EACAhB,EACAC,EACAC,EACAe,EACAC,SAEYf,QAAQ,CAClBC,GAAI,GACJE,QAAS,MACTD,OAAQ,yBACRE,OAAQ,CACNS,SAAAA,EACAhB,OAAAA,EACAC,IAAAA,EACAC,eAAAA,EACAe,aAAAA,EACAC,SAAAA,UAKCK,wBAA0B,CAACxB,EAAYC,SAChCG,QAAQ,CAClBC,GAAI,GACJE,QAAS,MACTD,OAAQ,gCACRE,OAAQ,CACNR,GAAAA,EACAC,OAAAA,UAKCwB,WAAa,SACNrB,QAAQ,CAClBC,GAAI,GACJE,QAAS,MACTD,OAAQ,mBACRE,OAAQ,KA9HOkB,iBAAA/B,EAGjB+B,KAAK5B,OAAS,CACZ6B,OAAQhC,EAAYgC,OACpBC,UAAW"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var t=require("@magic-sdk/commons");function e(t,n){return(e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,n)}exports.TezosExtension=function(t){var n,o;function r(e){var n;return(n=t.call(this)||this).tezosConfig=void 0,n.name="tezos",n.config=void 0,n.sendTransactionOperation=function(t,e,o,r){return n.request({id:42,method:"tezos_sendTransaction",jsonrpc:"2.0",params:{to:t,amount:e,fee:o,derivationPath:r}})},n.sendContractOriginationOperation=function(t,e,o,r,a,i,s,c,u){return n.request({id:42,jsonrpc:"2.0",method:"tezos_sendContractOriginationOperation",params:{amount:t,delegate:e,fee:o,derivationPath:r,storage_limit:a,gas_limit:i,code:s,storage:c,codeFormat:u}})},n.sendContractInvocationOperation=function(t,e,o,r,a,i,s,c,u){return n.request({id:42,jsonrpc:"2.0",method:"tezos_sendContractInvocationOperation",params:{contract:t,amount:e,fee:o,derivationPath:r,storageLimit:a,gasLimit:i,entrypoint:s,parameters:c,parameterFormat:u}})},n.sendContractPing=function(t,e,o,r,a,i){return n.request({id:42,jsonrpc:"2.0",method:"tezos_sendContractPing",params:{contract:t,amount:e,fee:o,derivationPath:r,storageLimit:a,gasLimit:i}})},n.sendDelegationOperation=function(t,e){return n.request({id:42,jsonrpc:"2.0",method:"tezos_sendDelegationOperation",params:{to:t,amount:e}})},n.getAccount=function(){return n.request({id:42,jsonrpc:"2.0",method:"tezos_getAccount",params:[]})},n.tezosConfig=e,n.config={rpcUrl:e.rpcUrl,chainType:"TEZOS"},n}return o=t,(n=r).prototype=Object.create(o.prototype),n.prototype.constructor=n,e(n,o),r}(t.Extension.Internal);
|
|
2
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.native.js","sources":["../../src/index.ts"],"sourcesContent":["import { Extension } from '@magic-sdk/commons';\nimport { TezosConfig, ConfigType } from './type';\n\nexport class TezosExtension extends Extension.Internal<'tezos', TezosConfig> {\n name = 'tezos' as const;\n\n config: ConfigType;\n\n constructor(public tezosConfig: TezosConfig) {\n super();\n\n this.config = {\n rpcUrl: tezosConfig.rpcUrl,\n chainType: 'TEZOS',\n };\n }\n\n public sendTransactionOperation = (\n to: string,\n amount: number,\n fee: number,\n derivationPath: string,\n ): Promise<string> => {\n return this.request({\n id: 42,\n method: 'tezos_sendTransaction',\n jsonrpc: '2.0',\n params: {\n to,\n amount,\n fee,\n derivationPath,\n },\n });\n };\n\n public sendContractOriginationOperation = (\n amount: number,\n delegate: any,\n fee: number,\n derivationPath: string,\n storage_limit: number,\n gas_limit: number,\n code: string,\n storage: string,\n codeFormat: string,\n ): Promise<any> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'tezos_sendContractOriginationOperation',\n params: {\n amount,\n delegate,\n fee,\n derivationPath,\n storage_limit,\n gas_limit,\n code,\n storage,\n codeFormat,\n },\n });\n };\n\n public sendContractInvocationOperation = (\n contract: string,\n amount: number,\n fee: number,\n derivationPath: string | undefined,\n storageLimit: number,\n gasLimit: number,\n entrypoint: string | undefined,\n parameters: string | undefined,\n parameterFormat?: string,\n ) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'tezos_sendContractInvocationOperation',\n params: {\n contract,\n amount,\n fee,\n derivationPath,\n storageLimit,\n gasLimit,\n entrypoint,\n parameters,\n parameterFormat,\n },\n });\n };\n\n public sendContractPing = (\n contract: string,\n amount: number,\n fee: number,\n derivationPath: string | undefined,\n storageLimit: number,\n gasLimit: number,\n ) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'tezos_sendContractPing',\n params: {\n contract,\n amount,\n fee,\n derivationPath,\n storageLimit,\n gasLimit,\n },\n });\n };\n\n public sendDelegationOperation = (to: string, amount: number) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'tezos_sendDelegationOperation',\n params: {\n to,\n amount,\n },\n });\n };\n\n public getAccount = (): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'tezos_getAccount',\n params: [],\n });\n };\n}\n"],"names":["tezosConfig","_this","name","config","sendTransactionOperation","to","amount","fee","derivationPath","request","id","method","jsonrpc","params","sendContractOriginationOperation","delegate","storage_limit","gas_limit","code","storage","codeFormat","sendContractInvocationOperation","contract","storageLimit","gasLimit","entrypoint","parameters","parameterFormat","sendContractPing","sendDelegationOperation","getAccount","rpcUrl","chainType","Extension","Internal"],"mappings":"2KAQE,WAAmBA,gBACjBC,sBADiBD,qBAJnBE,KAAO,UAEPC,gBAWOC,yBAA2B,SAChCC,EACAC,EACAC,EACAC,GAEA,SAAYC,QAAQ,CAClBC,GAAI,GACJC,OAAQ,wBACRC,QAAS,MACTC,OAAQ,CACNR,GAAAA,EACAC,OAAAA,EACAC,IAAAA,EACAC,eAAAA,QAKCM,iCAAmC,SACxCR,EACAS,EACAR,EACAC,EACAQ,EACAC,EACAC,EACAC,EACAC,GAEA,SAAYX,QAAQ,CAClBC,GAAI,GACJE,QAAS,MACTD,OAAQ,yCACRE,OAAQ,CACNP,OAAAA,EACAS,SAAAA,EACAR,IAAAA,EACAC,eAAAA,EACAQ,cAAAA,EACAC,UAAAA,EACAC,KAAAA,EACAC,QAAAA,EACAC,WAAAA,QAKCC,gCAAkC,SACvCC,EACAhB,EACAC,EACAC,EACAe,EACAC,EACAC,EACAC,EACAC,GAEA,SAAYlB,QAAQ,CAClBC,GAAI,GACJE,QAAS,MACTD,OAAQ,wCACRE,OAAQ,CACNS,SAAAA,EACAhB,OAAAA,EACAC,IAAAA,EACAC,eAAAA,EACAe,aAAAA,EACAC,SAAAA,EACAC,WAAAA,EACAC,WAAAA,EACAC,gBAAAA,QAKCC,iBAAmB,SACxBN,EACAhB,EACAC,EACAC,EACAe,EACAC,GAEA,SAAYf,QAAQ,CAClBC,GAAI,GACJE,QAAS,MACTD,OAAQ,yBACRE,OAAQ,CACNS,SAAAA,EACAhB,OAAAA,EACAC,IAAAA,EACAC,eAAAA,EACAe,aAAAA,EACAC,SAAAA,QAKCK,wBAA0B,SAACxB,EAAYC,GAC5C,SAAYG,QAAQ,CAClBC,GAAI,GACJE,QAAS,MACTD,OAAQ,gCACRE,OAAQ,CACNR,GAAAA,EACAC,OAAAA,QAKCwB,WAAa,WAClB,SAAYrB,QAAQ,CAClBC,GAAI,GACJE,QAAS,MACTD,OAAQ,mBACRE,OAAQ,MA9HOZ,cAAAD,EAGjBC,EAAKE,OAAS,CACZ4B,OAAQ/B,EAAY+B,OACpBC,UAAW,WAVjB,0FAAoCC,YAAUC"}
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
import { Extension } from 'magic-sdk';
|
|
2
|
-
import { TezosConfig, ConfigType } from './type';
|
|
3
|
-
export declare class TezosExtension extends Extension.Internal<'tezos', TezosConfig> {
|
|
4
|
-
tezosConfig: TezosConfig;
|
|
5
|
-
name: "tezos";
|
|
6
|
-
config: ConfigType;
|
|
7
|
-
constructor(tezosConfig: TezosConfig);
|
|
8
|
-
sendTransactionOperation: (to: string, amount: number, fee: number, derivationPath: string) => Promise<string>;
|
|
9
|
-
sendContractOriginationOperation: (amount: number, delegate: any, fee: number, derivationPath: string, storage_limit: number, gas_limit: number, code: string, storage: string, codeFormat: string) => Promise<any>;
|
|
10
|
-
sendContractInvocationOperation: (contract: string, amount: number, fee: number, derivationPath: string | undefined, storageLimit: number, gasLimit: number, entrypoint: string | undefined, parameters: string | undefined, parameterFormat?: string | undefined) =>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
1
|
+
import { Extension } from '@magic-sdk/commons';
|
|
2
|
+
import { TezosConfig, ConfigType } from './type';
|
|
3
|
+
export declare class TezosExtension extends Extension.Internal<'tezos', TezosConfig> {
|
|
4
|
+
tezosConfig: TezosConfig;
|
|
5
|
+
name: "tezos";
|
|
6
|
+
config: ConfigType;
|
|
7
|
+
constructor(tezosConfig: TezosConfig);
|
|
8
|
+
sendTransactionOperation: (to: string, amount: number, fee: number, derivationPath: string) => Promise<string>;
|
|
9
|
+
sendContractOriginationOperation: (amount: number, delegate: any, fee: number, derivationPath: string, storage_limit: number, gas_limit: number, code: string, storage: string, codeFormat: string) => Promise<any>;
|
|
10
|
+
sendContractInvocationOperation: (contract: string, amount: number, fee: number, derivationPath: string | undefined, storageLimit: number, gasLimit: number, entrypoint: string | undefined, parameters: string | undefined, parameterFormat?: string | undefined) => import("@magic-sdk/commons").PromiEvent<any, {
|
|
11
|
+
done: (result: any) => void;
|
|
12
|
+
error: (reason: any) => void;
|
|
13
|
+
settled: () => void;
|
|
14
|
+
}>;
|
|
15
|
+
sendContractPing: (contract: string, amount: number, fee: number, derivationPath: string | undefined, storageLimit: number, gasLimit: number) => import("@magic-sdk/commons").PromiEvent<any, {
|
|
16
|
+
done: (result: any) => void;
|
|
17
|
+
error: (reason: any) => void;
|
|
18
|
+
settled: () => void;
|
|
19
|
+
}>;
|
|
20
|
+
sendDelegationOperation: (to: string, amount: number) => import("@magic-sdk/commons").PromiEvent<any, {
|
|
21
|
+
done: (result: any) => void;
|
|
22
|
+
error: (reason: any) => void;
|
|
23
|
+
settled: () => void;
|
|
24
|
+
}>;
|
|
25
|
+
getAccount: () => Promise<string>;
|
|
26
|
+
}
|
package/package.json
CHANGED
|
@@ -1,20 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magic-ext/tezos",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "magic tezos extension",
|
|
5
|
+
"author": "Magic <team@magic.link> (https://magic.link/)",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/magiclabs/magic-js"
|
|
10
10
|
},
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"target": "web",
|
|
15
|
+
"cdnGlobalName": "MagicTezosExtension",
|
|
16
|
+
"main": "./dist/cjs/index.js",
|
|
17
|
+
"module": "./dist/es/index.js",
|
|
18
|
+
"types": "./dist/types/index.d.ts",
|
|
19
|
+
"jsdelivr": "./dist/extension.js",
|
|
20
|
+
"react-native": "./dist/react-native/index.native.js",
|
|
21
|
+
"exports": {
|
|
22
|
+
"import": "./dist/modern/index.mjs",
|
|
23
|
+
"require": "./dist/cjs/index.js"
|
|
24
|
+
},
|
|
25
|
+
"externals": {
|
|
26
|
+
"include": [
|
|
27
|
+
"@magic-sdk/commons"
|
|
28
|
+
]
|
|
13
29
|
},
|
|
14
|
-
"author": "Fortmatic <team@fortmatic.com> (https://fortmatic.com/)",
|
|
15
|
-
"license": "MIT",
|
|
16
30
|
"devDependencies": {
|
|
17
|
-
"magic-sdk": "^
|
|
31
|
+
"@magic-sdk/commons": "^2.2.1"
|
|
18
32
|
},
|
|
19
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "89934a470863df3e54228c02f677c90fc4de364c"
|
|
20
34
|
}
|
package/dist/index.cdn.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
window.TezosExtension=function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=1)}([function(t,n){t.exports=window["magic-sdk"]},function(t,n,e){"use strict";e.r(n),e.d(n,"TezosExtension",(function(){return a}));var r,o=e(0),i=(r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)},function(t,n){function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),a=function(t){function n(n){var e=t.call(this)||this;return e.tezosConfig=n,e.name="tezos",e.sendTransactionOperation=function(t,n,r,o){return e.request({id:42,method:"tezos_sendTransaction",jsonrpc:"2.0",params:{to:t,amount:n,fee:r,derivationPath:o}})},e.sendContractOriginationOperation=function(t,n,r,o,i,a,u,c,s){return e.request({id:42,jsonrpc:"2.0",method:"tezos_sendContractOriginationOperation",params:{amount:t,delegate:n,fee:r,derivationPath:o,storage_limit:i,gas_limit:a,code:u,storage:c,codeFormat:s}})},e.sendContractInvocationOperation=function(t,n,r,o,i,a,u,c,s){return e.request({id:42,jsonrpc:"2.0",method:"tezos_sendContractInvocationOperation",params:{contract:t,amount:n,fee:r,derivationPath:o,storageLimit:i,gasLimit:a,entrypoint:u,parameters:c,parameterFormat:s}})},e.sendContractPing=function(t,n,r,o,i,a){return e.request({id:42,jsonrpc:"2.0",method:"tezos_sendContractPing",params:{contract:t,amount:n,fee:r,derivationPath:o,storageLimit:i,gasLimit:a}})},e.sendDelegationOperation=function(t,n){return e.request({id:42,jsonrpc:"2.0",method:"tezos_sendDelegationOperation",params:{to:t,amount:n}})},e.getAccount=function(){return e.request({id:42,jsonrpc:"2.0",method:"tezos_getAccount",params:[]})},e.config={rpcUrl:n.rpcUrl,chainType:"TEZOS"},e}return i(n,t),n}(o.Extension.Internal)}]);
|
package/dist/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e){t.exports=require("magic-sdk")},function(t,e,n){"use strict";n.r(e),n.d(e,"TezosExtension",(function(){return a}));var r,o=n(0),i=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(e){var n=t.call(this)||this;return n.tezosConfig=e,n.name="tezos",n.sendTransactionOperation=function(t,e,r,o){return n.request({id:42,method:"tezos_sendTransaction",jsonrpc:"2.0",params:{to:t,amount:e,fee:r,derivationPath:o}})},n.sendContractOriginationOperation=function(t,e,r,o,i,a,u,c,s){return n.request({id:42,jsonrpc:"2.0",method:"tezos_sendContractOriginationOperation",params:{amount:t,delegate:e,fee:r,derivationPath:o,storage_limit:i,gas_limit:a,code:u,storage:c,codeFormat:s}})},n.sendContractInvocationOperation=function(t,e,r,o,i,a,u,c,s){return n.request({id:42,jsonrpc:"2.0",method:"tezos_sendContractInvocationOperation",params:{contract:t,amount:e,fee:r,derivationPath:o,storageLimit:i,gasLimit:a,entrypoint:u,parameters:c,parameterFormat:s}})},n.sendContractPing=function(t,e,r,o,i,a){return n.request({id:42,jsonrpc:"2.0",method:"tezos_sendContractPing",params:{contract:t,amount:e,fee:r,derivationPath:o,storageLimit:i,gasLimit:a}})},n.sendDelegationOperation=function(t,e){return n.request({id:42,jsonrpc:"2.0",method:"tezos_sendDelegationOperation",params:{to:t,amount:e}})},n.getAccount=function(){return n.request({id:42,jsonrpc:"2.0",method:"tezos_getAccount",params:[]})},n.config={rpcUrl:e.rpcUrl,chainType:"TEZOS"},n}return i(e,t),e}(o.Extension.Internal)}]);
|
package/dist/src/type.d.ts
DELETED
package/src/index.ts
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { Extension } from 'magic-sdk';
|
|
2
|
-
import { TezosConfig, ConfigType } from './type'
|
|
3
|
-
|
|
4
|
-
export class TezosExtension extends Extension.Internal<
|
|
5
|
-
'tezos',
|
|
6
|
-
TezosConfig
|
|
7
|
-
> {
|
|
8
|
-
name = 'tezos' as const;
|
|
9
|
-
|
|
10
|
-
config: ConfigType;
|
|
11
|
-
|
|
12
|
-
constructor(public tezosConfig: TezosConfig){
|
|
13
|
-
super();
|
|
14
|
-
|
|
15
|
-
this.config = {
|
|
16
|
-
rpcUrl: tezosConfig.rpcUrl,
|
|
17
|
-
chainType: 'TEZOS'
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
public sendTransactionOperation = (to: string, amount: number, fee: number, derivationPath: string): Promise<string> => {
|
|
22
|
-
return this.request({
|
|
23
|
-
id:42,
|
|
24
|
-
method: 'tezos_sendTransaction',
|
|
25
|
-
jsonrpc: '2.0',
|
|
26
|
-
params: {
|
|
27
|
-
to,
|
|
28
|
-
amount,
|
|
29
|
-
fee,
|
|
30
|
-
derivationPath
|
|
31
|
-
}
|
|
32
|
-
})
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
public sendContractOriginationOperation = (
|
|
36
|
-
amount: number,
|
|
37
|
-
delegate: any,
|
|
38
|
-
fee: number,
|
|
39
|
-
derivationPath: string,
|
|
40
|
-
storage_limit: number,
|
|
41
|
-
gas_limit: number,
|
|
42
|
-
code: string,
|
|
43
|
-
storage: string,
|
|
44
|
-
codeFormat: string
|
|
45
|
-
): Promise<any> => {
|
|
46
|
-
return this.request({
|
|
47
|
-
id:42,
|
|
48
|
-
jsonrpc: '2.0',
|
|
49
|
-
method: 'tezos_sendContractOriginationOperation',
|
|
50
|
-
params: {
|
|
51
|
-
amount,
|
|
52
|
-
delegate,
|
|
53
|
-
fee,
|
|
54
|
-
derivationPath,
|
|
55
|
-
storage_limit,
|
|
56
|
-
gas_limit,
|
|
57
|
-
code,
|
|
58
|
-
storage,
|
|
59
|
-
codeFormat
|
|
60
|
-
}
|
|
61
|
-
})
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
public sendContractInvocationOperation = (
|
|
65
|
-
contract: string,
|
|
66
|
-
amount: number,
|
|
67
|
-
fee: number,
|
|
68
|
-
derivationPath: string | undefined,
|
|
69
|
-
storageLimit: number,
|
|
70
|
-
gasLimit: number,
|
|
71
|
-
entrypoint: string | undefined,
|
|
72
|
-
parameters: string | undefined,
|
|
73
|
-
parameterFormat?: string
|
|
74
|
-
) => {
|
|
75
|
-
return this.request({
|
|
76
|
-
id:42,
|
|
77
|
-
jsonrpc: '2.0',
|
|
78
|
-
method: 'tezos_sendContractInvocationOperation',
|
|
79
|
-
params: {
|
|
80
|
-
contract,
|
|
81
|
-
amount,
|
|
82
|
-
fee,
|
|
83
|
-
derivationPath,
|
|
84
|
-
storageLimit,
|
|
85
|
-
gasLimit,
|
|
86
|
-
entrypoint,
|
|
87
|
-
parameters,
|
|
88
|
-
parameterFormat
|
|
89
|
-
}
|
|
90
|
-
})
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
public sendContractPing = (
|
|
94
|
-
contract: string,
|
|
95
|
-
amount: number,
|
|
96
|
-
fee: number,
|
|
97
|
-
derivationPath: string | undefined,
|
|
98
|
-
storageLimit: number,
|
|
99
|
-
gasLimit: number,
|
|
100
|
-
) => {
|
|
101
|
-
return this.request({
|
|
102
|
-
id:42,
|
|
103
|
-
jsonrpc: '2.0',
|
|
104
|
-
method: 'tezos_sendContractPing',
|
|
105
|
-
params: {
|
|
106
|
-
contract,
|
|
107
|
-
amount,
|
|
108
|
-
fee,
|
|
109
|
-
derivationPath,
|
|
110
|
-
storageLimit,
|
|
111
|
-
gasLimit,
|
|
112
|
-
}
|
|
113
|
-
})
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
public sendDelegationOperation = (
|
|
117
|
-
to: string,
|
|
118
|
-
amount: number,
|
|
119
|
-
) => {
|
|
120
|
-
return this.request({
|
|
121
|
-
id:42,
|
|
122
|
-
jsonrpc: '2.0',
|
|
123
|
-
method: 'tezos_sendDelegationOperation',
|
|
124
|
-
params: {
|
|
125
|
-
to,
|
|
126
|
-
amount
|
|
127
|
-
}
|
|
128
|
-
})
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
public getAccount = (): Promise<string> => {
|
|
132
|
-
return this.request({
|
|
133
|
-
id:42,
|
|
134
|
-
jsonrpc: '2.0',
|
|
135
|
-
method: 'tezos_getAccount',
|
|
136
|
-
params: []
|
|
137
|
-
})
|
|
138
|
-
}
|
|
139
|
-
}
|
package/src/type.ts
DELETED
package/tsconfig.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"outDir": "./dist",
|
|
4
|
-
"moduleResolution": "node",
|
|
5
|
-
"noImplicitAny": true,
|
|
6
|
-
"module": "es6",
|
|
7
|
-
"target": "es5",
|
|
8
|
-
"allowJs": true,
|
|
9
|
-
"strict": true,
|
|
10
|
-
"allowSyntheticDefaultImports": true,
|
|
11
|
-
"experimentalDecorators": true,
|
|
12
|
-
"noImplicitReturns": true,
|
|
13
|
-
"noImplicitThis": true,
|
|
14
|
-
"esModuleInterop": true,
|
|
15
|
-
"downlevelIteration": true,
|
|
16
|
-
"sourceMap": true,
|
|
17
|
-
"declaration": true
|
|
18
|
-
}
|
|
19
|
-
}
|
package/webpack.config.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
|
|
3
|
-
const isDevelopment = process.env.NODE_ENV !== 'production';
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
6
|
-
entry: './src/index.ts',
|
|
7
|
-
mode: isDevelopment ? 'development' : 'production',
|
|
8
|
-
module: {
|
|
9
|
-
rules: [
|
|
10
|
-
{
|
|
11
|
-
test: /\.tsx?$/,
|
|
12
|
-
use: 'ts-loader',
|
|
13
|
-
exclude: /node_modules/,
|
|
14
|
-
},
|
|
15
|
-
],
|
|
16
|
-
},
|
|
17
|
-
resolve: {
|
|
18
|
-
extensions: [ '.ts', '.js' ],
|
|
19
|
-
},
|
|
20
|
-
externals: {
|
|
21
|
-
'magic-sdk': 'magic-sdk'
|
|
22
|
-
},
|
|
23
|
-
output: {
|
|
24
|
-
filename: 'index.js',
|
|
25
|
-
path: path.resolve(__dirname, './dist'),
|
|
26
|
-
libraryTarget: 'commonjs2'
|
|
27
|
-
},
|
|
28
|
-
};
|