Comparing version 0.11.0 to 0.12.0
@@ -1,4 +0,11 @@ | ||
export { compileTrim } from './trim/index.js'; | ||
import { compileTrim } from './trim/index.js'; | ||
export { compileBasm } from './basm.js'; | ||
export { getOpcodesForTrim } from './interop.js'; | ||
export { debugDecompileToBasm } from './decompile.js'; | ||
export { makeStaticRouter } from './templates/static-router.js'; | ||
export { makeStubbedContract } from './templates/stubbed-contract.js'; | ||
type TemplateFn = (strings: TemplateStringsArray, ...values: any[]) => string; | ||
export declare const trim: TemplateFn & { | ||
source: TemplateFn; | ||
compile: typeof compileTrim; | ||
}; |
@@ -1,4 +0,19 @@ | ||
export { compileTrim } from './trim/index.js'; | ||
import { compileTrim } from './trim/index.js'; | ||
export { compileBasm } from './basm.js'; | ||
export { getOpcodesForTrim } from './interop.js'; | ||
export { debugDecompileToBasm } from './decompile.js'; | ||
export { makeStaticRouter } from './templates/static-router.js'; | ||
export { makeStubbedContract } from './templates/stubbed-contract.js'; | ||
// | ||
// Support syntaxes: | ||
// trim`...` | ||
// trim.compile(trim.source`...`, options) | ||
// | ||
function templateTag(strings, ...values) { | ||
return String.raw(strings, ...values); | ||
} | ||
export const trim = function (...args) { | ||
return templateTag(...args); | ||
}; | ||
trim.source = templateTag; | ||
trim.compile = compileTrim; |
@@ -41,1 +41,19 @@ export type ToplevelSexp = SexpNode[]; | ||
}; | ||
export interface AbiJsonFragmentType { | ||
readonly name?: string; | ||
readonly indexed?: boolean; | ||
readonly type?: string; | ||
readonly internalType?: any; | ||
readonly components?: ReadonlyArray<AbiJsonFragmentType>; | ||
} | ||
export interface AbiJsonFragment { | ||
readonly name?: string; | ||
readonly type?: string; | ||
readonly anonymous?: boolean; | ||
readonly payable?: boolean; | ||
readonly constant?: boolean; | ||
readonly stateMutability?: string; | ||
readonly inputs?: ReadonlyArray<AbiJsonFragmentType>; | ||
readonly outputs?: ReadonlyArray<AbiJsonFragmentType>; | ||
readonly gas?: string; | ||
} |
{ | ||
"name": "trim-evm", | ||
"version": "0.11.0", | ||
"version": "0.12.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -43,5 +43,5 @@ # Trim | ||
```js | ||
import { compileTrim } from 'trim-evm' | ||
import { trim } from 'trim-evm' | ||
const bytecode = compileTrim('(ADD 0x00 0x01)') | ||
const bytecode = trim`(ADD 0x00 0x01)` | ||
@@ -51,2 +51,13 @@ console.log("Compile success! Resulting bytecode:", bytecode) | ||
If you need to configure opcodes: | ||
```js | ||
import { trim } from 'trim-evm' | ||
const bytecode = trim.compile(trim.source`(ADD 0x00 0x01)`, { | ||
opcodes: ..., | ||
opcodesMetadata: ..., | ||
}) | ||
``` | ||
## Sample | ||
@@ -53,0 +64,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
74335
35
2508
386
1