refactor: move brother_node development artifact to dev/test-nodes subdirectory
Development Artifact Cleanup: ✅ BROTHER_NODE REORGANIZATION: Moved development test node to appropriate location - dev/test-nodes/brother_node/: Moved from root directory for better organization - Contains development configuration, test logs, and test chain data - No impact on production systems - purely development/testing artifact ✅ DEVELOPMENT ARTIFACTS IDENTIFIED: - Chain ID: aitbc-brother-chain (test/development chain) - Ports: 8010 (P2P) and 8011 (RPC) - different from production - Environment: .env file with test configuration - Logs: rpc.log and node.log from development testing session (March 15, 2026) ✅ ROOT DIRECTORY CLEANUP: Removed development clutter from production directory - brother_node/ moved to dev/test-nodes/brother_node/ - Root directory now contains only production-ready components - Development artifacts properly organized in dev/ subdirectory DIRECTORY STRUCTURE IMPROVEMENT: 📁 dev/test-nodes/: Development and testing node configurations 🏗️ Root Directory: Clean production structure with only essential components 🧪 Development Isolation: Test environments separated from production BENEFITS: ✅ Clean Production Directory: No development artifacts in root ✅ Better Organization: Development nodes grouped in dev/ subdirectory ✅ Clear Separation: Production vs development environments clearly distinguished ✅ Maintainability: Easier to identify and manage development components RESULT: Successfully moved brother_node development artifact to dev/test-nodes/ subdirectory, cleaning up the root directory while preserving development testing environment for future use.
This commit is contained in:
21
dev/env/node_modules/micro-eth-signer/LICENSE
generated
vendored
Executable file
21
dev/env/node_modules/micro-eth-signer/LICENSE
generated
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2021 Paul Miller (https://paulmillr.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the “Software”), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
567
dev/env/node_modules/micro-eth-signer/README.md
generated
vendored
Executable file
567
dev/env/node_modules/micro-eth-signer/README.md
generated
vendored
Executable file
@@ -0,0 +1,567 @@
|
||||
# micro-eth-signer
|
||||
|
||||
Minimal library for Ethereum transactions, addresses and smart contracts.
|
||||
|
||||
- 🔓 Secure: audited [noble](https://paulmillr.com/noble/) cryptography, no network code, [hedged signatures](#transactions-create-sign)
|
||||
- 🔻 Tree-shakeable: unused code is excluded from your builds
|
||||
- 🔍 Reliable: 150MB of test vectors from EIPs, ethers and viem
|
||||
- ✍️ Core: transactions, addresses, messages
|
||||
- 🌍 Network-related: execute Uniswap & Chainlink, fetch tx history
|
||||
- 🦺 Advanced: type-safe ABI parsing, RLP, SSZ, KZG, Verkle
|
||||
- 🪶 29KB gzipped (1300 lines) for core, just 3 deps
|
||||
|
||||
_Check out all web3 utility libraries:_ [ETH](https://github.com/paulmillr/micro-eth-signer), [BTC](https://github.com/paulmillr/scure-btc-signer), [SOL](https://github.com/paulmillr/micro-sol-signer)
|
||||
|
||||
## Usage
|
||||
|
||||
> `npm install micro-eth-signer`
|
||||
|
||||
> `jsr add jsr:@paulmillr/micro-eth-signer`
|
||||
|
||||
We support all major platforms and runtimes.
|
||||
For React Native, you may need a [polyfill for getRandomValues](https://github.com/LinusU/react-native-get-random-values).
|
||||
If you don't like NPM, a standalone [eth-signer.js](https://github.com/paulmillr/micro-eth-signer/releases) is also available.
|
||||
|
||||
- Core
|
||||
- [Create random wallet](#create-random-wallet)
|
||||
- [Transactions: create, sign](#transactions-create-sign)
|
||||
- [Addresses: create, checksum](#addresses-create-checksum)
|
||||
- [Messages: sign, verify](#messages-sign-verify)
|
||||
- Network-related
|
||||
- [Init network](#init-network)
|
||||
- [Fetch balances and history](#fetch-balances-and-history-from-an-archive-node)
|
||||
- [Fetch Chainlink oracle prices](#fetch-chainlink-oracle-prices)
|
||||
- [Resolve ENS address](#resolve-ens-address)
|
||||
- [Swap tokens with Uniswap](#swap-tokens-with-uniswap)
|
||||
- Advanced
|
||||
- [Type-safe ABI parsing](#type-safe-abi-parsing)
|
||||
- [Human-readable transaction hints](#human-readable-transaction-hints)
|
||||
- [Human-readable event hints](#human-readable-event-hints)
|
||||
- [RLP & SSZ](#rlp--ssz)
|
||||
- [KZG & Verkle](#kzg--verkle)
|
||||
- [Security](#security)
|
||||
- [Performance](#performance)
|
||||
- [License](#license)
|
||||
|
||||
## Core
|
||||
|
||||
### Create random wallet
|
||||
|
||||
```ts
|
||||
import { addr } from 'micro-eth-signer';
|
||||
const random = addr.random(); // Secure: uses CSPRNG
|
||||
console.log(random.privateKey, random.address);
|
||||
// '0x17ed046e6c4c21df770547fad9a157fd17b48b35fe9984f2ff1e3c6a62700bae'
|
||||
// '0x26d930712fd2f612a107A70fd0Ad79b777cD87f6'
|
||||
```
|
||||
|
||||
### Transactions: create, sign
|
||||
|
||||
```ts
|
||||
import { Transaction, weigwei, weieth } from 'micro-eth-signer';
|
||||
const tx = Transaction.prepare({
|
||||
to: '0xdf90dea0e0bf5ca6d2a7f0cb86874ba6714f463e',
|
||||
value: weieth.decode('1.1'), // 1.1eth in wei
|
||||
maxFeePerGas: weigwei.decode('100'), // 100gwei in wei (priority fee is 1 gwei)
|
||||
nonce: 0n,
|
||||
});
|
||||
// Uses `random` from example above. Alternatively, pass 0x hex string or Uint8Array
|
||||
const signedTx = tx.signBy(random.privateKey);
|
||||
console.log('signed tx', signedTx, signedTx.toHex());
|
||||
console.log('fee', signedTx.fee);
|
||||
|
||||
// Hedged signatures, with extra noise / security
|
||||
const signedTx2 = tx.signBy(random.privateKey, { extraEntropy: true });
|
||||
|
||||
// Send whole account balance. See Security section for caveats
|
||||
const CURRENT_BALANCE = '1.7182050000017'; // in eth
|
||||
const txSendingWholeBalance = unsignedTx.setWholeAmount(weieth.decode(CURRENT_BALANCE));
|
||||
```
|
||||
|
||||
We support legacy, EIP2930, EIP1559, EIP4844 and EIP7702 transactions.
|
||||
|
||||
Signing is done with [noble-curves](https://github.com/paulmillr/noble-curves), using RFC 6979.
|
||||
Hedged signatures are also supported - check out the blog post
|
||||
[Deterministic signatures are not your friends](https://paulmillr.com/posts/deterministic-signatures/).
|
||||
|
||||
### Addresses: create, checksum
|
||||
|
||||
```ts
|
||||
import { addr } from 'micro-eth-signer';
|
||||
const priv = '0x0687640ee33ef844baba3329db9e16130bd1735cbae3657bd64aed25e9a5c377';
|
||||
const pub = '030fba7ba5cfbf8b00dd6f3024153fc44ddda93727da58c99326eb0edd08195cdb';
|
||||
const nonChecksummedAddress = '0x0089d53f703f7e0843953d48133f74ce247184c2';
|
||||
const checksummedAddress = addr.addChecksum(nonChecksummedAddress);
|
||||
console.log(
|
||||
checksummedAddress, // 0x0089d53F703f7E0843953D48133f74cE247184c2
|
||||
addr.isValid(checksummedAddress), // true
|
||||
addr.isValid(nonChecksummedAddress), // also true
|
||||
addr.fromPrivateKey(priv),
|
||||
addr.fromPublicKey(pub)
|
||||
);
|
||||
```
|
||||
|
||||
### Messages: sign, verify
|
||||
|
||||
There are two messaging standards: [EIP-191](https://eips.ethereum.org/EIPS/eip-191) & [EIP-712](https://eips.ethereum.org/EIPS/eip-712).
|
||||
|
||||
#### EIP-191
|
||||
|
||||
```ts
|
||||
import * as typed from 'micro-eth-signer/typed-data';
|
||||
|
||||
// Example message
|
||||
const message = 'Hello, Ethereum!';
|
||||
const privateKey = '0x4c0883a69102937d6231471b5dbb6204fe512961708279f1d7b1b8e7e8b1b1e1';
|
||||
|
||||
// Sign the message
|
||||
const signature = typed.personal.sign(message, privateKey);
|
||||
console.log('Signature:', signature);
|
||||
|
||||
// Verify the signature
|
||||
const address = '0xYourEthereumAddress';
|
||||
const isValid = typed.personal.verify(signature, message, address);
|
||||
console.log('Is valid:', isValid);
|
||||
```
|
||||
|
||||
#### EIP-712
|
||||
|
||||
```ts
|
||||
import * as typed from 'micro-eth-signer/typed-data';
|
||||
|
||||
const types = {
|
||||
Person: [
|
||||
{ name: 'name', type: 'string' },
|
||||
{ name: 'wallet', type: 'address' },
|
||||
],
|
||||
Mail: [
|
||||
{ name: 'from', type: 'Person' },
|
||||
{ name: 'to', type: 'Person' },
|
||||
{ name: 'contents', type: 'string' },
|
||||
],
|
||||
};
|
||||
|
||||
// Define the domain
|
||||
const domain: typed.EIP712Domain = {
|
||||
name: 'Ether Mail',
|
||||
version: '1',
|
||||
chainId: 1,
|
||||
verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',
|
||||
salt: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
|
||||
};
|
||||
|
||||
// Define the message
|
||||
const message = {
|
||||
from: {
|
||||
name: 'Alice',
|
||||
wallet: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',
|
||||
},
|
||||
to: {
|
||||
name: 'Bob',
|
||||
wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',
|
||||
},
|
||||
contents: 'Hello, Bob!',
|
||||
};
|
||||
|
||||
// Create the typed data
|
||||
const typedData: typed.TypedData<typeof types, 'Mail'> = {
|
||||
types,
|
||||
primaryType: 'Mail',
|
||||
domain,
|
||||
message,
|
||||
};
|
||||
|
||||
// Sign the typed data
|
||||
const privateKey = '0x4c0883a69102937d6231471b5dbb6204fe512961708279f1d7b1b8e7e8b1b1e1';
|
||||
const signature = typed.signTyped(typedData, privateKey);
|
||||
console.log('Signature:', signature);
|
||||
|
||||
// Verify the signature
|
||||
const address = '0xYourEthereumAddress';
|
||||
const isValid = typed.verifyTyped(signature, typedData, address);
|
||||
|
||||
// Recover the public key
|
||||
const publicKey = typed.recoverPublicKeyTyped(signature, typedData);
|
||||
```
|
||||
|
||||
## Network-related
|
||||
|
||||
### Init network
|
||||
|
||||
eth-signer is network-free and makes it easy to audit network-related code:
|
||||
all requests are done with user-provided function, conforming to built-in `fetch()`.
|
||||
We recommend using [micro-ftch](https://github.com/paulmillr/micro-ftch),
|
||||
which implements kill-switch, logging, batching / concurrency and other features.
|
||||
|
||||
Most APIs (chainlink, uniswap) expect instance of Web3Provider.
|
||||
The call stack would look like this:
|
||||
|
||||
- `Chainlink` => `Web3Provider` => `jsonrpc` => `fetch`
|
||||
|
||||
To initialize Web3Provider, do the following:
|
||||
|
||||
```js
|
||||
// Requests are made with fetch(), a built-in method
|
||||
import { jsonrpc } from 'micro-ftch';
|
||||
import { Web3Provider } from 'micro-eth-signer/net';
|
||||
const RPC_URL = 'http://localhost:8545';
|
||||
const prov = new Web3Provider(jsonrpc(fetch, RPC_URL));
|
||||
|
||||
// Example using mewapi RPC
|
||||
const RPC_URL_2 = 'https://nodes.mewapi.io/rpc/eth';
|
||||
const prov2 = new Web3Provider(
|
||||
jsonrpc(fetch, RPC_URL_2, { Origin: 'https://www.myetherwallet.com' })
|
||||
);
|
||||
```
|
||||
|
||||
### Fetch balances & history
|
||||
|
||||
> [!NOTE]
|
||||
> Basic data can be fetched from any node.
|
||||
> Uses `trace_filter` & requires [Erigon](https://erigon.tech), others are too slow.
|
||||
|
||||
```ts
|
||||
const addr = '0xd8da6bf26964af9d7eed9e03e53415d37aa96045';
|
||||
const block = await prov.blockInfo(await prov.height());
|
||||
console.log('current block', block.number, block.timestamp, block.baseFeePerGas);
|
||||
console.log('info for addr', addr, await prov.unspent(addr));
|
||||
|
||||
// Other methods of Web3Provider:
|
||||
// blockInfo(block: number): Promise<BlockInfo>; // {baseFeePerGas, hash, timestamp...}
|
||||
// height(): Promise<number>;
|
||||
// internalTransactions(address: string, opts?: TraceOpts): Promise<any[]>;
|
||||
// ethLogsSingle(topics: Topics, opts: LogOpts): Promise<Log[]>;
|
||||
// ethLogs(topics: Topics, opts?: LogOpts): Promise<Log[]>;
|
||||
// tokenTransfers(address: string, opts?: LogOpts): Promise<[Log[], Log[]]>;
|
||||
// wethTransfers(address: string, opts?: LogOpts): Promise<[Log[]]>;
|
||||
// txInfo(txHash: string, opts?: TxInfoOpts): Promise<{
|
||||
// type: "legacy" | "eip2930" | "eip1559" | "eip4844"; info: any; receipt: any; raw: string | undefined;
|
||||
// }>;
|
||||
// tokenInfo(address: string): Promise<TokenInfo | undefined>;
|
||||
// transfers(address: string, opts?: TraceOpts & LogOpts): Promise<TxTransfers[]>;
|
||||
// allowances(address: string, opts?: LogOpts): Promise<TxAllowances>;
|
||||
// tokenBalances(address: string, tokens: string[]): Promise<Record<string, bigint>>;
|
||||
```
|
||||
|
||||
### Fetch Chainlink oracle prices
|
||||
|
||||
```ts
|
||||
import { Chainlink } from 'micro-eth-signer/net';
|
||||
const link = new Chainlink(prov);
|
||||
const btc = await link.coinPrice('BTC');
|
||||
const bat = await link.tokenPrice('BAT');
|
||||
console.log({ btc, bat }); // BTC 19188.68870991, BAT 0.39728989 in USD
|
||||
```
|
||||
|
||||
### Resolve ENS address
|
||||
|
||||
```ts
|
||||
import { ENS } from 'micro-eth-signer/net';
|
||||
const ens = new ENS(prov);
|
||||
const vitalikAddr = await ens.nameToAddress('vitalik.eth');
|
||||
```
|
||||
|
||||
### Swap tokens with Uniswap
|
||||
|
||||
> Btw cool tool, glad you built it!
|
||||
|
||||
_Uniswap Founder_
|
||||
|
||||
Swap 12.12 USDT to BAT with uniswap V3 defaults of 0.5% slippage, 30 min expiration.
|
||||
|
||||
```ts
|
||||
import { tokenFromSymbol } from 'micro-eth-signer/abi';
|
||||
import { UniswapV3 } from 'micro-eth-signer/net'; // or UniswapV2
|
||||
|
||||
const USDT = tokenFromSymbol('USDT');
|
||||
const BAT = tokenFromSymbol('BAT');
|
||||
const u3 = new UniswapV3(prov); // or new UniswapV2(provider)
|
||||
const fromAddress = '0xd8da6bf26964af9d7eed9e03e53415d37aa96045';
|
||||
const toAddress = '0xd8da6bf26964af9d7eed9e03e53415d37aa96045';
|
||||
const swap = await u3.swap(USDT, BAT, '12.12', { slippagePercent: 0.5, ttl: 30 * 60 });
|
||||
const swapData = await swap.tx(fromAddress, toAddress);
|
||||
console.log(swapData.amount, swapData.expectedAmount, swapData.allowance);
|
||||
```
|
||||
|
||||
## Advanced
|
||||
|
||||
### Type-safe ABI parsing
|
||||
|
||||
The ABI is type-safe when `as const` is specified:
|
||||
|
||||
```ts
|
||||
import { createContract } from 'micro-eth-signer/abi';
|
||||
const PAIR_CONTRACT = [
|
||||
{
|
||||
type: 'function',
|
||||
name: 'getReserves',
|
||||
outputs: [
|
||||
{ name: 'reserve0', type: 'uint112' },
|
||||
{ name: 'reserve1', type: 'uint112' },
|
||||
{ name: 'blockTimestampLast', type: 'uint32' },
|
||||
],
|
||||
},
|
||||
] as const;
|
||||
|
||||
const contract = createContract(PAIR_CONTRACT);
|
||||
// Would create following typescript type:
|
||||
{
|
||||
getReserves: {
|
||||
encodeInput: () => Uint8Array;
|
||||
decodeOutput: (b: Uint8Array) => {
|
||||
reserve0: bigint;
|
||||
reserve1: bigint;
|
||||
blockTimestampLast: bigint;
|
||||
};
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
We're parsing values as:
|
||||
|
||||
```js
|
||||
// no inputs
|
||||
{} -> encodeInput();
|
||||
// single input
|
||||
{inputs: [{type: 'uint'}]} -> encodeInput(bigint);
|
||||
// all inputs named
|
||||
{inputs: [{type: 'uint', name: 'lol'}, {type: 'address', name: 'wut'}]} -> encodeInput({lol: bigint, wut: string})
|
||||
// at least one input is unnamed
|
||||
{inputs: [{type: 'uint', name: 'lol'}, {type: 'address'}]} -> encodeInput([bigint, string])
|
||||
// Same applies for output!
|
||||
```
|
||||
|
||||
There are following limitations:
|
||||
|
||||
- Fixed size arrays can have 999 elements at max: string[], string[1], ..., string[999]
|
||||
- Fixed size 2d arrays can have 39 elements at max: string[][], string[][1], ..., string[39][39]
|
||||
- Which is enough for almost all cases
|
||||
- ABI must be described as constant value: `[...] as const`
|
||||
- We're not able to handle contracts with method overload (same function names with different args) — the code will still work, but not types
|
||||
|
||||
Check out [`src/net/ens.ts`](./src/net/ens.ts) for type-safe contract execution example.
|
||||
|
||||
### Human-readable transaction hints
|
||||
|
||||
The transaction sent ERC-20 USDT token between addresses. The library produces a following hint:
|
||||
|
||||
> Transfer 22588 USDT to 0xdac17f958d2ee523a2206206994597c13d831ec7
|
||||
|
||||
```ts
|
||||
import { decodeTx } from 'micro-eth-signer/abi';
|
||||
|
||||
const tx =
|
||||
'0xf8a901851d1a94a20082c12a94dac17f958d2ee523a2206206994597c13d831ec780b844a9059cbb000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000054259870025a066fcb560b50e577f6dc8c8b2e3019f760da78b4c04021382ba490c572a303a42a0078f5af8ac7e11caba9b7dc7a64f7bdc3b4ce1a6ab0a1246771d7cc3524a7200';
|
||||
// Decode tx information
|
||||
deepStrictEqual(decodeTx(tx), {
|
||||
name: 'transfer',
|
||||
signature: 'transfer(address,uint256)',
|
||||
value: {
|
||||
to: '0xdac17f958d2ee523a2206206994597c13d831ec7',
|
||||
value: 22588000000n,
|
||||
},
|
||||
hint: 'Transfer 22588 USDT to 0xdac17f958d2ee523a2206206994597c13d831ec7',
|
||||
});
|
||||
```
|
||||
|
||||
Or if you have already decoded tx:
|
||||
|
||||
```ts
|
||||
import { decodeData } from 'micro-eth-signer/abi';
|
||||
|
||||
const to = '0x7a250d5630b4cf539739df2c5dacb4c659f2488d';
|
||||
const data =
|
||||
'7ff36ab5000000000000000000000000000000000000000000000000ab54a98ceb1f0ad30000000000000000000000000000000000000000000000000000000000000080000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045000000000000000000000000000000000000000000000000000000006fd9c6ea0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000106d3c66d22d2dd0446df23d7f5960752994d600';
|
||||
const value = 100000000000000000n;
|
||||
|
||||
deepStrictEqual(decodeData(to, data, value, { customContracts }), {
|
||||
name: 'swapExactETHForTokens',
|
||||
signature: 'swapExactETHForTokens(uint256,address[],address,uint256)',
|
||||
value: {
|
||||
amountOutMin: 12345678901234567891n,
|
||||
path: [
|
||||
'0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
||||
'0x106d3c66d22d2dd0446df23d7f5960752994d600',
|
||||
],
|
||||
to: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
|
||||
deadline: 1876543210n,
|
||||
},
|
||||
});
|
||||
|
||||
// With custom tokens/contracts
|
||||
const customContracts = {
|
||||
'0x106d3c66d22d2dd0446df23d7f5960752994d600': { abi: 'ERC20', symbol: 'LABRA', decimals: 9 },
|
||||
};
|
||||
deepStrictEqual(decodeData(to, data, value, { customContracts }), {
|
||||
name: 'swapExactETHForTokens',
|
||||
signature: 'swapExactETHForTokens(uint256,address[],address,uint256)',
|
||||
value: {
|
||||
amountOutMin: 12345678901234567891n,
|
||||
path: [
|
||||
'0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
||||
'0x106d3c66d22d2dd0446df23d7f5960752994d600',
|
||||
],
|
||||
to: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
|
||||
deadline: 1876543210n,
|
||||
},
|
||||
hint: 'Swap 0.1 ETH for at least 12345678901.234567891 LABRA. Expires at Tue, 19 Jun 2029 06:00:10 GMT',
|
||||
});
|
||||
```
|
||||
|
||||
### Human-readable event hints
|
||||
|
||||
Decoding the event produces the following hint:
|
||||
|
||||
> Allow 0xe592427a0aece92de3edee1f18e0157c05861564 spending up to 1000 BAT from 0xd8da6bf26964af9d7eed9e03e53415d37aa96045
|
||||
|
||||
```ts
|
||||
import { decodeEvent } from 'micro-eth-signer/abi';
|
||||
|
||||
const to = '0x0d8775f648430679a709e98d2b0cb6250d2887ef';
|
||||
const topics = [
|
||||
'0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925',
|
||||
'0x000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045',
|
||||
'0x000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564',
|
||||
];
|
||||
const data = '0x00000000000000000000000000000000000000000000003635c9adc5dea00000';
|
||||
const einfo = decodeEvent(to, topics, data);
|
||||
console.log(einfo);
|
||||
```
|
||||
|
||||
### RLP & SSZ
|
||||
|
||||
[packed](https://github.com/paulmillr/micro-packed) allows us to implement
|
||||
RLP in just 100 lines of code, and SSZ in 1500 lines.
|
||||
|
||||
SSZ includes [EIP-7495](https://eips.ethereum.org/EIPS/eip-7495) stable containers.
|
||||
|
||||
```ts
|
||||
import { RLP } from 'micro-eth-signer/rlp';
|
||||
// More RLP examples in test/rlp.test.js
|
||||
RLP.decode(RLP.encode('dog'));
|
||||
```
|
||||
|
||||
```ts
|
||||
import * as ssz from 'micro-eth-signer/ssz';
|
||||
// More SSZ examples in test/ssz.test.js
|
||||
```
|
||||
|
||||
### KZG & Verkle
|
||||
|
||||
Allows to create & verify KZG EIP-4844 proofs.
|
||||
|
||||
```ts
|
||||
import * as verkle from 'micro-eth-signer/verkle';
|
||||
|
||||
import { KZG } from 'micro-eth-signer/kzg';
|
||||
// 400kb, 4-sec init
|
||||
import { trustedSetup } from '@paulmillr/trusted-setups';
|
||||
// 800kb, instant init
|
||||
import { trustedSetup as fastSetup } from '@paulmillr/trusted-setups/fast.js';
|
||||
|
||||
// More KZG & Verkle examples in
|
||||
// https://github.com/ethereumjs/ethereumjs-monorepo
|
||||
|
||||
const kzg = new KZG(trustedSetup);
|
||||
|
||||
// Example blob and scalar
|
||||
const blob = '0x1234567890abcdef'; // Add actual blob data
|
||||
const z = '0x1'; // Add actual scalar
|
||||
|
||||
// Compute and verify proof
|
||||
const [proof, y] = kzg.computeProof(blob, z);
|
||||
console.log('Proof:', proof);
|
||||
console.log('Y:', y);
|
||||
const commitment = '0x1234567890abcdef'; // Add actual commitment
|
||||
const z = '0x1'; // Add actual scalar
|
||||
// const y = '0x2'; // Add actual y value
|
||||
const proof = '0x3'; // Add actual proof
|
||||
const isValid = kzg.verifyProof(commitment, z, y, proof);
|
||||
console.log('Is valid:', isValid);
|
||||
|
||||
// Compute and verify blob proof
|
||||
const blob = '0x1234567890abcdef'; // Add actual blob data
|
||||
const commitment = '0x1'; // Add actual commitment
|
||||
const proof = kzg.computeBlobProof(blob, commitment);
|
||||
console.log('Blob proof:', proof);
|
||||
const isValidB = kzg.verifyBlobProof(blob, commitment, proof);
|
||||
```
|
||||
|
||||
## Security
|
||||
|
||||
Main points to consider when auditing the library:
|
||||
|
||||
- ABI correctness
|
||||
- All ABI JSON should be compared to some external source
|
||||
- There are different databases of ABI: one is hosted by Etherscan, when you open contract page
|
||||
- Network access
|
||||
- There must be no network calls in the library
|
||||
- Some functionality requires network: these need external network interface, conforming to `Web3Provider`
|
||||
- `createContract(abi)` should create purely offline contract
|
||||
- `createContract(abi, net)` would create contract that calls network using `net`, using external interface
|
||||
- Skipped test vectors
|
||||
- There is `SKIPPED_ERRORS`, which contains list of test vectors from other libs that we skip
|
||||
- They are skipped because we consider them invalid, or so
|
||||
- If you believe they're skipped for wrong reasons, investigate and report
|
||||
|
||||
The library is cross-tested against other libraries (last update on 25 Feb 2024):
|
||||
|
||||
- ethereum-tests v13.1
|
||||
- ethers 6.11.1
|
||||
- viem v2.7.13
|
||||
|
||||
Check out article [ZSTs, ABIs, stolen keys and broken legs](https://github.com/paulmillr/micro-eth-signer/discussions/20) about caveats of secure ABI parsing found during development of the library.
|
||||
|
||||
### Privacy considerations
|
||||
|
||||
Default priority fee is 1 gwei, which matches what other wallets have.
|
||||
However, it's recommended to fetch recommended priority fee from a node.
|
||||
|
||||
### Sending whole balance
|
||||
|
||||
There is a method `setWholeAmount` which allows to send whole account balance:
|
||||
|
||||
```ts
|
||||
const CURRENT_BALANCE = '1.7182050000017'; // in eth
|
||||
const txSendingWholeBalance = unsignedTx.setWholeAmount(weieth.decode(CURRENT_BALANCE));
|
||||
```
|
||||
|
||||
It does two things:
|
||||
|
||||
1. `amount = accountBalance - maxFeePerGas * gasLimit`
|
||||
2. `maxPriorityFeePerGas = maxFeePerGas`
|
||||
|
||||
Every eth block sets a fee for all its transactions, called base fee.
|
||||
maxFeePerGas indicates how much gas user is able to spend in the worst case.
|
||||
If the block's base fee is 5 gwei, while user is able to spend 10 gwei in maxFeePerGas,
|
||||
the transaction would only consume 5 gwei. That means, base fee is unknown
|
||||
before the transaction is included in a block.
|
||||
|
||||
By setting priorityFee to maxFee, we make the process deterministic:
|
||||
`maxFee = 10, maxPriority = 10, baseFee = 5` would always spend 10 gwei.
|
||||
In the end, the balance would become 0.
|
||||
|
||||
> [!WARNING]
|
||||
> Using the method would decrease privacy of a transfer, because
|
||||
> payments for services have specific amounts, and not _the whole amount_.
|
||||
|
||||
## Performance
|
||||
|
||||
Transaction signature matches `noble-curves` `sign()` speed,
|
||||
which means over 4000 times per second on an M2 mac.
|
||||
|
||||
The first call of `sign` will take 20ms+ due to noble-curves secp256k1 `utils.precompute`.
|
||||
|
||||
To run benchmarks, execute `npm run bench`.
|
||||
|
||||
## Contributing
|
||||
|
||||
Make sure to use recursive cloning for the [eth-vectors](https://github.com/paulmillr/eth-vectors) submodule:
|
||||
|
||||
git clone --recursive https://github.com/paulmillr/micro-eth-signer.git
|
||||
|
||||
## License
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Paul Miller (https://paulmillr.com)
|
||||
2
dev/env/node_modules/micro-eth-signer/_type_test.d.ts
generated
vendored
Executable file
2
dev/env/node_modules/micro-eth-signer/_type_test.d.ts
generated
vendored
Executable file
@@ -0,0 +1,2 @@
|
||||
export type Bytes = Uint8Array;
|
||||
//# sourceMappingURL=_type_test.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/_type_test.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/_type_test.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_type_test.d.ts","sourceRoot":"","sources":["src/_type_test.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC"}
|
||||
230
dev/env/node_modules/micro-eth-signer/_type_test.js
generated
vendored
Executable file
230
dev/env/node_modules/micro-eth-signer/_type_test.js
generated
vendored
Executable file
@@ -0,0 +1,230 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const abi = require("./abi/decoder.js");
|
||||
// Should not be included in npm package, just for test of typescript compilation
|
||||
const assertType = (_value) => { };
|
||||
const BytesVal = new Uint8Array();
|
||||
const BigIntVal = BigInt(0);
|
||||
const StringVal = 'string';
|
||||
StringVal;
|
||||
const _a = Uint8Array.from([]);
|
||||
_a;
|
||||
// IsEmptyArray
|
||||
const isEmpty = (a) => a;
|
||||
assertType(isEmpty([]));
|
||||
assertType(isEmpty([1]));
|
||||
assertType(isEmpty(['a', 2]));
|
||||
assertType(isEmpty(['a']));
|
||||
assertType(isEmpty([]));
|
||||
assertType(isEmpty([]));
|
||||
assertType(isEmpty([]));
|
||||
assertType(isEmpty([]));
|
||||
assertType(isEmpty([]));
|
||||
assertType(isEmpty([]));
|
||||
assertType(isEmpty([]));
|
||||
assertType(isEmpty(undefined));
|
||||
const t = [
|
||||
{
|
||||
type: 'constructor',
|
||||
inputs: [{ name: 'a', type: 'uint256' }],
|
||||
stateMutability: 'nonpayable',
|
||||
},
|
||||
];
|
||||
assertType(isEmpty(t));
|
||||
// Tests
|
||||
assertType(abi.mapComponent({ type: 'string' }));
|
||||
assertType(abi.mapComponent({ type: 'string[]' }));
|
||||
assertType(abi.mapComponent({ type: 'bytes' }));
|
||||
assertType(abi.mapComponent({ type: 'bytes[]' }));
|
||||
assertType(abi.mapComponent({ type: 'address' }));
|
||||
assertType(abi.mapComponent({ type: 'address[]' }));
|
||||
assertType(abi.mapComponent({ type: 'bool' }));
|
||||
assertType(abi.mapComponent({ type: 'bool[]' }));
|
||||
assertType(abi.mapComponent({ type: 'uint16' }));
|
||||
assertType(abi.mapComponent({ type: 'uint16[]' }));
|
||||
assertType(abi.mapComponent({ type: 'int' }));
|
||||
assertType(abi.mapComponent({ type: 'int[]' }));
|
||||
assertType(abi.mapComponent({ type: 'int24' }));
|
||||
assertType(abi.mapComponent({ type: 'int24[]' }));
|
||||
assertType(abi.mapComponent({ type: 'bytes1' }));
|
||||
assertType(abi.mapComponent({ type: 'bytes1[]' }));
|
||||
assertType(abi.mapComponent({ type: 'bytes15' }));
|
||||
assertType(abi.mapComponent({ type: 'bytes15[]' }));
|
||||
// Tuples
|
||||
assertType(abi.mapComponent({
|
||||
type: 'tuple',
|
||||
components: [
|
||||
{ type: 'uint16', name: 'lol' },
|
||||
{ type: 'string', name: 'wut' },
|
||||
],
|
||||
}));
|
||||
assertType(abi.mapComponent({
|
||||
type: 'tuple',
|
||||
components: [{ type: 'uint16', name: 'lol' }, { type: 'string' }],
|
||||
}));
|
||||
//
|
||||
assertType(abi.mapComponent({ type: 'tuple' }));
|
||||
assertType(abi.mapComponent({ type: 'int25' }));
|
||||
assertType(abi.mapComponent({ type: 'bytes0' }));
|
||||
// Args
|
||||
// If single arg -- use as is
|
||||
assertType(BytesVal);
|
||||
// no names -> tuple
|
||||
assertType([BytesVal, BigIntVal]);
|
||||
// has names -> struct
|
||||
assertType({
|
||||
lol: BytesVal,
|
||||
wut: BigIntVal,
|
||||
});
|
||||
// WHY?!
|
||||
assertType(abi.mapArgs([{ type: 'string' }]));
|
||||
assertType(abi.mapArgs([{ type: 'bytes1' }]));
|
||||
assertType(abi.mapArgs([{ type: 'string' }, { type: 'uint' }]));
|
||||
assertType(abi.mapArgs([
|
||||
{ type: 'string', name: 'lol' },
|
||||
{ type: 'uint', name: 'wut' },
|
||||
]));
|
||||
// Without const
|
||||
assertType(abi.mapArgs([
|
||||
{ type: 'string', name: 'lol' },
|
||||
{ type: 'uint', name: 'wut' },
|
||||
]));
|
||||
assertType(abi.mapArgs([{ type: 'string' }, { type: 'uint' }]));
|
||||
// unfortunately, typescript cannot detect single value arr on non-const data
|
||||
assertType(abi.mapArgs([{ type: 'bytes1' }]));
|
||||
assertType(abi.createContract([
|
||||
{
|
||||
name: 'lol',
|
||||
type: 'function',
|
||||
inputs: [{ type: 'uint' }, { type: 'string' }],
|
||||
outputs: [{ type: 'bytes' }, { type: 'address' }],
|
||||
},
|
||||
]));
|
||||
assertType(abi.createContract([
|
||||
{
|
||||
name: 'lol',
|
||||
type: 'function',
|
||||
outputs: [{ type: 'bytes' }, { type: 'address' }],
|
||||
},
|
||||
]));
|
||||
assertType(abi.createContract([
|
||||
{
|
||||
name: 'lol',
|
||||
type: 'function',
|
||||
inputs: [],
|
||||
outputs: [{ type: 'bytes' }, { type: 'address' }],
|
||||
},
|
||||
]));
|
||||
assertType(abi.createContract([
|
||||
{
|
||||
name: 'lol',
|
||||
type: 'function',
|
||||
inputs: [{ type: 'uint' }, { type: 'string' }],
|
||||
outputs: [{ type: 'bytes' }, { type: 'address' }],
|
||||
},
|
||||
], 1));
|
||||
// Without const there is not much can be derived from abi
|
||||
assertType(abi.createContract([
|
||||
{
|
||||
name: 'lol',
|
||||
type: 'function',
|
||||
inputs: [{ type: 'uint' }, { type: 'string' }],
|
||||
outputs: [{ type: 'bytes' }, { type: 'address' }],
|
||||
},
|
||||
]));
|
||||
const PAIR_CONTRACT = [
|
||||
{
|
||||
type: 'function',
|
||||
name: 'getReserves',
|
||||
outputs: [
|
||||
{ name: 'reserve0', type: 'uint112' },
|
||||
{ name: 'reserve1', type: 'uint112' },
|
||||
{ name: 'blockTimestampLast', type: 'uint32' },
|
||||
],
|
||||
},
|
||||
];
|
||||
assertType(abi.createContract(PAIR_CONTRACT));
|
||||
const TRANSFER_EVENT = [
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{ indexed: true, name: 'from', type: 'address' },
|
||||
{ indexed: true, name: 'to', type: 'address' },
|
||||
{ indexed: false, name: 'value', type: 'uint256' },
|
||||
],
|
||||
name: 'Transfer',
|
||||
type: 'event',
|
||||
},
|
||||
];
|
||||
assertType(abi.events(TRANSFER_EVENT));
|
||||
// Typed data
|
||||
const types = {
|
||||
Person: [
|
||||
{ name: 'name', type: 'string' },
|
||||
{ name: 'wallet', type: 'address' },
|
||||
],
|
||||
Mail: [
|
||||
{ name: 'from', type: 'Person' },
|
||||
{ name: 'to', type: 'Person' },
|
||||
{ name: 'contents', type: 'string' },
|
||||
],
|
||||
Group: [
|
||||
{ name: 'members', type: 'Person[]' },
|
||||
{ name: 'owner', type: 'Person' },
|
||||
],
|
||||
Complex0: [
|
||||
{ name: 'data', type: 'string[][]' }, // Complex array type
|
||||
{ name: 'info', type: 'Mail' },
|
||||
],
|
||||
Complex1: [
|
||||
{ name: 'data', type: 'string[][][]' }, // Complex array type
|
||||
{ name: 'info', type: 'Mail' },
|
||||
],
|
||||
Complex: [
|
||||
{ name: 'data', type: 'string[][3][]' }, // Complex array type
|
||||
{ name: 'info', type: 'Mail' },
|
||||
],
|
||||
};
|
||||
assertType(1);
|
||||
assertType(1);
|
||||
assertType(1);
|
||||
assertType(1);
|
||||
assertType(1);
|
||||
assertType(1);
|
||||
const recursiveTypes = {
|
||||
Node: [
|
||||
{ name: 'value', type: 'string' },
|
||||
{ name: 'children', type: 'Node[]' },
|
||||
],
|
||||
};
|
||||
assertType(1);
|
||||
// const e = typed.encoder(types);
|
||||
// e.encodeData('Person', { name: 'test', wallet: 'x' });
|
||||
// e.sign({ primaryType: 'Person', message: { name: 'test', wallet: 'x' }, domain: {} }, '');
|
||||
// e.encodeData('Person', { name: 'test', wallet: 1n }); // should fail
|
||||
// e.sign({ primaryType: 'Person', message: {name: 'test'}, domain: {} }, ''); // should fail
|
||||
// e.sign({ primaryType: 'Person', message: {name: 'test', wallet: '', s: 3}, domain: {} }, ''); // should fail
|
||||
// constructor
|
||||
abi.deployContract([{ type: 'constructor', inputs: [], stateMutability: 'nonpayable' }], '0x00');
|
||||
abi.deployContract([{ type: 'constructor', stateMutability: 'nonpayable' }], '0x00');
|
||||
// abi.deployContract(
|
||||
// [{ type: 'constructor', stateMutability: 'nonpayable' }] as const,
|
||||
// '0x00',
|
||||
// undefined
|
||||
// ); // should fail!
|
||||
abi.deployContract([{ type: 'constructor', stateMutability: 'nonpayable' }], '0x00', undefined); // if we cannot infer type - it will be 'unknown' (and user forced to provide any argument, undefined is ok)
|
||||
abi.deployContract([
|
||||
{
|
||||
type: 'constructor',
|
||||
inputs: [{ name: 'a', type: 'uint256' }],
|
||||
stateMutability: 'nonpayable',
|
||||
},
|
||||
], '0x00', BigInt(100));
|
||||
abi.deployContract([
|
||||
{
|
||||
type: 'constructor',
|
||||
inputs: [{ name: 'a', type: 'uint256' }],
|
||||
stateMutability: 'nonpayable',
|
||||
},
|
||||
], '0x00', BigInt(100));
|
||||
//# sourceMappingURL=_type_test.js.map
|
||||
1
dev/env/node_modules/micro-eth-signer/_type_test.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/_type_test.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
5
dev/env/node_modules/micro-eth-signer/abi/common.d.ts
generated
vendored
Executable file
5
dev/env/node_modules/micro-eth-signer/abi/common.d.ts
generated
vendored
Executable file
@@ -0,0 +1,5 @@
|
||||
import type { ContractABI, HintFn, HookFn } from './decoder.ts';
|
||||
export declare function addHint<T extends ContractABI>(abi: ContractABI, name: string, fn: HintFn): T;
|
||||
export declare function addHints<T extends ContractABI>(abi: T, map: Record<string, HintFn>): T;
|
||||
export declare function addHook<T extends ContractABI>(abi: T, name: string, fn: HookFn): T;
|
||||
//# sourceMappingURL=common.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/abi/common.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/abi/common.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/abi/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEhE,wBAAgB,OAAO,CAAC,CAAC,SAAS,WAAW,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC,CAO5F;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAQtF;AAED,wBAAgB,OAAO,CAAC,CAAC,SAAS,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC,CAOlF"}
|
||||
37
dev/env/node_modules/micro-eth-signer/abi/common.js
generated
vendored
Executable file
37
dev/env/node_modules/micro-eth-signer/abi/common.js
generated
vendored
Executable file
@@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.addHint = addHint;
|
||||
exports.addHints = addHints;
|
||||
exports.addHook = addHook;
|
||||
function addHint(abi, name, fn) {
|
||||
const res = [];
|
||||
for (const elm of abi) {
|
||||
if (elm.name === name)
|
||||
res.push({ ...elm, hint: fn });
|
||||
else
|
||||
res.push(elm);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
function addHints(abi, map) {
|
||||
const res = [];
|
||||
for (const elm of abi) {
|
||||
if (['event', 'function'].includes(elm.type) && elm.name && map[elm.name]) {
|
||||
res.push({ ...elm, hint: map[elm.name] });
|
||||
}
|
||||
else
|
||||
res.push(elm);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
function addHook(abi, name, fn) {
|
||||
const res = [];
|
||||
for (const elm of abi) {
|
||||
if (elm.type === 'function' && elm.name === name)
|
||||
res.push({ ...elm, hook: fn });
|
||||
else
|
||||
res.push(elm);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
//# sourceMappingURL=common.js.map
|
||||
1
dev/env/node_modules/micro-eth-signer/abi/common.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/abi/common.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/abi/common.ts"],"names":[],"mappings":";;AAEA,0BAOC;AAED,4BAQC;AAED,0BAOC;AA1BD,SAAgB,OAAO,CAAwB,GAAgB,EAAE,IAAY,EAAE,EAAU;IACvF,MAAM,GAAG,GAAG,EAAE,CAAC;IACf,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI;YAAE,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;;YACjD,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,GAAmB,CAAC;AAC7B,CAAC;AAED,SAAgB,QAAQ,CAAwB,GAAM,EAAE,GAA2B;IACjF,MAAM,GAAG,GAAG,EAAE,CAAC;IACf,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1E,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,CAAC,CAAC;QAC7C,CAAC;;YAAM,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,GAAmB,CAAC;AAC7B,CAAC;AAED,SAAgB,OAAO,CAAwB,GAAM,EAAE,IAAY,EAAE,EAAU;IAC7E,MAAM,GAAG,GAAG,EAAE,CAAC;IACf,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,IAAI,GAAG,CAAC,IAAI,KAAK,UAAU,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI;YAAE,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;;YAC5E,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,GAAmB,CAAC;AAC7B,CAAC"}
|
||||
167
dev/env/node_modules/micro-eth-signer/abi/decoder.d.ts
generated
vendored
Executable file
167
dev/env/node_modules/micro-eth-signer/abi/decoder.d.ts
generated
vendored
Executable file
@@ -0,0 +1,167 @@
|
||||
import * as P from 'micro-packed';
|
||||
import { type IWeb3Provider } from '../utils.ts';
|
||||
type Writable<T> = T extends {} ? {
|
||||
-readonly [P in keyof T]: Writable<T[P]>;
|
||||
} : T;
|
||||
type ArrLike<T> = Array<T> | ReadonlyArray<T>;
|
||||
export type IsEmptyArray<T> = T extends ReadonlyArray<any> ? (T['length'] extends 0 ? true : false) : true;
|
||||
export type Component<T extends string> = {
|
||||
readonly name?: string;
|
||||
readonly type: T;
|
||||
};
|
||||
export type NamedComponent<T extends string> = Component<T> & {
|
||||
readonly name: string;
|
||||
};
|
||||
export type BaseComponent = Component<string>;
|
||||
export type Tuple<TC extends ArrLike<Component<string>>> = {
|
||||
readonly name?: string;
|
||||
readonly type: 'tuple';
|
||||
readonly components: TC;
|
||||
};
|
||||
type IntIdxType = '' | '8' | '16' | '24' | '32' | '40' | '48' | '56' | '64' | '72' | '80' | '88' | '96' | '104' | '112' | '120' | '128' | '136' | '144' | '152' | '160' | '168' | '176' | '184' | '192' | '200' | '208' | '216' | '224' | '232' | '240' | '248' | '256';
|
||||
type UintType = `uint${IntIdxType}`;
|
||||
type IntType = `int${IntIdxType}`;
|
||||
type NumberType = UintType | IntType;
|
||||
type ByteIdxType = '' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '13' | '14' | '15' | '16' | '17' | '18' | '19' | '20' | '21' | '22' | '23' | '24' | '25' | '26' | '27' | '28' | '29' | '30' | '31' | '32';
|
||||
type ByteType = `bytes${ByteIdxType}`;
|
||||
export type MapTuple<T> = T extends ArrLike<Component<string> & {
|
||||
name: string;
|
||||
}> ? {
|
||||
[K in T[number] as K['name']]: MapType<K>;
|
||||
} : T extends ArrLike<Component<string>> ? {
|
||||
[K in keyof T]: T[K] extends BaseComponent ? MapType<T[K]> : unknown;
|
||||
} : unknown;
|
||||
export type GetType<T extends string> = T extends `${infer Base}[]${infer Rest}` ? GetType<`${Base}${Rest}`>[] : T extends `${infer Base}[${number}]${infer Rest}` ? GetType<`${Base}${Rest}`>[] : T extends 'address' ? string : T extends 'string' ? string : T extends 'bool' ? boolean : T extends NumberType ? bigint : T extends ByteType ? Uint8Array : unknown;
|
||||
export type MapType<T extends BaseComponent> = T extends Tuple<Array<Component<string>>> ? MapTuple<T['components']> : T extends Component<infer Type> ? GetType<Type> : unknown;
|
||||
export type UnmapType<T> = T extends MapType<infer U> ? U : never;
|
||||
export declare function mapComponent<T extends BaseComponent>(c: T): P.CoderType<MapType<Writable<T>>>;
|
||||
export type ArgsType<T extends ReadonlyArray<any> | undefined> = IsEmptyArray<T> extends true ? undefined : T extends ReadonlyArray<any> ? T['length'] extends 1 ? MapType<T[0]> : MapTuple<T> : MapTuple<T>;
|
||||
export declare function mapArgs<T extends ArrLike<Component<string>>>(args: T): P.CoderType<ArgsType<Writable<T>>>;
|
||||
export type FunctionType = Component<'function'> & {
|
||||
readonly inputs?: ReadonlyArray<Component<string>>;
|
||||
readonly outputs?: ReadonlyArray<Component<string>>;
|
||||
};
|
||||
type ContractMethodDecode<T extends FunctionType, O = ArgsType<T['outputs']>> = IsEmptyArray<T['outputs']> extends true ? {
|
||||
decodeOutput: (b: Uint8Array) => void;
|
||||
} : {
|
||||
decodeOutput: (b: Uint8Array) => O;
|
||||
};
|
||||
type ContractMethodEncode<T extends FunctionType, I = ArgsType<T['inputs']>> = IsEmptyArray<T['inputs']> extends true ? {
|
||||
encodeInput: () => Uint8Array;
|
||||
} : {
|
||||
encodeInput: (v: I) => Uint8Array;
|
||||
};
|
||||
type ContractMethodGas<T extends FunctionType, I = ArgsType<T['inputs']>> = IsEmptyArray<T['inputs']> extends true ? {
|
||||
estimateGas: () => Promise<bigint>;
|
||||
} : {
|
||||
estimateGas: (v: I) => Promise<bigint>;
|
||||
};
|
||||
type ContractMethodCall<T extends FunctionType, I = ArgsType<T['inputs']>, O = ArgsType<T['outputs']>> = IsEmptyArray<T['inputs']> extends true ? IsEmptyArray<T['outputs']> extends true ? {
|
||||
call: () => Promise<void>;
|
||||
} : {
|
||||
call: () => Promise<O>;
|
||||
} : IsEmptyArray<T['outputs']> extends true ? {
|
||||
call: (v: I) => Promise<void>;
|
||||
} : {
|
||||
call: (v: I) => Promise<O>;
|
||||
};
|
||||
export type ContractMethod<T extends FunctionType> = ContractMethodEncode<T> & ContractMethodDecode<T>;
|
||||
export type ContractMethodNet<T extends FunctionType> = ContractMethod<T> & ContractMethodGas<T> & ContractMethodCall<T>;
|
||||
export type FnArg = {
|
||||
readonly type: string;
|
||||
readonly name?: string;
|
||||
readonly components?: ArrLike<FnArg>;
|
||||
readonly inputs?: ArrLike<FnArg>;
|
||||
readonly outputs?: ArrLike<FnArg>;
|
||||
readonly anonymous?: boolean;
|
||||
readonly indexed?: boolean;
|
||||
};
|
||||
export type ContractTypeFilter<T> = {
|
||||
[K in keyof T]: T[K] extends FunctionType & {
|
||||
name: string;
|
||||
} ? T[K] : never;
|
||||
};
|
||||
export type ContractType<T extends Array<FnArg>, N, F = ContractTypeFilter<T>> = F extends ArrLike<FunctionType & {
|
||||
name: string;
|
||||
}> ? {
|
||||
[K in F[number] as K['name']]: N extends IWeb3Provider ? ContractMethodNet<K> : ContractMethod<K>;
|
||||
} : never;
|
||||
export declare function evSigHash(o: FnArg): string;
|
||||
export declare function fnSigHash(o: FnArg): string;
|
||||
export declare function createContract<T extends ArrLike<FnArg>>(abi: T, net: IWeb3Provider, contract?: string): ContractType<Writable<T>, IWeb3Provider>;
|
||||
export declare function createContract<T extends ArrLike<FnArg>>(abi: T, net?: undefined, contract?: string): ContractType<Writable<T>, undefined>;
|
||||
type GetCons<T extends ArrLike<FnArg>> = Extract<T[number], {
|
||||
type: 'constructor';
|
||||
}>;
|
||||
type ConstructorType = Component<'constructor'> & {
|
||||
readonly inputs?: ReadonlyArray<Component<string>>;
|
||||
};
|
||||
type ConsArgs<T extends ConstructorType> = IsEmptyArray<T['inputs']> extends true ? undefined : ArgsType<T['inputs']>;
|
||||
export declare function deployContract<T extends ArrLike<FnArg>>(abi: T, bytecodeHex: string, ...args: GetCons<T> extends never ? [args: unknown] : ConsArgs<GetCons<T>> extends undefined ? [] : [args: ConsArgs<GetCons<T>>]): string;
|
||||
export type EventType = NamedComponent<'event'> & {
|
||||
readonly inputs: ReadonlyArray<Component<string>>;
|
||||
};
|
||||
export type ContractEventTypeFilter<T> = {
|
||||
[K in keyof T]: T[K] extends EventType ? T[K] : never;
|
||||
};
|
||||
export type TopicsValue<T> = {
|
||||
[K in keyof T]: T[K] | null;
|
||||
};
|
||||
export type EventMethod<T extends EventType> = {
|
||||
decode: (topics: string[], data: string) => ArgsType<T['inputs']>;
|
||||
topics: (values: TopicsValue<ArgsType<T['inputs']>>) => (string | null)[];
|
||||
};
|
||||
export type ContractEventType<T extends Array<FnArg>, F = ContractEventTypeFilter<T>> = F extends ArrLike<EventType> ? {
|
||||
[K in F[number] as K['name']]: EventMethod<K>;
|
||||
} : never;
|
||||
export declare function events<T extends ArrLike<FnArg>>(abi: T): ContractEventType<Writable<T>>;
|
||||
export type ContractABI = ReadonlyArray<FnArg & {
|
||||
readonly hint?: HintFn;
|
||||
readonly hook?: HookFn;
|
||||
}>;
|
||||
export type ContractInfo = {
|
||||
abi: 'ERC20' | 'ERC721' | 'ERC1155' | ContractABI;
|
||||
symbol?: string;
|
||||
decimals?: number;
|
||||
name?: string;
|
||||
price?: number;
|
||||
};
|
||||
export type HintOpt = {
|
||||
contract?: string;
|
||||
amount?: bigint;
|
||||
contractInfo?: ContractInfo;
|
||||
contracts?: Record<string, ContractInfo>;
|
||||
};
|
||||
export type HintFn = (value: unknown, opt: HintOpt) => string;
|
||||
export type HookFn = (decoder: Decoder, contract: string, info: SignatureInfo, opt: HintOpt) => SignatureInfo;
|
||||
type SignaturePacker = {
|
||||
name: string;
|
||||
signature: string;
|
||||
packer: P.CoderType<unknown>;
|
||||
hint?: HintFn;
|
||||
hook?: HookFn;
|
||||
};
|
||||
type EventSignatureDecoder = {
|
||||
name: string;
|
||||
signature: string;
|
||||
decoder: (topics: string[], _data: string) => unknown;
|
||||
hint?: HintFn;
|
||||
};
|
||||
export type SignatureInfo = {
|
||||
name: string;
|
||||
signature: string;
|
||||
value: unknown;
|
||||
hint?: string;
|
||||
};
|
||||
export declare class Decoder {
|
||||
contracts: Record<string, Record<string, SignaturePacker>>;
|
||||
sighashes: Record<string, SignaturePacker[]>;
|
||||
evContracts: Record<string, Record<string, EventSignatureDecoder>>;
|
||||
evSighashes: Record<string, EventSignatureDecoder[]>;
|
||||
add(contract: string, abi: ContractABI): void;
|
||||
method(contract: string, data: Uint8Array): string | undefined;
|
||||
decode(contract: string, _data: Uint8Array, opt: HintOpt): SignatureInfo | SignatureInfo[] | undefined;
|
||||
decodeEvent(contract: string, topics: string[], data: string, opt: HintOpt): SignatureInfo | SignatureInfo[] | undefined;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=decoder.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/abi/decoder.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/abi/decoder.d.ts.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
447
dev/env/node_modules/micro-eth-signer/abi/decoder.js
generated
vendored
Executable file
447
dev/env/node_modules/micro-eth-signer/abi/decoder.js
generated
vendored
Executable file
@@ -0,0 +1,447 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Decoder = void 0;
|
||||
exports.mapComponent = mapComponent;
|
||||
exports.mapArgs = mapArgs;
|
||||
exports.evSigHash = evSigHash;
|
||||
exports.fnSigHash = fnSigHash;
|
||||
exports.createContract = createContract;
|
||||
exports.deployContract = deployContract;
|
||||
exports.events = events;
|
||||
const sha3_1 = require("@noble/hashes/sha3");
|
||||
const utils_1 = require("@noble/hashes/utils");
|
||||
const P = require("micro-packed");
|
||||
const utils_ts_1 = require("../utils.js");
|
||||
/*
|
||||
There is NO network code in the file. However, a user can pass
|
||||
NetProvider instance to createContract, and the method would do
|
||||
network requests with the api.
|
||||
|
||||
There is some really crazy stuff going on here with Typescript types.
|
||||
*/
|
||||
function EPad(p) {
|
||||
return P.padLeft(32, p, P.ZeroPad);
|
||||
}
|
||||
// Main difference between regular array: length stored outside and offsets calculated without length
|
||||
function ethArray(inner) {
|
||||
return P.wrap({
|
||||
size: undefined,
|
||||
encodeStream: (w, value) => {
|
||||
U256BE_LEN.encodeStream(w, value.length);
|
||||
w.bytes(P.array(value.length, inner).encode(value));
|
||||
},
|
||||
decodeStream: (r) => P.array(U256BE_LEN.decodeStream(r), inner).decodeStream(r.offsetReader(r.pos)),
|
||||
});
|
||||
}
|
||||
const PTR = EPad(P.U32BE);
|
||||
const ARRAY_RE = /(.+)(\[(\d+)?\])$/; // TODO: is this correct?
|
||||
// Because u32 in eth is not real u32, just U256BE with limits...
|
||||
const ethInt = (bits, signed = false) => {
|
||||
if (!Number.isSafeInteger(bits) || bits <= 0 || bits % 8 !== 0 || bits > 256)
|
||||
throw new Error('ethInt: invalid numeric type');
|
||||
const _bits = BigInt(bits);
|
||||
const inner = P.bigint(32, false, signed);
|
||||
return P.validate(P.wrap({
|
||||
size: inner.size,
|
||||
encodeStream: (w, value) => inner.encodeStream(w, value),
|
||||
decodeStream: (r) => inner.decodeStream(r),
|
||||
}), (value) => {
|
||||
// TODO: validate useful for narrowing types, need to add support in types?
|
||||
if (typeof value === 'number')
|
||||
value = BigInt(value);
|
||||
P.utils.checkBounds(value, _bits, !!signed);
|
||||
return value;
|
||||
});
|
||||
};
|
||||
// Ugly hack, because tuple of pointers considered "dynamic" without any reason.
|
||||
function isDyn(args) {
|
||||
let res = false;
|
||||
if (Array.isArray(args)) {
|
||||
for (let arg of args)
|
||||
if (arg.size === undefined)
|
||||
res = true;
|
||||
}
|
||||
else {
|
||||
for (let arg in args)
|
||||
if (args[arg].size === undefined)
|
||||
res = true;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
// Re-use ptr for len. u32 should be enough.
|
||||
const U256BE_LEN = PTR;
|
||||
// NOTE: we need as const if we want to access string as values inside types :(
|
||||
function mapComponent(c) {
|
||||
// Arrays (should be first one, since recursive)
|
||||
let m;
|
||||
if ((m = ARRAY_RE.exec(c.type))) {
|
||||
const inner = mapComponent({ ...c, type: m[1] });
|
||||
if (inner.size === 0)
|
||||
throw new Error('mapComponent: arrays of zero-size elements disabled (possible DoS attack)');
|
||||
// Static array
|
||||
if (m[3] !== undefined) {
|
||||
const m3 = Number.parseInt(m[3]);
|
||||
if (!Number.isSafeInteger(m3))
|
||||
throw new Error(`mapComponent: wrong array size=${m[3]}`);
|
||||
let out = P.array(m3, inner);
|
||||
// Static array of dynamic values should be behind pointer too, again without reason.
|
||||
if (inner.size === undefined)
|
||||
out = P.pointer(PTR, out);
|
||||
return out;
|
||||
}
|
||||
else {
|
||||
// Dynamic array
|
||||
return P.pointer(PTR, ethArray(inner));
|
||||
}
|
||||
}
|
||||
if (c.type === 'tuple') {
|
||||
const components = c.components;
|
||||
let hasNames = true;
|
||||
const args = [];
|
||||
for (let comp of components) {
|
||||
if (!comp.name)
|
||||
hasNames = false;
|
||||
args.push(mapComponent(comp));
|
||||
}
|
||||
let out;
|
||||
// If there is names for all fields -- return struct, otherwise tuple
|
||||
if (hasNames) {
|
||||
const struct = {};
|
||||
for (const arg of components) {
|
||||
if (struct[arg.name])
|
||||
throw new Error(`mapType: same field name=${arg.name}`);
|
||||
struct[arg.name] = mapComponent(arg);
|
||||
}
|
||||
out = P.struct(struct);
|
||||
}
|
||||
else
|
||||
out = P.tuple(args);
|
||||
// If tuple has dynamic elements it becomes dynamic too, without reason.
|
||||
if (isDyn(args))
|
||||
out = P.pointer(PTR, out);
|
||||
return out;
|
||||
}
|
||||
if (c.type === 'string')
|
||||
return P.pointer(PTR, P.padRight(32, P.string(U256BE_LEN), P.ZeroPad));
|
||||
if (c.type === 'bytes')
|
||||
return P.pointer(PTR, P.padRight(32, P.bytes(U256BE_LEN), P.ZeroPad));
|
||||
if (c.type === 'address')
|
||||
return EPad(P.hex(20, { isLE: false, with0x: true }));
|
||||
if (c.type === 'bool')
|
||||
return EPad(P.bool);
|
||||
if ((m = /^(u?)int([0-9]+)?$/.exec(c.type)))
|
||||
return ethInt(m[2] ? +m[2] : 256, m[1] !== 'u');
|
||||
if ((m = /^bytes([0-9]{1,2})$/.exec(c.type))) {
|
||||
const parsed = +m[1];
|
||||
if (!parsed || parsed > 32)
|
||||
throw new Error('wrong bytes<N> type');
|
||||
return P.padRight(32, P.bytes(parsed), P.ZeroPad);
|
||||
}
|
||||
throw new Error(`mapComponent: unknown component=${c}`);
|
||||
}
|
||||
// Because args and output are not tuple
|
||||
// TODO: try merge with mapComponent
|
||||
function mapArgs(args) {
|
||||
// More ergonomic input/output
|
||||
if (args.length === 1)
|
||||
return mapComponent(args[0]);
|
||||
let hasNames = true;
|
||||
for (const arg of args)
|
||||
if (!arg.name)
|
||||
hasNames = false;
|
||||
if (hasNames) {
|
||||
const out = {};
|
||||
for (const arg of args) {
|
||||
const name = arg.name;
|
||||
if (out[name])
|
||||
throw new Error(`mapArgs: same field name=${name}`);
|
||||
out[name] = mapComponent(arg);
|
||||
}
|
||||
return P.struct(out);
|
||||
}
|
||||
else
|
||||
return P.tuple(args.map(mapComponent));
|
||||
}
|
||||
function fnSignature(o) {
|
||||
if (!o.type)
|
||||
throw new Error('ABI.fnSignature wrong argument');
|
||||
if (o.type === 'function' || o.type === 'event')
|
||||
return `${o.name || 'function'}(${(o.inputs || []).map((i) => fnSignature(i)).join(',')})`;
|
||||
if (o.type.startsWith('tuple')) {
|
||||
if (!o.components || !o.components.length)
|
||||
throw new Error('ABI.fnSignature wrong tuple');
|
||||
return `(${o.components.map((i) => fnSignature(i)).join(',')})${o.type.slice(5)}`;
|
||||
}
|
||||
return o.type;
|
||||
}
|
||||
// Function signature hash
|
||||
function evSigHash(o) {
|
||||
return (0, utils_1.bytesToHex)((0, sha3_1.keccak_256)(fnSignature(o)));
|
||||
}
|
||||
function fnSigHash(o) {
|
||||
return evSigHash(o).slice(0, 8);
|
||||
}
|
||||
function createContract(abi, net, contract) {
|
||||
// Find non-uniq function names so we can handle overloads
|
||||
let nameCnt = {};
|
||||
for (let fn of abi) {
|
||||
if (fn.type !== 'function')
|
||||
continue;
|
||||
const name = fn.name || 'function';
|
||||
if (!nameCnt[name])
|
||||
nameCnt[name] = 1;
|
||||
else
|
||||
nameCnt[name]++;
|
||||
}
|
||||
const res = {};
|
||||
for (let fn of abi) {
|
||||
if (fn.type !== 'function')
|
||||
continue;
|
||||
let name = fn.name || 'function';
|
||||
if (nameCnt[name] > 1)
|
||||
name = fnSignature(fn);
|
||||
const sh = fnSigHash(fn);
|
||||
const inputs = fn.inputs && fn.inputs.length ? mapArgs(fn.inputs) : undefined;
|
||||
const outputs = fn.outputs ? mapArgs(fn.outputs) : undefined;
|
||||
const decodeOutput = (b) => outputs && outputs.decode(b);
|
||||
const encodeInput = (v) => (0, utils_1.concatBytes)((0, utils_1.hexToBytes)(sh), inputs ? inputs.encode(v) : new Uint8Array());
|
||||
res[name] = { decodeOutput, encodeInput };
|
||||
// .call and .estimateGas call network, when net is available
|
||||
if (!net)
|
||||
continue;
|
||||
res[name].call = async (args, overrides = {}) => {
|
||||
if (!contract && !overrides.to)
|
||||
throw new Error('No contract address');
|
||||
const data = (0, utils_ts_1.add0x)((0, utils_1.bytesToHex)(encodeInput(args)));
|
||||
const callArgs = Object.assign({ to: contract, data }, overrides);
|
||||
return decodeOutput((0, utils_1.hexToBytes)((0, utils_ts_1.strip0x)(await net.ethCall(callArgs))));
|
||||
};
|
||||
res[name].estimateGas = async (args, overrides = {}) => {
|
||||
if (!contract && !overrides.to)
|
||||
throw new Error('No contract address');
|
||||
const data = (0, utils_ts_1.add0x)((0, utils_1.bytesToHex)(encodeInput(args)));
|
||||
const callArgs = Object.assign({ to: contract, data }, overrides);
|
||||
return await net.estimateGas(callArgs);
|
||||
};
|
||||
}
|
||||
return res;
|
||||
}
|
||||
function deployContract(abi, bytecodeHex, ...args) {
|
||||
const bytecode = utils_ts_1.ethHex.decode(bytecodeHex);
|
||||
let consCall;
|
||||
for (let fn of abi) {
|
||||
if (fn.type !== 'constructor')
|
||||
continue;
|
||||
const inputs = fn.inputs && fn.inputs.length ? mapArgs(fn.inputs) : undefined;
|
||||
if (inputs === undefined && args !== undefined && args.length)
|
||||
throw new Error('arguments to constructor without any');
|
||||
consCall = inputs ? inputs.encode(args[0]) : new Uint8Array();
|
||||
}
|
||||
if (!consCall)
|
||||
throw new Error('constructor not found');
|
||||
return utils_ts_1.ethHex.encode((0, utils_1.concatBytes)(bytecode, consCall));
|
||||
}
|
||||
// TODO: try to simplify further
|
||||
function events(abi) {
|
||||
let res = {};
|
||||
for (let elm of abi) {
|
||||
// Only named events supported
|
||||
if (elm.type !== 'event' || !elm.name)
|
||||
continue;
|
||||
const inputs = elm.inputs || [];
|
||||
let hasNames = true;
|
||||
for (let i of inputs)
|
||||
if (!i.name)
|
||||
hasNames = false;
|
||||
const plainInp = inputs.filter((i) => !i.indexed);
|
||||
const indexedInp = inputs.filter((i) => i.indexed);
|
||||
const indexed = indexedInp.map((i) => !['string', 'bytes', 'tuple'].includes(i.type) && !ARRAY_RE.exec(i.type)
|
||||
? mapArgs([i])
|
||||
: null);
|
||||
const parser = mapArgs(hasNames ? plainInp : plainInp.map((i) => (0, utils_ts_1.omit)(i, 'name')));
|
||||
const sigHash = evSigHash(elm);
|
||||
res[elm.name] = {
|
||||
decode(topics, _data) {
|
||||
const data = (0, utils_1.hexToBytes)((0, utils_ts_1.strip0x)(_data));
|
||||
if (!elm.anonymous) {
|
||||
if (!topics[0])
|
||||
throw new Error('No signature on non-anonymous event');
|
||||
if ((0, utils_ts_1.strip0x)(topics[0]).toLowerCase() !== sigHash)
|
||||
throw new Error('Wrong signature');
|
||||
topics = topics.slice(1);
|
||||
}
|
||||
if (topics.length !== indexed.length)
|
||||
throw new Error('Wrong topics length');
|
||||
let parsed = parser ? parser.decode(data) : hasNames ? {} : [];
|
||||
const indexedParsed = indexed.map((p, i) => p ? p.decode((0, utils_1.hexToBytes)((0, utils_ts_1.strip0x)(topics[i]))) : topics[i]);
|
||||
if (plainInp.length === 1)
|
||||
parsed = hasNames ? { [plainInp[0].name]: parsed } : [parsed];
|
||||
if (hasNames) {
|
||||
let res = { ...parsed };
|
||||
for (let [a, p] of (0, utils_ts_1.zip)(indexedInp, indexedParsed))
|
||||
res[a.name] = p;
|
||||
return res;
|
||||
}
|
||||
else
|
||||
return inputs.map((i) => (!i.indexed ? parsed : indexedParsed).shift());
|
||||
},
|
||||
topics(values) {
|
||||
let res = [];
|
||||
if (!elm.anonymous)
|
||||
res.push((0, utils_ts_1.add0x)(sigHash));
|
||||
// We require all keys to be set, even if they are null, to be sure nothing is accidentaly missed
|
||||
if ((hasNames ? Object.keys(values) : values).length !== inputs.length)
|
||||
throw new Error('Wrong topics args');
|
||||
for (let i = 0, ii = 0; i < inputs.length && ii < indexed.length; i++) {
|
||||
const [input, packer] = [inputs[i], indexed[ii]];
|
||||
if (!input.indexed)
|
||||
continue;
|
||||
const value = values[Array.isArray(values) ? i : inputs[i].name];
|
||||
if (value === null) {
|
||||
res.push(null);
|
||||
continue;
|
||||
}
|
||||
let topic;
|
||||
if (packer)
|
||||
topic = (0, utils_1.bytesToHex)(packer.encode(value));
|
||||
else if (['string', 'bytes'].includes(input.type))
|
||||
topic = (0, utils_1.bytesToHex)((0, sha3_1.keccak_256)(value));
|
||||
else {
|
||||
let m, parts;
|
||||
if ((m = ARRAY_RE.exec(input.type)))
|
||||
parts = value.map((j) => mapComponent({ type: m[1] }).encode(j));
|
||||
else if (input.type === 'tuple' && input.components)
|
||||
parts = input.components.map((j) => mapArgs([j]).encode(value[j.name]));
|
||||
else
|
||||
throw new Error('Unknown unsized type');
|
||||
topic = (0, utils_1.bytesToHex)((0, sha3_1.keccak_256)((0, utils_1.concatBytes)(...parts)));
|
||||
}
|
||||
res.push((0, utils_ts_1.add0x)(topic));
|
||||
ii++;
|
||||
}
|
||||
return res;
|
||||
},
|
||||
};
|
||||
}
|
||||
return res;
|
||||
}
|
||||
class Decoder {
|
||||
constructor() {
|
||||
this.contracts = {};
|
||||
this.sighashes = {};
|
||||
this.evContracts = {};
|
||||
this.evSighashes = {};
|
||||
}
|
||||
add(contract, abi) {
|
||||
const ev = events(abi);
|
||||
contract = (0, utils_ts_1.strip0x)(contract).toLowerCase();
|
||||
if (!this.contracts[contract])
|
||||
this.contracts[contract] = {};
|
||||
if (!this.evContracts[contract])
|
||||
this.evContracts[contract] = {};
|
||||
for (let fn of abi) {
|
||||
if (fn.type === 'function') {
|
||||
const selector = fnSigHash(fn);
|
||||
const value = {
|
||||
name: fn.name || 'function',
|
||||
signature: fnSignature(fn),
|
||||
packer: fn.inputs && fn.inputs.length ? mapArgs(fn.inputs) : undefined,
|
||||
hint: fn.hint,
|
||||
hook: fn.hook,
|
||||
};
|
||||
this.contracts[contract][selector] = value;
|
||||
if (!this.sighashes[selector])
|
||||
this.sighashes[selector] = [];
|
||||
this.sighashes[selector].push(value);
|
||||
}
|
||||
else if (fn.type === 'event') {
|
||||
if (fn.anonymous || !fn.name)
|
||||
continue;
|
||||
const selector = evSigHash(fn);
|
||||
const value = {
|
||||
name: fn.name,
|
||||
signature: fnSignature(fn),
|
||||
decoder: ev[fn.name]?.decode,
|
||||
hint: fn.hint,
|
||||
};
|
||||
this.evContracts[contract][selector] = value;
|
||||
if (!this.evSighashes[selector])
|
||||
this.evSighashes[selector] = [];
|
||||
this.evSighashes[selector].push(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
method(contract, data) {
|
||||
contract = (0, utils_ts_1.strip0x)(contract).toLowerCase();
|
||||
const sh = (0, utils_1.bytesToHex)(data.slice(0, 4));
|
||||
if (!this.contracts[contract] || !this.contracts[contract][sh])
|
||||
return;
|
||||
const { name } = this.contracts[contract][sh];
|
||||
return name;
|
||||
}
|
||||
// Returns: exact match, possible options of matches (array) or undefined.
|
||||
// Note that empty value possible if there is no arguments in call.
|
||||
decode(contract, _data, opt) {
|
||||
contract = (0, utils_ts_1.strip0x)(contract).toLowerCase();
|
||||
const sh = (0, utils_1.bytesToHex)(_data.slice(0, 4));
|
||||
const data = _data.slice(4);
|
||||
if (this.contracts[contract] && this.contracts[contract][sh]) {
|
||||
let { name, signature, packer, hint, hook } = this.contracts[contract][sh];
|
||||
const value = packer ? packer.decode(data) : undefined;
|
||||
let res = { name, signature, value };
|
||||
// NOTE: hint && hook fn is used only on exact match of contract!
|
||||
if (hook)
|
||||
res = hook(this, contract, res, opt);
|
||||
try {
|
||||
if (hint)
|
||||
res.hint = hint(value, Object.assign({ contract: (0, utils_ts_1.add0x)(contract) }, opt));
|
||||
}
|
||||
catch (e) { }
|
||||
return res;
|
||||
}
|
||||
if (!this.sighashes[sh] || !this.sighashes[sh].length)
|
||||
return;
|
||||
let res = [];
|
||||
for (let { name, signature, packer } of this.sighashes[sh]) {
|
||||
try {
|
||||
res.push({ name, signature, value: packer ? packer.decode(data) : undefined });
|
||||
}
|
||||
catch (err) { }
|
||||
}
|
||||
if (res.length)
|
||||
return res;
|
||||
return;
|
||||
}
|
||||
decodeEvent(contract, topics, data, opt) {
|
||||
contract = (0, utils_ts_1.strip0x)(contract).toLowerCase();
|
||||
if (!topics.length)
|
||||
return;
|
||||
const sh = (0, utils_ts_1.strip0x)(topics[0]);
|
||||
const event = this.evContracts[contract];
|
||||
if (event && event[sh]) {
|
||||
let { name, signature, decoder, hint } = event[sh];
|
||||
const value = decoder(topics, data);
|
||||
let res = { name, signature, value };
|
||||
try {
|
||||
if (hint)
|
||||
res.hint = hint(value, Object.assign({ contract: (0, utils_ts_1.add0x)(contract) }, opt));
|
||||
}
|
||||
catch (e) { }
|
||||
return res;
|
||||
}
|
||||
if (!this.evSighashes[sh] || !this.evSighashes[sh].length)
|
||||
return;
|
||||
let res = [];
|
||||
for (let { name, signature, decoder } of this.evSighashes[sh]) {
|
||||
try {
|
||||
res.push({ name, signature, value: decoder(topics, data) });
|
||||
}
|
||||
catch (err) { }
|
||||
}
|
||||
if (res.length)
|
||||
return res;
|
||||
return;
|
||||
}
|
||||
}
|
||||
exports.Decoder = Decoder;
|
||||
//# sourceMappingURL=decoder.js.map
|
||||
1
dev/env/node_modules/micro-eth-signer/abi/decoder.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/abi/decoder.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
189
dev/env/node_modules/micro-eth-signer/abi/erc1155.d.ts
generated
vendored
Executable file
189
dev/env/node_modules/micro-eth-signer/abi/erc1155.d.ts
generated
vendored
Executable file
@@ -0,0 +1,189 @@
|
||||
declare const ABI: readonly [{
|
||||
readonly name: "ApprovalForAll";
|
||||
readonly type: "event";
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "account";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "operator";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "approved";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "TransferBatch";
|
||||
readonly type: "event";
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "operator";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "ids";
|
||||
readonly type: "uint256[]";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "values";
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "TransferSingle";
|
||||
readonly type: "event";
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "operator";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "id";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "URI";
|
||||
readonly type: "event";
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: false;
|
||||
readonly name: "value";
|
||||
readonly type: "string";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "id";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "balanceOf";
|
||||
readonly type: "function";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "account";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "id";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "balanceOfBatch";
|
||||
readonly type: "function";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "accounts";
|
||||
readonly type: "address[]";
|
||||
}, {
|
||||
readonly name: "ids";
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "isApprovedForAll";
|
||||
readonly type: "function";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "account";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "operator";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "safeBatchTransferFrom";
|
||||
readonly type: "function";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "ids";
|
||||
readonly type: "uint256[]";
|
||||
}, {
|
||||
readonly name: "amounts";
|
||||
readonly type: "uint256[]";
|
||||
}, {
|
||||
readonly name: "data";
|
||||
readonly type: "bytes";
|
||||
}];
|
||||
readonly outputs: readonly [];
|
||||
}, {
|
||||
readonly name: "safeTransferFrom";
|
||||
readonly type: "function";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "id";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "amount";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "data";
|
||||
readonly type: "bytes";
|
||||
}];
|
||||
readonly outputs: readonly [];
|
||||
}, {
|
||||
readonly name: "setApprovalForAll";
|
||||
readonly type: "function";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "operator";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "approved";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
readonly outputs: readonly [];
|
||||
}, {
|
||||
readonly name: "supportsInterface";
|
||||
readonly type: "function";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "interfaceId";
|
||||
readonly type: "bytes4";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "uri";
|
||||
readonly type: "function";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "id";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "string";
|
||||
}];
|
||||
}];
|
||||
export default ABI;
|
||||
//# sourceMappingURL=erc1155.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/abi/erc1155.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/abi/erc1155.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"erc1155.d.ts","sourceRoot":"","sources":["../src/abi/erc1155.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEC,CAAC;AAEX,eAAe,GAAG,CAAC"}
|
||||
9
dev/env/node_modules/micro-eth-signer/abi/erc1155.js
generated
vendored
Executable file
9
dev/env/node_modules/micro-eth-signer/abi/erc1155.js
generated
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// Multi Token Standard https://eips.ethereum.org/EIPS/eip-1155
|
||||
// prettier-ignore
|
||||
const ABI = [
|
||||
{ name: 'ApprovalForAll', type: 'event', inputs: [{ indexed: true, name: 'account', type: 'address' }, { indexed: true, name: 'operator', type: 'address' }, { indexed: false, name: 'approved', type: 'bool' },], }, { name: 'TransferBatch', type: 'event', inputs: [{ indexed: true, name: 'operator', type: 'address' }, { indexed: true, name: 'from', type: 'address' }, { indexed: true, name: 'to', type: 'address' }, { indexed: false, name: 'ids', type: 'uint256[]' }, { indexed: false, name: 'values', type: 'uint256[]' },], }, { name: 'TransferSingle', type: 'event', inputs: [{ indexed: true, name: 'operator', type: 'address' }, { indexed: true, name: 'from', type: 'address' }, { indexed: true, name: 'to', type: 'address' }, { indexed: false, name: 'id', type: 'uint256' }, { indexed: false, name: 'value', type: 'uint256' },], }, { name: 'URI', type: 'event', inputs: [{ indexed: false, name: 'value', type: 'string' }, { indexed: true, name: 'id', type: 'uint256' },], }, { name: 'balanceOf', type: 'function', inputs: [{ name: 'account', type: 'address' }, { name: 'id', type: 'uint256' },], outputs: [{ type: 'uint256' }], }, { name: 'balanceOfBatch', type: 'function', inputs: [{ name: 'accounts', type: 'address[]' }, { name: 'ids', type: 'uint256[]' },], outputs: [{ type: 'uint256[]' }], }, { name: 'isApprovedForAll', type: 'function', inputs: [{ name: 'account', type: 'address' }, { name: 'operator', type: 'address' },], outputs: [{ type: 'bool' }], }, { name: 'safeBatchTransferFrom', type: 'function', inputs: [{ name: 'from', type: 'address' }, { name: 'to', type: 'address' }, { name: 'ids', type: 'uint256[]' }, { name: 'amounts', type: 'uint256[]' }, { name: 'data', type: 'bytes' },], outputs: [], }, { name: 'safeTransferFrom', type: 'function', inputs: [{ name: 'from', type: 'address' }, { name: 'to', type: 'address' }, { name: 'id', type: 'uint256' }, { name: 'amount', type: 'uint256' }, { name: 'data', type: 'bytes' },], outputs: [], }, { name: 'setApprovalForAll', type: 'function', inputs: [{ name: 'operator', type: 'address' }, { name: 'approved', type: 'bool' },], outputs: [], }, { name: 'supportsInterface', type: 'function', inputs: [{ name: 'interfaceId', type: 'bytes4' }], outputs: [{ type: 'bool' }], }, { name: 'uri', type: 'function', inputs: [{ name: 'id', type: 'uint256' }], outputs: [{ type: 'string' }] }
|
||||
];
|
||||
exports.default = ABI;
|
||||
//# sourceMappingURL=erc1155.js.map
|
||||
1
dev/env/node_modules/micro-eth-signer/abi/erc1155.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/abi/erc1155.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"erc1155.js","sourceRoot":"","sources":["../src/abi/erc1155.ts"],"names":[],"mappings":";;AAAA,+DAA+D;AAC/D,kBAAkB;AAClB,MAAM,GAAG,GAAG;IACV,EAAC,IAAI,EAAC,gBAAgB,EAAC,IAAI,EAAC,OAAO,EAAC,MAAM,EAAC,CAAC,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,OAAO,EAAC,KAAK,EAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,MAAM,EAAC,EAAE,GAAE,EAAC,EAAC,IAAI,EAAC,eAAe,EAAC,IAAI,EAAC,OAAO,EAAC,MAAM,EAAC,CAAC,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,OAAO,EAAC,KAAK,EAAC,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,WAAW,EAAC,EAAC,EAAC,OAAO,EAAC,KAAK,EAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,WAAW,EAAC,EAAE,GAAE,EAAC,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,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,MAAM,EAAC,EAAE,EAAC,OAAO,EAAC,EAAE,GAAE,EAAC,EAAC,IAAI,EAAC,mBAAmB,EAAC,IAAI,EAAC,UAAU,EAAC,MAAM,EAAC,CAAC,EAAC,IAAI,EAAC,aAAa,EAAC,IAAI,EAAC,QAAQ,EAAC,CAAC,EAAC,OAAO,EAAC,CAAC,EAAC,IAAI,EAAC,MAAM,EAAC,CAAC,GAAE,EAAC,EAAC,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,UAAU,EAAC,MAAM,EAAC,CAAC,EAAC,IAAI,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,CAAC,EAAC,OAAO,EAAC,CAAC,EAAC,IAAI,EAAC,QAAQ,EAAC,CAAC,EAAC;CACx8D,CAAC;AAEX,kBAAe,GAAG,CAAC"}
|
||||
308
dev/env/node_modules/micro-eth-signer/abi/erc20.d.ts
generated
vendored
Executable file
308
dev/env/node_modules/micro-eth-signer/abi/erc20.d.ts
generated
vendored
Executable file
@@ -0,0 +1,308 @@
|
||||
import { type HintOpt } from './decoder.ts';
|
||||
export declare const ABI: readonly [{
|
||||
readonly type: "function";
|
||||
readonly name: "name";
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "string";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "totalSupply";
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "decimals";
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint8";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "symbol";
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "string";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "approve";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "spender";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "success";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "transferFrom";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "success";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "balances";
|
||||
readonly inputs: readonly [{
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "allowed";
|
||||
readonly inputs: readonly [{
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "balanceOf";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "balance";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "transfer";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "success";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "allowance";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "spender";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "remaining";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "Approval";
|
||||
readonly type: "event";
|
||||
readonly anonymous: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "spender";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "Transfer";
|
||||
readonly type: "event";
|
||||
readonly anonymous: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}];
|
||||
export declare const hints: {
|
||||
approve(v: any, opt: HintOpt): string;
|
||||
transferFrom(v: any, opt: HintOpt): string;
|
||||
transfer(v: any, opt: HintOpt): string;
|
||||
Approval(v: any, opt: HintOpt): string;
|
||||
Transfer(v: any, opt: HintOpt): string;
|
||||
};
|
||||
declare const ERC20ABI: readonly [{
|
||||
readonly type: "function";
|
||||
readonly name: "name";
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "string";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "totalSupply";
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "decimals";
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint8";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "symbol";
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "string";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "approve";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "spender";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "success";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "transferFrom";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "success";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "balances";
|
||||
readonly inputs: readonly [{
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "allowed";
|
||||
readonly inputs: readonly [{
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "balanceOf";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "balance";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "transfer";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "success";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "allowance";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "spender";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "remaining";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "Approval";
|
||||
readonly type: "event";
|
||||
readonly anonymous: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "spender";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "Transfer";
|
||||
readonly type: "event";
|
||||
readonly anonymous: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}];
|
||||
export default ERC20ABI;
|
||||
//# sourceMappingURL=erc20.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/abi/erc20.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/abi/erc20.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"erc20.d.ts","sourceRoot":"","sources":["../src/abi/erc20.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEN,CAAC;AAGX,eAAO,MAAM,KAAK;eACL,GAAG,OAAO,OAAO;oBAQZ,GAAG,OAAO,OAAO;gBAQrB,GAAG,OAAO,OAAO;gBAOjB,GAAG,OAAO,OAAO;gBAOjB,GAAG,OAAO,OAAO;CAO9B,CAAC;AAEF,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAuC,CAAC;AACtD,eAAe,QAAQ,CAAC"}
|
||||
40
dev/env/node_modules/micro-eth-signer/abi/erc20.js
generated
vendored
Executable file
40
dev/env/node_modules/micro-eth-signer/abi/erc20.js
generated
vendored
Executable file
@@ -0,0 +1,40 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hints = exports.ABI = void 0;
|
||||
const utils_ts_1 = require("../utils.js");
|
||||
const common_ts_1 = require("./common.js");
|
||||
// prettier-ignore
|
||||
exports.ABI = [
|
||||
{ type: "function", name: "name", outputs: [{ type: "string" }] }, { type: "function", name: "totalSupply", outputs: [{ type: "uint256" }] }, { type: "function", name: "decimals", outputs: [{ type: "uint8" }] }, { type: "function", name: "symbol", outputs: [{ type: "string" }] }, { type: "function", name: "approve", inputs: [{ name: "spender", type: "address" }, { name: "value", type: "uint256" }], outputs: [{ name: "success", type: "bool" }] }, { type: "function", name: "transferFrom", inputs: [{ name: "from", type: "address" }, { name: "to", type: "address" }, { name: "value", type: "uint256" }], outputs: [{ name: "success", type: "bool" }] }, { type: "function", name: "balances", inputs: [{ type: "address" }], outputs: [{ type: "uint256" }] }, { type: "function", name: "allowed", inputs: [{ type: "address" }, { type: "address" }], outputs: [{ type: "uint256" }] }, { type: "function", name: "balanceOf", inputs: [{ name: "owner", type: "address" }], outputs: [{ name: "balance", type: "uint256" }] }, { type: "function", name: "transfer", inputs: [{ name: "to", type: "address" }, { name: "value", type: "uint256" }], outputs: [{ name: "success", type: "bool" }] }, { type: "function", name: "allowance", inputs: [{ name: "owner", type: "address" }, { name: "spender", type: "address" }], outputs: [{ name: "remaining", type: "uint256" }] }, { name: "Approval", type: "event", anonymous: false, inputs: [{ indexed: true, name: "owner", type: "address" }, { indexed: true, name: "spender", type: "address" }, { indexed: false, name: "value", type: "uint256" }] }, { name: "Transfer", type: "event", anonymous: false, inputs: [{ indexed: true, name: "from", type: "address" }, { indexed: true, name: "to", type: "address" }, { indexed: false, name: "value", type: "uint256" }] }
|
||||
];
|
||||
// https://eips.ethereum.org/EIPS/eip-20
|
||||
exports.hints = {
|
||||
approve(v, opt) {
|
||||
if (!opt.contractInfo || !opt.contractInfo.decimals || !opt.contractInfo.symbol)
|
||||
throw new Error('Not enough info');
|
||||
return `Allow spending ${(0, utils_ts_1.createDecimal)(opt.contractInfo.decimals).encode(v.value)} ${opt.contractInfo.symbol} by ${v.spender}`;
|
||||
},
|
||||
transferFrom(v, opt) {
|
||||
if (!opt.contractInfo || !opt.contractInfo.decimals || !opt.contractInfo.symbol)
|
||||
throw new Error('Not enough info');
|
||||
return `Transfer ${(0, utils_ts_1.createDecimal)(opt.contractInfo.decimals).encode(v.value)} ${opt.contractInfo.symbol} from ${v.from} to ${v.to}`;
|
||||
},
|
||||
transfer(v, opt) {
|
||||
if (!opt.contractInfo || !opt.contractInfo.decimals || !opt.contractInfo.symbol)
|
||||
throw new Error('Not enough info');
|
||||
return `Transfer ${(0, utils_ts_1.createDecimal)(opt.contractInfo.decimals).encode(v.value)} ${opt.contractInfo.symbol} to ${v.to}`;
|
||||
},
|
||||
Approval(v, opt) {
|
||||
if (!opt.contractInfo || !opt.contractInfo.decimals || !opt.contractInfo.symbol)
|
||||
throw new Error('Not enough info');
|
||||
return `Allow ${v.spender} spending up to ${(0, utils_ts_1.createDecimal)(opt.contractInfo.decimals).encode(v.value)} ${opt.contractInfo.symbol} from ${v.owner}`;
|
||||
},
|
||||
Transfer(v, opt) {
|
||||
if (!opt.contractInfo || !opt.contractInfo.decimals || !opt.contractInfo.symbol)
|
||||
throw new Error('Not enough info');
|
||||
return `Transfer ${(0, utils_ts_1.createDecimal)(opt.contractInfo.decimals).encode(v.value)} ${opt.contractInfo.symbol} from ${v.from} to ${v.to}`;
|
||||
},
|
||||
};
|
||||
const ERC20ABI = /* @__PURE__ */ (0, common_ts_1.addHints)(exports.ABI, exports.hints);
|
||||
exports.default = ERC20ABI;
|
||||
//# sourceMappingURL=erc20.js.map
|
||||
1
dev/env/node_modules/micro-eth-signer/abi/erc20.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/abi/erc20.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"erc20.js","sourceRoot":"","sources":["../src/abi/erc20.ts"],"names":[],"mappings":";;;AAAA,0CAA4C;AAC5C,2CAAuC;AAGvC,kBAAkB;AACL,QAAA,GAAG,GAAG;IACjB,EAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAC,CAAC,EAAC,IAAI,EAAC,QAAQ,EAAC,CAAC,EAAC,EAAC,EAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,aAAa,EAAC,OAAO,EAAC,CAAC,EAAC,IAAI,EAAC,SAAS,EAAC,CAAC,EAAC,EAAC,EAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,UAAU,EAAC,OAAO,EAAC,CAAC,EAAC,IAAI,EAAC,OAAO,EAAC,CAAC,EAAC,EAAC,EAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,CAAC,EAAC,IAAI,EAAC,QAAQ,E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i/erc721.d.ts
generated
vendored
Executable file
220
dev/env/node_modules/micro-eth-signer/abi/erc721.d.ts
generated
vendored
Executable file
@@ -0,0 +1,220 @@
|
||||
declare const ABI: readonly [{
|
||||
readonly type: "function";
|
||||
readonly name: "approve";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "approved";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "tokenId";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "balanceOf";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "ownerOf";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "tokenId";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "getApproved";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "tokenId";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "address";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "isApprovedForAll";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "operator";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "safeTransferFrom";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "tokenId";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "safeTransferFrom";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "tokenId";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "data";
|
||||
readonly type: "bytes";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "setApprovalForAll";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "operator";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "approved";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "supportsInterface";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "interfaceID";
|
||||
readonly type: "bytes4";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "transferFrom";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "tokenId";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "tokenByIndex";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "index";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "tokenOfOwnerByIndex";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "index";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "totalSupply";
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "name";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "name";
|
||||
readonly type: "string";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "symbol";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "symbol";
|
||||
readonly type: "string";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "tokenURI";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "tokenId";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "string";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "Transfer";
|
||||
readonly type: "event";
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "tokenId";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "Approval";
|
||||
readonly type: "event";
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "spender";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "tokenId";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "ApprovalForAll";
|
||||
readonly type: "event";
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "spender";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "approved";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}];
|
||||
export default ABI;
|
||||
//# sourceMappingURL=erc721.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/abi/erc721.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/abi/erc721.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"erc721.d.ts","sourceRoot":"","sources":["../src/abi/erc721.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEC,CAAC;AAEX,eAAe,GAAG,CAAC"}
|
||||
9
dev/env/node_modules/micro-eth-signer/abi/erc721.js
generated
vendored
Executable file
9
dev/env/node_modules/micro-eth-signer/abi/erc721.js
generated
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// Non-Fungible Token Standard: https://eips.ethereum.org/EIPS/eip-721
|
||||
// prettier-ignore
|
||||
const ABI = [
|
||||
{ type: "function", name: "approve", inputs: [{ name: "approved", type: "address" }, { name: "tokenId", type: "uint256" }] }, { type: "function", name: "balanceOf", inputs: [{ name: "owner", type: "address" }], outputs: [{ type: "uint256" }] }, { type: "function", name: "ownerOf", inputs: [{ name: "tokenId", type: "uint256" }], outputs: [{ name: "owner", type: "address" }] }, { type: "function", name: "getApproved", inputs: [{ name: "tokenId", type: "uint256" }], outputs: [{ type: "address" }] }, { type: "function", name: "isApprovedForAll", inputs: [{ name: "owner", type: "address" }, { name: "operator", type: "address" }], outputs: [{ type: "bool" }] }, { type: "function", name: "safeTransferFrom", inputs: [{ name: "from", type: "address" }, { name: "to", type: "address" }, { name: "tokenId", type: "uint256" }] }, { type: "function", name: "safeTransferFrom", inputs: [{ name: "from", type: "address" }, { name: "to", type: "address" }, { name: "tokenId", type: "uint256" }, { name: "data", type: "bytes" }] }, { type: "function", name: "setApprovalForAll", inputs: [{ name: "operator", type: "address" }, { name: "approved", type: "bool" }] }, { type: "function", name: "supportsInterface", inputs: [{ name: "interfaceID", type: "bytes4" }], outputs: [{ type: "bool" }] }, { type: "function", name: "transferFrom", inputs: [{ name: "from", type: "address" }, { name: "to", type: "address" }, { name: "tokenId", type: "uint256" }] }, { type: "function", name: "tokenByIndex", inputs: [{ name: "index", type: "uint256" }], outputs: [{ type: "uint256" }] }, { type: "function", name: "tokenOfOwnerByIndex", inputs: [{ name: "owner", type: "address" }, { name: "index", type: "uint256" }], outputs: [{ type: "uint256" }] }, { type: "function", name: "totalSupply", outputs: [{ type: "uint256" }] }, { type: "function", name: "name", outputs: [{ name: "name", type: "string" }] }, { type: "function", name: "symbol", outputs: [{ name: "symbol", type: "string" }] }, { type: "function", name: "tokenURI", inputs: [{ name: "tokenId", type: "uint256" }], outputs: [{ type: "string" }] }, { name: "Transfer", type: "event", inputs: [{ indexed: true, name: "from", type: "address" }, { indexed: true, name: "to", type: "address" }, { indexed: true, name: "tokenId", type: "uint256" }] }, { name: "Approval", type: "event", inputs: [{ indexed: true, name: "owner", type: "address" }, { indexed: true, name: "spender", type: "address" }, { indexed: true, name: "tokenId", type: "uint256" }] }, { name: "ApprovalForAll", type: "event", inputs: [{ indexed: true, name: "owner", type: "address" }, { indexed: true, name: "spender", type: "address" }, { indexed: false, name: "approved", type: "bool" }] }
|
||||
];
|
||||
exports.default = ABI;
|
||||
//# sourceMappingURL=erc721.js.map
|
||||
1
dev/env/node_modules/micro-eth-signer/abi/erc721.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/abi/erc721.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3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AAI,EAAC,MAAM,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,IAAI,EAAC,SAAS,EAAC,CAAC,EAAC,EAAC,EAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,OAAO,EAAC,MAAM,EAAC,CAAC,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,IAAI,EAAC,SAAS,EAAC,CAAC,EAAC,EAAC,EAAC,IAAI,EAAC,gBAAgB,EAAC,IAAI,EAAC,OAAO,EAAC,MAAM,EAAC,CAAC,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,OAAO,EAAC,KAAK,EAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,MAAM,EAAC,CAAC,EAAC;CAClvE,CAAC;AAEX,kBAAe,GAAG,CAAC"}
|
||||
24
dev/env/node_modules/micro-eth-signer/abi/index.d.ts
generated
vendored
Executable file
24
dev/env/node_modules/micro-eth-signer/abi/index.d.ts
generated
vendored
Executable file
@@ -0,0 +1,24 @@
|
||||
import { type ContractABI, type ContractInfo, Decoder, createContract, deployContract, events } from './decoder.ts';
|
||||
import { default as ERC1155 } from './erc1155.ts';
|
||||
import { default as ERC20 } from './erc20.ts';
|
||||
import { default as ERC721 } from './erc721.ts';
|
||||
import { KYBER_NETWORK_PROXY_CONTRACT } from './kyber.ts';
|
||||
import { UNISWAP_V2_ROUTER_CONTRACT } from './uniswap-v2.ts';
|
||||
import { UNISWAP_V3_ROUTER_CONTRACT } from './uniswap-v3.ts';
|
||||
import { default as WETH } from './weth.ts';
|
||||
export { ERC1155, ERC20, ERC721, KYBER_NETWORK_PROXY_CONTRACT, UNISWAP_V2_ROUTER_CONTRACT, UNISWAP_V3_ROUTER_CONTRACT, WETH, };
|
||||
export { Decoder, createContract, deployContract, events };
|
||||
export type { ContractABI, ContractInfo };
|
||||
export declare const TOKENS: Record<string, ContractInfo>;
|
||||
export declare const CONTRACTS: Record<string, ContractInfo>;
|
||||
export declare const tokenFromSymbol: (symbol: string) => {
|
||||
contract: string;
|
||||
} & ContractInfo;
|
||||
export type DecoderOpt = {
|
||||
customContracts?: Record<string, ContractInfo>;
|
||||
noDefault?: boolean;
|
||||
};
|
||||
export declare const decodeData: (to: string, data: string, amount?: bigint, opt?: DecoderOpt) => import("./decoder.ts").SignatureInfo | import("./decoder.ts").SignatureInfo[] | undefined;
|
||||
export declare const decodeTx: (transaction: string, opt?: DecoderOpt) => import("./decoder.ts").SignatureInfo | import("./decoder.ts").SignatureInfo[] | undefined;
|
||||
export declare const decodeEvent: (to: string, topics: string[], data: string, opt?: DecoderOpt) => import("./decoder.ts").SignatureInfo | import("./decoder.ts").SignatureInfo[] | undefined;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/abi/index.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/abi/index.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/abi/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,OAAO,EACP,cAAc,EACd,cAAc,EACd,MAAM,EACP,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAA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AI,IAAI,MAAM,EAAE,QAAQ,MAAM,EAAE,EAAE,MAAM,MAAM,EAAE,MAAK,UAAe,8FAS3F,CAAC"}
|
||||
141
dev/env/node_modules/micro-eth-signer/abi/index.js
generated
vendored
Executable file
141
dev/env/node_modules/micro-eth-signer/abi/index.js
generated
vendored
Executable file
@@ -0,0 +1,141 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.decodeEvent = exports.decodeTx = exports.decodeData = exports.tokenFromSymbol = exports.CONTRACTS = exports.TOKENS = exports.events = exports.deployContract = exports.createContract = exports.Decoder = exports.WETH = exports.UNISWAP_V3_ROUTER_CONTRACT = exports.UNISWAP_V2_ROUTER_CONTRACT = exports.KYBER_NETWORK_PROXY_CONTRACT = exports.ERC721 = exports.ERC20 = exports.ERC1155 = void 0;
|
||||
const address_ts_1 = require("../address.js");
|
||||
const index_ts_1 = require("../index.js");
|
||||
const utils_ts_1 = require("../utils.js");
|
||||
const decoder_ts_1 = require("./decoder.js");
|
||||
Object.defineProperty(exports, "Decoder", { enumerable: true, get: function () { return decoder_ts_1.Decoder; } });
|
||||
Object.defineProperty(exports, "createContract", { enumerable: true, get: function () { return decoder_ts_1.createContract; } });
|
||||
Object.defineProperty(exports, "deployContract", { enumerable: true, get: function () { return decoder_ts_1.deployContract; } });
|
||||
Object.defineProperty(exports, "events", { enumerable: true, get: function () { return decoder_ts_1.events; } });
|
||||
const erc1155_ts_1 = require("./erc1155.js");
|
||||
Object.defineProperty(exports, "ERC1155", { enumerable: true, get: function () { return erc1155_ts_1.default; } });
|
||||
const erc20_ts_1 = require("./erc20.js");
|
||||
Object.defineProperty(exports, "ERC20", { enumerable: true, get: function () { return erc20_ts_1.default; } });
|
||||
const erc721_ts_1 = require("./erc721.js");
|
||||
Object.defineProperty(exports, "ERC721", { enumerable: true, get: function () { return erc721_ts_1.default; } });
|
||||
const kyber_ts_1 = require("./kyber.js");
|
||||
Object.defineProperty(exports, "KYBER_NETWORK_PROXY_CONTRACT", { enumerable: true, get: function () { return kyber_ts_1.KYBER_NETWORK_PROXY_CONTRACT; } });
|
||||
const uniswap_v2_ts_1 = require("./uniswap-v2.js");
|
||||
Object.defineProperty(exports, "UNISWAP_V2_ROUTER_CONTRACT", { enumerable: true, get: function () { return uniswap_v2_ts_1.UNISWAP_V2_ROUTER_CONTRACT; } });
|
||||
const uniswap_v3_ts_1 = require("./uniswap-v3.js");
|
||||
Object.defineProperty(exports, "UNISWAP_V3_ROUTER_CONTRACT", { enumerable: true, get: function () { return uniswap_v3_ts_1.UNISWAP_V3_ROUTER_CONTRACT; } });
|
||||
const weth_ts_1 = require("./weth.js");
|
||||
Object.defineProperty(exports, "WETH", { enumerable: true, get: function () { return weth_ts_1.default; } });
|
||||
exports.TOKENS = (() => Object.freeze(Object.fromEntries([
|
||||
['UNI', '0x1f9840a85d5af5bf1d1762f925bdaddc4201f984'],
|
||||
['BAT', '0x0d8775f648430679a709e98d2b0cb6250d2887ef'],
|
||||
// Required for Uniswap multi-hop routing
|
||||
['USDT', '0xdac17f958d2ee523a2206206994597c13d831ec7', 6, 1],
|
||||
['USDC', '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', 6, 1],
|
||||
['WETH', '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'],
|
||||
['WBTC', '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', 8],
|
||||
['DAI', '0x6b175474e89094c44da98b954eedeac495271d0f', 18, 1],
|
||||
['COMP', '0xc00e94cb662c3520282e6f5717214004a7f26888'],
|
||||
['MKR', '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2'],
|
||||
['AMPL', '0xd46ba6d942050d489dbd938a2c909a5d5039a161', 9],
|
||||
].map(([symbol, addr, decimals, price]) => [
|
||||
addr,
|
||||
{ abi: 'ERC20', symbol, decimals: decimals || 18, price },
|
||||
]))))();
|
||||
// <address, contractInfo>
|
||||
exports.CONTRACTS = (() => Object.freeze({
|
||||
[uniswap_v2_ts_1.UNISWAP_V2_ROUTER_CONTRACT]: { abi: uniswap_v2_ts_1.default, name: 'UNISWAP V2 ROUTER' },
|
||||
[kyber_ts_1.KYBER_NETWORK_PROXY_CONTRACT]: { abi: kyber_ts_1.default, name: 'KYBER NETWORK PROXY' },
|
||||
[uniswap_v3_ts_1.UNISWAP_V3_ROUTER_CONTRACT]: { abi: uniswap_v3_ts_1.default, name: 'UNISWAP V3 ROUTER' },
|
||||
...exports.TOKENS,
|
||||
[weth_ts_1.WETH_CONTRACT]: { abi: weth_ts_1.default, name: 'WETH Token', decimals: 18, symbol: 'WETH' },
|
||||
}))();
|
||||
const tokenFromSymbol = (symbol) => {
|
||||
for (let c in exports.TOKENS) {
|
||||
if (exports.TOKENS[c].symbol === symbol)
|
||||
return Object.assign({ contract: c }, exports.TOKENS[c]);
|
||||
}
|
||||
throw new Error('unknown token');
|
||||
};
|
||||
exports.tokenFromSymbol = tokenFromSymbol;
|
||||
const getABI = (info) => {
|
||||
if (typeof info.abi === 'string') {
|
||||
if (info.abi === 'ERC20')
|
||||
return erc20_ts_1.default;
|
||||
else if (info.abi === 'ERC721')
|
||||
return erc721_ts_1.default;
|
||||
else
|
||||
throw new Error(`getABI: unknown abi type=${info.abi}`);
|
||||
}
|
||||
return info.abi;
|
||||
};
|
||||
// TODO: export? Seems useful enough
|
||||
// We cannot have this inside decoder itself,
|
||||
// since it will create dependencies on all default contracts
|
||||
const getDecoder = (opt = {}) => {
|
||||
const decoder = new decoder_ts_1.Decoder();
|
||||
const contracts = {};
|
||||
// Add contracts
|
||||
if (!opt.noDefault)
|
||||
Object.assign(contracts, exports.CONTRACTS);
|
||||
if (opt.customContracts) {
|
||||
for (const k in opt.customContracts)
|
||||
contracts[k.toLowerCase()] = opt.customContracts[k];
|
||||
}
|
||||
// Contract info validation
|
||||
for (const k in contracts) {
|
||||
if (!address_ts_1.addr.isValid(k))
|
||||
throw new Error(`getDecoder: invalid contract address=${k}`);
|
||||
const c = contracts[k];
|
||||
if (c.symbol !== undefined && typeof c.symbol !== 'string')
|
||||
throw new Error(`getDecoder: wrong symbol type=${c.symbol}`);
|
||||
if (c.decimals !== undefined && !Number.isSafeInteger(c.decimals))
|
||||
throw new Error(`getDecoder: wrong decimals type=${c.decimals}`);
|
||||
if (c.name !== undefined && typeof c.name !== 'string')
|
||||
throw new Error(`getDecoder: wrong name type=${c.name}`);
|
||||
if (c.price !== undefined && typeof c.price !== 'number')
|
||||
throw new Error(`getDecoder: wrong price type=${c.price}`);
|
||||
decoder.add(k, getABI(c)); // validates c.abi
|
||||
}
|
||||
return { decoder, contracts };
|
||||
};
|
||||
// These methods are for case when user wants to inspect tx/logs/receipt,
|
||||
// but doesn't know anything about which contract is used. If you work with
|
||||
// specific contract it is better to use 'createContract' which will return nice types.
|
||||
// 'to' can point to specific known contract, but also can point to any address (it is part of tx)
|
||||
// 'to' should be part of real tx you want to parse, not hardcoded contract!
|
||||
// Even if contract is unknown, we still try to process by known function signatures
|
||||
// from other contracts.
|
||||
// Can be used to parse tx or 'eth_getTransactionReceipt' output
|
||||
const decodeData = (to, data, amount, opt = {}) => {
|
||||
if (!address_ts_1.addr.isValid(to))
|
||||
throw new Error(`decodeData: wrong to=${to}`);
|
||||
if (amount !== undefined && typeof amount !== 'bigint')
|
||||
throw new Error(`decodeData: wrong amount=${amount}`);
|
||||
const { decoder, contracts } = getDecoder(opt);
|
||||
return decoder.decode(to, utils_ts_1.ethHex.decode(data), {
|
||||
contract: to,
|
||||
contracts, // NOTE: we need whole contracts list here, since exchanges can use info about other contracts (tokens)
|
||||
contractInfo: contracts[to.toLowerCase()], // current contract info (for tokens)
|
||||
amount, // Amount is not neccesary, but some hints won't work without it (exchange eth to some tokens)
|
||||
});
|
||||
};
|
||||
exports.decodeData = decodeData;
|
||||
// Requires deps on tx, but nicer API.
|
||||
// Doesn't cover all use cases of decodeData, since it can't parse 'eth_getTransactionReceipt'
|
||||
const decodeTx = (transaction, opt = {}) => {
|
||||
const tx = index_ts_1.Transaction.fromHex(transaction);
|
||||
return (0, exports.decodeData)(tx.raw.to, tx.raw.data, tx.raw.value, opt);
|
||||
};
|
||||
exports.decodeTx = decodeTx;
|
||||
// Parses output of eth_getLogs/eth_getTransactionReceipt
|
||||
const decodeEvent = (to, topics, data, opt = {}) => {
|
||||
if (!address_ts_1.addr.isValid(to))
|
||||
throw new Error(`decodeEvent: wrong to=${to}`);
|
||||
const { decoder, contracts } = getDecoder(opt);
|
||||
return decoder.decodeEvent(to, topics, data, {
|
||||
contract: to,
|
||||
contracts,
|
||||
contractInfo: contracts[to.toLowerCase()],
|
||||
// amount here is not used by our hooks. Should we ask it for consistency?
|
||||
});
|
||||
};
|
||||
exports.decodeEvent = decodeEvent;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
dev/env/node_modules/micro-eth-signer/abi/index.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/abi/index.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
141
dev/env/node_modules/micro-eth-signer/abi/kyber.d.ts
generated
vendored
Executable file
141
dev/env/node_modules/micro-eth-signer/abi/kyber.d.ts
generated
vendored
Executable file
@@ -0,0 +1,141 @@
|
||||
declare const ABI: readonly [{
|
||||
readonly type: "function";
|
||||
readonly name: "getExpectedRate";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "src";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "dest";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "srcQty";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "expectedRate";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "worstRate";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "getExpectedRateAfterFee";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "src";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "dest";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "srcQty";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "platformFeeBps";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "hint";
|
||||
readonly type: "bytes";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "expectedRate";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "trade";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "src";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "srcAmount";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "dest";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "destAddress";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "maxDestAmount";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "minConversionRate";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "platformWallet";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "tradeWithHint";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "src";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "srcAmount";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "dest";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "destAddress";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "maxDestAmount";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "minConversionRate";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "walletId";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "hint";
|
||||
readonly type: "bytes";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "tradeWithHintAndFee";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "src";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "srcAmount";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "dest";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "destAddress";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "maxDestAmount";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "minConversionRate";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "platformWallet";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "platformFeeBps";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "hint";
|
||||
readonly type: "bytes";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "destAmount";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}];
|
||||
export default ABI;
|
||||
export declare const KYBER_NETWORK_PROXY_CONTRACT = "0x9aab3f75489902f3a48495025729a0af77d4b11e";
|
||||
//# sourceMappingURL=kyber.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/abi/kyber.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/abi/kyber.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"kyber.d.ts","sourceRoot":"","sources":["../src/abi/kyber.ts"],"names":[],"mappings":"AAqCA,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAwC,CAAC;AAElD,eAAe,GAAG,CAAC;AACnB,eAAO,MAAM,4BAA4B,+CAA+C,CAAC"}
|
||||
33
dev/env/node_modules/micro-eth-signer/abi/kyber.js
generated
vendored
Executable file
33
dev/env/node_modules/micro-eth-signer/abi/kyber.js
generated
vendored
Executable file
@@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.KYBER_NETWORK_PROXY_CONTRACT = void 0;
|
||||
const utils_ts_1 = require("../utils.js");
|
||||
const common_ts_1 = require("./common.js");
|
||||
// prettier-ignore
|
||||
const _ABI = [
|
||||
{ type: "function", name: "getExpectedRate", inputs: [{ name: "src", type: "address" }, { name: "dest", type: "address" }, { name: "srcQty", type: "uint256" }], outputs: [{ name: "expectedRate", type: "uint256" }, { name: "worstRate", type: "uint256" }] }, { type: "function", name: "getExpectedRateAfterFee", inputs: [{ name: "src", type: "address" }, { name: "dest", type: "address" }, { name: "srcQty", type: "uint256" }, { name: "platformFeeBps", type: "uint256" }, { name: "hint", type: "bytes" }], outputs: [{ name: "expectedRate", type: "uint256" }] }, { type: "function", name: "trade", inputs: [{ name: "src", type: "address" }, { name: "srcAmount", type: "uint256" }, { name: "dest", type: "address" }, { name: "destAddress", type: "address" }, { name: "maxDestAmount", type: "uint256" }, { name: "minConversionRate", type: "uint256" }, { name: "platformWallet", type: "address" }], outputs: [{ type: "uint256" }] }, { type: "function", name: "tradeWithHint", inputs: [{ name: "src", type: "address" }, { name: "srcAmount", type: "uint256" }, { name: "dest", type: "address" }, { name: "destAddress", type: "address" }, { name: "maxDestAmount", type: "uint256" }, { name: "minConversionRate", type: "uint256" }, { name: "walletId", type: "address" }, { name: "hint", type: "bytes" }], outputs: [{ type: "uint256" }] }, { type: "function", name: "tradeWithHintAndFee", inputs: [{ name: "src", type: "address" }, { name: "srcAmount", type: "uint256" }, { name: "dest", type: "address" }, { name: "destAddress", type: "address" }, { name: "maxDestAmount", type: "uint256" }, { name: "minConversionRate", type: "uint256" }, { name: "platformWallet", type: "address" }, { name: "platformFeeBps", type: "uint256" }, { name: "hint", type: "bytes" }], outputs: [{ name: "destAmount", type: "uint256" }] }
|
||||
];
|
||||
const _10n = BigInt(10);
|
||||
const hints = {
|
||||
tradeWithHintAndFee(v, opt) {
|
||||
if (!opt.contracts)
|
||||
throw Error('Not enough info');
|
||||
const tokenInfo = (c) => c === '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'
|
||||
? { symbol: 'ETH', decimals: 18 }
|
||||
: opt.contracts[c];
|
||||
const formatToken = (amount, info) => `${(0, utils_ts_1.createDecimal)(info.decimals).encode(amount)} ${info.symbol}`;
|
||||
const [srcInfo, destInfo] = [tokenInfo(v.src), tokenInfo(v.dest)];
|
||||
if (!srcInfo || !destInfo)
|
||||
throw Error('Not enough info');
|
||||
const destAmount = (v.srcAmount *
|
||||
v.minConversionRate *
|
||||
_10n ** BigInt(destInfo.decimals)) /
|
||||
_10n ** (BigInt(srcInfo.decimals) + BigInt(18));
|
||||
const fee = formatToken((BigInt(v.platformFeeBps) * BigInt(v.srcAmount)) / BigInt(10000), srcInfo);
|
||||
return `Swap ${formatToken(v.srcAmount, srcInfo)} For ${formatToken(destAmount, destInfo)} (with platform fee: ${fee})`;
|
||||
},
|
||||
};
|
||||
const ABI = /* @__PURE__ */ (0, common_ts_1.addHints)(_ABI, hints);
|
||||
exports.default = ABI;
|
||||
exports.KYBER_NETWORK_PROXY_CONTRACT = '0x9aab3f75489902f3a48495025729a0af77d4b11e';
|
||||
//# sourceMappingURL=kyber.js.map
|
||||
1
dev/env/node_modules/micro-eth-signer/abi/kyber.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/abi/kyber.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"kyber.js","sourceRoot":"","sources":["../src/abi/kyber.ts"],"names":[],"mappings":";;;AAAA,0CAA4C;AAC5C,2CAAuC;AAGvC,kBAAkB;AAClB,MAAM,IAAI,GAAG;IACX,EAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,iBAAiB,EAAC,MAAM,EAAC,CAAC,EAAC,IAAI,EAAC,KAAK,EAA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MAAM,CAAC,OAAO,CAAC,QAAS,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QACnD,MAAM,GAAG,GAAG,WAAW,CACrB,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,EAChE,OAAO,CACR,CAAC;QACF,OAAO,QAAQ,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,QAAQ,WAAW,CACjE,UAAU,EACV,QAAQ,CACT,wBAAwB,GAAG,GAAG,CAAC;IAClC,CAAC;CACF,CAAC;AAEF,MAAM,GAAG,GAAG,eAAe,CAAC,IAAA,oBAAQ,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAElD,kBAAe,GAAG,CAAC;AACN,QAAA,4BAA4B,GAAG,4CAA4C,CAAC"}
|
||||
755
dev/env/node_modules/micro-eth-signer/abi/uniswap-v2.d.ts
generated
vendored
Executable file
755
dev/env/node_modules/micro-eth-signer/abi/uniswap-v2.d.ts
generated
vendored
Executable file
@@ -0,0 +1,755 @@
|
||||
declare const ABI: readonly [{
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "_factory";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "_WETH";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "constructor";
|
||||
}, {
|
||||
readonly inputs: readonly [];
|
||||
readonly name: "WETH";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "tokenA";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "tokenB";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountADesired";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountBDesired";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountAMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountBMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "addLiquidity";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountA";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountB";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "liquidity";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountTokenDesired";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountTokenMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountETHMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "addLiquidityETH";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountToken";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountETH";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "liquidity";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [];
|
||||
readonly name: "factory";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOut";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "reserveIn";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "reserveOut";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "getAmountIn";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "pure";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "reserveIn";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "reserveOut";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "getAmountOut";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOut";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "pure";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOut";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}];
|
||||
readonly name: "getAmountsIn";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256[]";
|
||||
readonly name: "amounts";
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}];
|
||||
readonly name: "getAmountsOut";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256[]";
|
||||
readonly name: "amounts";
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountA";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "reserveA";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "reserveB";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "quote";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountB";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "pure";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "tokenA";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "tokenB";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "liquidity";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountAMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountBMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "removeLiquidity";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountA";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountB";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "liquidity";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountTokenMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountETHMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "removeLiquidityETH";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountToken";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountETH";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "liquidity";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountTokenMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountETHMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "removeLiquidityETHSupportingFeeOnTransferTokens";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountETH";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "liquidity";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountTokenMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountETHMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "bool";
|
||||
readonly name: "approveMax";
|
||||
readonly type: "bool";
|
||||
}, {
|
||||
readonly internalType: "uint8";
|
||||
readonly name: "v";
|
||||
readonly type: "uint8";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "r";
|
||||
readonly type: "bytes32";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "s";
|
||||
readonly type: "bytes32";
|
||||
}];
|
||||
readonly name: "removeLiquidityETHWithPermit";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountToken";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountETH";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "liquidity";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountTokenMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountETHMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "bool";
|
||||
readonly name: "approveMax";
|
||||
readonly type: "bool";
|
||||
}, {
|
||||
readonly internalType: "uint8";
|
||||
readonly name: "v";
|
||||
readonly type: "uint8";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "r";
|
||||
readonly type: "bytes32";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "s";
|
||||
readonly type: "bytes32";
|
||||
}];
|
||||
readonly name: "removeLiquidityETHWithPermitSupportingFeeOnTransferTokens";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountETH";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "tokenA";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "tokenB";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "liquidity";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountAMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountBMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "bool";
|
||||
readonly name: "approveMax";
|
||||
readonly type: "bool";
|
||||
}, {
|
||||
readonly internalType: "uint8";
|
||||
readonly name: "v";
|
||||
readonly type: "uint8";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "r";
|
||||
readonly type: "bytes32";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "s";
|
||||
readonly type: "bytes32";
|
||||
}];
|
||||
readonly name: "removeLiquidityWithPermit";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountA";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountB";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOut";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "swapETHForExactTokens";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256[]";
|
||||
readonly name: "amounts";
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOutMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "swapExactETHForTokens";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256[]";
|
||||
readonly name: "amounts";
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOutMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "swapExactETHForTokensSupportingFeeOnTransferTokens";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOutMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "swapExactTokensForETH";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256[]";
|
||||
readonly name: "amounts";
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOutMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "swapExactTokensForETHSupportingFeeOnTransferTokens";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOutMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "swapExactTokensForTokens";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256[]";
|
||||
readonly name: "amounts";
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOutMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "swapExactTokensForTokensSupportingFeeOnTransferTokens";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOut";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountInMax";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "swapTokensForExactETH";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256[]";
|
||||
readonly name: "amounts";
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOut";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountInMax";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "swapTokensForExactTokens";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256[]";
|
||||
readonly name: "amounts";
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "receive";
|
||||
}];
|
||||
export default ABI;
|
||||
export declare const UNISWAP_V2_ROUTER_CONTRACT = "0x7a250d5630b4cf539739df2c5dacb4c659f2488d";
|
||||
//# sourceMappingURL=uniswap-v2.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/abi/uniswap-v2.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/abi/uniswap-v2.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"uniswap-v2.d.ts","sourceRoot":"","sources":["../src/abi/uniswap-v2.ts"],"names":[],"mappings":"AAsFA,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAwC,CAAC;AAClD,eAAe,GAAG,CAAC;AACnB,eAAO,MAAM,0BAA0B,+CAA+C,CAAC"}
|
||||
82
dev/env/node_modules/micro-eth-signer/abi/uniswap-v2.js
generated
vendored
Executable file
82
dev/env/node_modules/micro-eth-signer/abi/uniswap-v2.js
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
1
dev/env/node_modules/micro-eth-signer/abi/uniswap-v2.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/abi/uniswap-v2.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
441
dev/env/node_modules/micro-eth-signer/abi/uniswap-v3.d.ts
generated
vendored
Executable file
441
dev/env/node_modules/micro-eth-signer/abi/uniswap-v3.d.ts
generated
vendored
Executable file
@@ -0,0 +1,441 @@
|
||||
declare const ABI: readonly [{
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "_factory";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "_WETH9";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "constructor";
|
||||
}, {
|
||||
readonly inputs: readonly [];
|
||||
readonly name: "WETH9";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly components: readonly [{
|
||||
readonly internalType: "bytes";
|
||||
readonly name: "path";
|
||||
readonly type: "bytes";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "recipient";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOutMinimum";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly internalType: "struct ISwapRouter.ExactInputParams";
|
||||
readonly name: "params";
|
||||
readonly type: "tuple";
|
||||
}];
|
||||
readonly name: "exactInput";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOut";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly components: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "tokenIn";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "tokenOut";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint24";
|
||||
readonly name: "fee";
|
||||
readonly type: "uint24";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "recipient";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOutMinimum";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint160";
|
||||
readonly name: "sqrtPriceLimitX96";
|
||||
readonly type: "uint160";
|
||||
}];
|
||||
readonly internalType: "struct ISwapRouter.ExactInputSingleParams";
|
||||
readonly name: "params";
|
||||
readonly type: "tuple";
|
||||
}];
|
||||
readonly name: "exactInputSingle";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOut";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly components: readonly [{
|
||||
readonly internalType: "bytes";
|
||||
readonly name: "path";
|
||||
readonly type: "bytes";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "recipient";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOut";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountInMaximum";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly internalType: "struct ISwapRouter.ExactOutputParams";
|
||||
readonly name: "params";
|
||||
readonly type: "tuple";
|
||||
}];
|
||||
readonly name: "exactOutput";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly components: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "tokenIn";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "tokenOut";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint24";
|
||||
readonly name: "fee";
|
||||
readonly type: "uint24";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "recipient";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOut";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountInMaximum";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint160";
|
||||
readonly name: "sqrtPriceLimitX96";
|
||||
readonly type: "uint160";
|
||||
}];
|
||||
readonly internalType: "struct ISwapRouter.ExactOutputSingleParams";
|
||||
readonly name: "params";
|
||||
readonly type: "tuple";
|
||||
}];
|
||||
readonly name: "exactOutputSingle";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [];
|
||||
readonly name: "factory";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "bytes[]";
|
||||
readonly name: "data";
|
||||
readonly type: "bytes[]";
|
||||
}];
|
||||
readonly name: "multicall";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "bytes[]";
|
||||
readonly name: "results";
|
||||
readonly type: "bytes[]";
|
||||
}];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [];
|
||||
readonly name: "refundETH";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint8";
|
||||
readonly name: "v";
|
||||
readonly type: "uint8";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "r";
|
||||
readonly type: "bytes32";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "s";
|
||||
readonly type: "bytes32";
|
||||
}];
|
||||
readonly name: "selfPermit";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "nonce";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "expiry";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint8";
|
||||
readonly name: "v";
|
||||
readonly type: "uint8";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "r";
|
||||
readonly type: "bytes32";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "s";
|
||||
readonly type: "bytes32";
|
||||
}];
|
||||
readonly name: "selfPermitAllowed";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "nonce";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "expiry";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint8";
|
||||
readonly name: "v";
|
||||
readonly type: "uint8";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "r";
|
||||
readonly type: "bytes32";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "s";
|
||||
readonly type: "bytes32";
|
||||
}];
|
||||
readonly name: "selfPermitAllowedIfNecessary";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint8";
|
||||
readonly name: "v";
|
||||
readonly type: "uint8";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "r";
|
||||
readonly type: "bytes32";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "s";
|
||||
readonly type: "bytes32";
|
||||
}];
|
||||
readonly name: "selfPermitIfNecessary";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountMinimum";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "recipient";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly name: "sweepToken";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountMinimum";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "recipient";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "feeBips";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "feeRecipient";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly name: "sweepTokenWithFee";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "int256";
|
||||
readonly name: "amount0Delta";
|
||||
readonly type: "int256";
|
||||
}, {
|
||||
readonly internalType: "int256";
|
||||
readonly name: "amount1Delta";
|
||||
readonly type: "int256";
|
||||
}, {
|
||||
readonly internalType: "bytes";
|
||||
readonly name: "_data";
|
||||
readonly type: "bytes";
|
||||
}];
|
||||
readonly name: "uniswapV3SwapCallback";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountMinimum";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "recipient";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly name: "unwrapWETH9";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountMinimum";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "recipient";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "feeBips";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "feeRecipient";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly name: "unwrapWETH9WithFee";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "receive";
|
||||
}];
|
||||
export default ABI;
|
||||
export declare const UNISWAP_V3_ROUTER_CONTRACT = "0xe592427a0aece92de3edee1f18e0157c05861564";
|
||||
//# sourceMappingURL=uniswap-v3.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/abi/uniswap-v3.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/abi/uniswap-v3.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"uniswap-v3.d.ts","sourceRoot":"","sources":["../src/abi/uniswap-v3.ts"],"names":[],"mappings":"AA0EA,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAiD,CAAC;AAE3D,eAAe,GAAG,CAAC;AACnB,eAAO,MAAM,0BAA0B,+CAA+C,CAAC"}
|
||||
81
dev/env/node_modules/micro-eth-signer/abi/uniswap-v3.js
generated
vendored
Executable file
81
dev/env/node_modules/micro-eth-signer/abi/uniswap-v3.js
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
1
dev/env/node_modules/micro-eth-signer/abi/uniswap-v3.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/abi/uniswap-v3.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
216
dev/env/node_modules/micro-eth-signer/abi/weth.d.ts
generated
vendored
Executable file
216
dev/env/node_modules/micro-eth-signer/abi/weth.d.ts
generated
vendored
Executable file
@@ -0,0 +1,216 @@
|
||||
declare const ABI: readonly [{
|
||||
readonly constant: true;
|
||||
readonly inputs: readonly [];
|
||||
readonly name: "name";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "string";
|
||||
}];
|
||||
readonly payable: false;
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly constant: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "guy";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "wad";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "approve";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
readonly payable: false;
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly constant: true;
|
||||
readonly inputs: readonly [];
|
||||
readonly name: "totalSupply";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly payable: false;
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly constant: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "src";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "dst";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "wad";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "transferFrom";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
readonly payable: false;
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly constant: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "wad";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "withdraw";
|
||||
readonly outputs: readonly [];
|
||||
readonly payable: false;
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly constant: true;
|
||||
readonly inputs: readonly [];
|
||||
readonly name: "decimals";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "uint8";
|
||||
}];
|
||||
readonly payable: false;
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly constant: true;
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly name: "balanceOf";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly payable: false;
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly constant: true;
|
||||
readonly inputs: readonly [];
|
||||
readonly name: "symbol";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "string";
|
||||
}];
|
||||
readonly payable: false;
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly constant: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "dst";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "wad";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "transfer";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
readonly payable: false;
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly constant: false;
|
||||
readonly inputs: readonly [];
|
||||
readonly name: "deposit";
|
||||
readonly outputs: readonly [];
|
||||
readonly payable: true;
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly constant: true;
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly name: "allowance";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly payable: false;
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly payable: true;
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "fallback";
|
||||
}, {
|
||||
readonly anonymous: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "src";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "guy";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "wad";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "Approval";
|
||||
readonly type: "event";
|
||||
}, {
|
||||
readonly anonymous: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "src";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "dst";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "wad";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "Transfer";
|
||||
readonly type: "event";
|
||||
}, {
|
||||
readonly anonymous: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "dst";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "wad";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "Deposit";
|
||||
readonly type: "event";
|
||||
}, {
|
||||
readonly anonymous: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "src";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "wad";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "Withdrawal";
|
||||
readonly type: "event";
|
||||
}];
|
||||
export default ABI;
|
||||
export declare const WETH_CONTRACT = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2";
|
||||
//# sourceMappingURL=weth.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/abi/weth.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/abi/weth.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"weth.d.ts","sourceRoot":"","sources":["../src/abi/weth.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA6C,CAAC;AACvD,eAAe,GAAG,CAAC;AACnB,eAAO,MAAM,aAAa,+CAA+C,CAAC"}
|
||||
13
dev/env/node_modules/micro-eth-signer/abi/weth.js
generated
vendored
Executable file
13
dev/env/node_modules/micro-eth-signer/abi/weth.js
generated
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.WETH_CONTRACT = void 0;
|
||||
const common_ts_1 = require("./common.js");
|
||||
const erc20_ts_1 = require("./erc20.js");
|
||||
// prettier-ignore
|
||||
const _ABI = [
|
||||
{ constant: true, inputs: [], name: "name", outputs: [{ name: "", type: "string" }], payable: false, stateMutability: "view", type: "function" }, { constant: false, inputs: [{ name: "guy", type: "address" }, { name: "wad", type: "uint256" }], name: "approve", outputs: [{ name: "", type: "bool" }], payable: false, stateMutability: "nonpayable", type: "function" }, { constant: true, inputs: [], name: "totalSupply", outputs: [{ name: "", type: "uint256" }], payable: false, stateMutability: "view", type: "function" }, { constant: false, inputs: [{ name: "src", type: "address" }, { name: "dst", type: "address" }, { name: "wad", type: "uint256" }], name: "transferFrom", outputs: [{ name: "", type: "bool" }], payable: false, stateMutability: "nonpayable", type: "function" }, { constant: false, inputs: [{ name: "wad", type: "uint256" }], name: "withdraw", outputs: [], payable: false, stateMutability: "nonpayable", type: "function" }, { constant: true, inputs: [], name: "decimals", outputs: [{ name: "", type: "uint8" }], payable: false, stateMutability: "view", type: "function" }, { constant: true, inputs: [{ name: "", type: "address" }], name: "balanceOf", outputs: [{ name: "", type: "uint256" }], payable: false, stateMutability: "view", type: "function" }, { constant: true, inputs: [], name: "symbol", outputs: [{ name: "", type: "string" }], payable: false, stateMutability: "view", type: "function" }, { constant: false, inputs: [{ name: "dst", type: "address" }, { name: "wad", type: "uint256" }], name: "transfer", outputs: [{ name: "", type: "bool" }], payable: false, stateMutability: "nonpayable", type: "function" }, { constant: false, inputs: [], name: "deposit", outputs: [], payable: true, stateMutability: "payable", type: "function" }, { constant: true, inputs: [{ name: "", type: "address" }, { name: "", type: "address" }], name: "allowance", outputs: [{ name: "", type: "uint256" }], payable: false, stateMutability: "view", type: "function" }, { payable: true, stateMutability: "payable", type: "fallback" }, { anonymous: false, inputs: [{ indexed: true, name: "src", type: "address" }, { indexed: true, name: "guy", type: "address" }, { indexed: false, name: "wad", type: "uint256" }], name: "Approval", type: "event" }, { anonymous: false, inputs: [{ indexed: true, name: "src", type: "address" }, { indexed: true, name: "dst", type: "address" }, { indexed: false, name: "wad", type: "uint256" }], name: "Transfer", type: "event" }, { anonymous: false, inputs: [{ indexed: true, name: "dst", type: "address" }, { indexed: false, name: "wad", type: "uint256" }], name: "Deposit", type: "event" }, { anonymous: false, inputs: [{ indexed: true, name: "src", type: "address" }, { indexed: false, name: "wad", type: "uint256" }], name: "Withdrawal", type: "event" }
|
||||
];
|
||||
const ABI = /* @__PURE__ */ (0, common_ts_1.addHints)(_ABI, erc20_ts_1.hints);
|
||||
exports.default = ABI;
|
||||
exports.WETH_CONTRACT = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2';
|
||||
//# sourceMappingURL=weth.js.map
|
||||
1
dev/env/node_modules/micro-eth-signer/abi/weth.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/abi/weth.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"weth.js","sourceRoot":"","sources":["../src/abi/weth.ts"],"names":[],"mappings":";;;AAAA,2CAAuC;AACvC,yCAAiD;AAEjD,kBAAkB;AAClB,MAAM,IAAI,GAAG;IACX,EAAC,QAAQ,EAAC,IAAI,EAAC,MAAM,EAAC,EAAE,EAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAC,CAAC,EAA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AC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,OAAO,EAAC,KAAK,EAAC,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,SAAS,EAAC,CAAC,EAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,OAAO,EAAC,EAAC,EAAC,SAAS,EAAC,KAAK,EAAC,MAAM,EAAC,CAAC,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,OAAO,EAAC,KAAK,EAAC,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,SAAS,EAAC,CAAC,EAAC,IAAI,EAAC,SAAS,EAAC,IAAI,EAAC,OAAO,EAAC,EAAC,EAAC,SAAS,EAAC,KAAK,EAAC,MAAM,EAAC,CAAC,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,OAAO,EAAC,KAAK,EAAC,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,SAAS,EAAC,CAAC,EAAC,IAAI,EAAC,YAAY,EAAC,IAAI,EAAC,OAAO,EAAC;CAC70E,CAAC;AAEX,MAAM,GAAG,GAAG,eAAe,CAAC,IAAA,oBAAQ,EAAC,IAAI,EAAE,gBAAU,CAAC,CAAC;AACvD,kBAAe,GAAG,CAAC;AACN,QAAA,aAAa,GAAG,4CAA4C,CAAC"}
|
||||
37
dev/env/node_modules/micro-eth-signer/address.d.ts
generated
vendored
Executable file
37
dev/env/node_modules/micro-eth-signer/address.d.ts
generated
vendored
Executable file
@@ -0,0 +1,37 @@
|
||||
export declare const addr: {
|
||||
RE: RegExp;
|
||||
parse: (address: string, allowEmpty?: boolean) => {
|
||||
hasPrefix: boolean;
|
||||
data: string;
|
||||
};
|
||||
/**
|
||||
* Address checksum is calculated by hashing with keccak_256.
|
||||
* It hashes *string*, not a bytearray: keccak('beef') not keccak([0xbe, 0xef])
|
||||
* @param nonChecksummedAddress
|
||||
* @param allowEmpty - allows '0x'
|
||||
* @returns checksummed address
|
||||
*/
|
||||
addChecksum: (nonChecksummedAddress: string, allowEmpty?: boolean) => string;
|
||||
/**
|
||||
* Creates address from secp256k1 public key.
|
||||
*/
|
||||
fromPublicKey: (key: string | Uint8Array) => string;
|
||||
/**
|
||||
* Creates address from ETH private key in hex or ui8a format.
|
||||
*/
|
||||
fromPrivateKey: (key: string | Uint8Array) => string;
|
||||
/**
|
||||
* Generates hex string with new random private key and address. Uses CSPRNG internally.
|
||||
*/
|
||||
random(): {
|
||||
privateKey: string;
|
||||
address: string;
|
||||
};
|
||||
/**
|
||||
* Verifies checksum if the address is checksummed.
|
||||
* Always returns true when the address is not checksummed.
|
||||
* @param allowEmpty - allows '0x'
|
||||
*/
|
||||
isValid: (checksummedAddress: string, allowEmpty?: boolean) => boolean;
|
||||
};
|
||||
//# sourceMappingURL=address.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/address.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/address.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["src/address.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,IAAI;QACwC,MAAM;qBAElD,MAAM,2BAEd;QACD,SAAS,EAAE,OAAO,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;KACd;IAgBD;;;;;;OAMG;yCACkC,MAAM,2BAAuB,MAAM;IAYxE;;OAEG;yBACkB,MAAM,GAAG,UAAU,KAAG,MAAM;IAQjD;;OAEG;0BACmB,MAAM,GAAG,UAAU,KAAG,MAAM;IAKlD;;OAEG;cACO;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;IAKjD;;;;OAIG;kCAC2B,MAAM,2BAAuB,OAAO;CAcnE,CAAC"}
|
||||
94
dev/env/node_modules/micro-eth-signer/address.js
generated
vendored
Executable file
94
dev/env/node_modules/micro-eth-signer/address.js
generated
vendored
Executable file
@@ -0,0 +1,94 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.addr = void 0;
|
||||
/*! micro-eth-signer - MIT License (c) 2021 Paul Miller (paulmillr.com) */
|
||||
const secp256k1_1 = require("@noble/curves/secp256k1");
|
||||
const sha3_1 = require("@noble/hashes/sha3");
|
||||
const utils_1 = require("@noble/hashes/utils");
|
||||
const utils_ts_1 = require("./utils.js");
|
||||
exports.addr = {
|
||||
RE: /^(0[xX])?([0-9a-fA-F]{40})?$/,
|
||||
parse: (address, allowEmpty = false) => {
|
||||
(0, utils_ts_1.astr)(address);
|
||||
// NOTE: empty address allowed for 'to', but would be mistake for other address fields.
|
||||
// '0x' instead of null/undefined because we don't want to send contract creation tx if user
|
||||
// accidentally missed 'to' field.
|
||||
if (allowEmpty && address === '0x')
|
||||
return { hasPrefix: true, data: '' };
|
||||
const res = address.match(exports.addr.RE) || [];
|
||||
const hasPrefix = res[1] != null;
|
||||
const data = res[2];
|
||||
if (!data) {
|
||||
const len = hasPrefix ? 42 : 40;
|
||||
throw new Error(`address must be ${len}-char hex, got ${address.length}-char ${address}`);
|
||||
}
|
||||
return { hasPrefix, data };
|
||||
},
|
||||
/**
|
||||
* Address checksum is calculated by hashing with keccak_256.
|
||||
* It hashes *string*, not a bytearray: keccak('beef') not keccak([0xbe, 0xef])
|
||||
* @param nonChecksummedAddress
|
||||
* @param allowEmpty - allows '0x'
|
||||
* @returns checksummed address
|
||||
*/
|
||||
addChecksum: (nonChecksummedAddress, allowEmpty = false) => {
|
||||
const low = exports.addr.parse(nonChecksummedAddress, allowEmpty).data.toLowerCase();
|
||||
const hash = (0, utils_1.bytesToHex)((0, sha3_1.keccak_256)(low));
|
||||
let checksummed = '';
|
||||
for (let i = 0; i < low.length; i++) {
|
||||
const hi = Number.parseInt(hash[i], 16);
|
||||
const li = low[i];
|
||||
checksummed += hi <= 7 ? li : li.toUpperCase(); // if char is 9-f, upcase it
|
||||
}
|
||||
return (0, utils_ts_1.add0x)(checksummed);
|
||||
},
|
||||
/**
|
||||
* Creates address from secp256k1 public key.
|
||||
*/
|
||||
fromPublicKey: (key) => {
|
||||
if (!key)
|
||||
throw new Error('invalid public key: ' + key);
|
||||
const pub65b = secp256k1_1.secp256k1.ProjectivePoint.fromHex(key).toRawBytes(false);
|
||||
const hashed = (0, sha3_1.keccak_256)(pub65b.subarray(1, 65));
|
||||
const address = (0, utils_1.bytesToHex)(hashed).slice(24); // slice 24..64
|
||||
return exports.addr.addChecksum(address);
|
||||
},
|
||||
/**
|
||||
* Creates address from ETH private key in hex or ui8a format.
|
||||
*/
|
||||
fromPrivateKey: (key) => {
|
||||
if (typeof key === 'string')
|
||||
key = (0, utils_ts_1.strip0x)(key);
|
||||
return exports.addr.fromPublicKey(secp256k1_1.secp256k1.getPublicKey(key, false));
|
||||
},
|
||||
/**
|
||||
* Generates hex string with new random private key and address. Uses CSPRNG internally.
|
||||
*/
|
||||
random() {
|
||||
const privateKey = utils_ts_1.ethHex.encode(secp256k1_1.secp256k1.utils.randomPrivateKey());
|
||||
return { privateKey, address: exports.addr.fromPrivateKey(privateKey) };
|
||||
},
|
||||
/**
|
||||
* Verifies checksum if the address is checksummed.
|
||||
* Always returns true when the address is not checksummed.
|
||||
* @param allowEmpty - allows '0x'
|
||||
*/
|
||||
isValid: (checksummedAddress, allowEmpty = false) => {
|
||||
let parsed;
|
||||
try {
|
||||
parsed = exports.addr.parse(checksummedAddress, allowEmpty);
|
||||
}
|
||||
catch (error) {
|
||||
return false;
|
||||
}
|
||||
const { data: address, hasPrefix } = parsed;
|
||||
if (!hasPrefix)
|
||||
return false;
|
||||
const low = address.toLowerCase();
|
||||
const upp = address.toUpperCase();
|
||||
if (address === low || address === upp)
|
||||
return true;
|
||||
return exports.addr.addChecksum(low, allowEmpty) === checksummedAddress;
|
||||
},
|
||||
};
|
||||
//# sourceMappingURL=address.js.map
|
||||
1
dev/env/node_modules/micro-eth-signer/address.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/address.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"address.js","sourceRoot":"","sources":["src/address.ts"],"names":[],"mappings":";;;AAAA,0EAA0E;AAC1E,uDAAoD;AACpD,6CAAgD;AAChD,+CAAiD;AACjD,yCAA0D;AAE7C,QAAA,IAAI,GAAG;IAClB,EAAE,EAAE,8BAAyD;IAC7D,KAAK,EAAE,CACL,OAAe,EACf,UAAU,GAAG,KAAK,EAIlB,EAAE;QACF,IAAA,eAAI,EAAC,OAAO,CAAC,CAAC;QACd,uFAAuF;QACvF,4FAA4F;QAC5F,kCAAkC;QAClC,IAAI,UAAU,IAAI,OAAO,KAAK,IAAI;YAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QACzE,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,YAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;QACzC,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;QACjC,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,mBAAmB,GAAG,kBAAkB,OAAO,CAAC,MAAM,SAAS,OAAO,EAAE,CAAC,CAAC;QAC5F,CAAC;QACD,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED;;;;;;OAMG;IACH,WAAW,EAAE,CAAC,qBAA6B,EAAE,UAAU,GAAG,KAAK,EAAU,EAAE;QACzE,MAAM,GAAG,GAAG,YAAI,CAAC,KAAK,CAAC,qBAAqB,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,KAAK,QAAQ;YAAE,GAAG,GAAG,IAAA,kBAAO,EAAC,GAAG,CAAC,CAAC;QAChD,OAAO,YAAI,CAAC,aAAa,CAAC,qBAAS,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;IAChE,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,MAAM,UAAU,GAAG,iBAAM,CAAC,MAAM,CAAC,qBAAS,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;QACrE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,YAAI,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,CAAC;IAClE,CAAC;IAED;;;;OAIG;IACH,OAAO,EAAE,CAAC,kBAA0B,EAAE,UAAU,GAAG,KAAK,EAAW,EAAE;QACnE,IAAI,MAA4C,CAAC;QACjD,IAAI,CAAC;YACH,MAAM,GAAG,YAAI,CAAC,KAAK,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;QACtD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC5C,IAAI,CAAC,SAAS;YAAE,OAAO,KAAK,CAAC;QAC7B,MAAM,GAAG,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;QAClC,MAAM,GAAG,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;QAClC,IAAI,OAAO,KAAK,GAAG,IAAI,OAAO,KAAK,GAAG;YAAE,OAAO,IAAI,CAAC;QACpD,OAAO,YAAI,CAAC,WAAW,CAAC,GAAG,EAAE,UAAU,CAAC,KAAK,kBAAkB,CAAC;IAClE,CAAC;CACF,CAAC"}
|
||||
2
dev/env/node_modules/micro-eth-signer/esm/_type_test.d.ts
generated
vendored
Executable file
2
dev/env/node_modules/micro-eth-signer/esm/_type_test.d.ts
generated
vendored
Executable file
@@ -0,0 +1,2 @@
|
||||
export type Bytes = Uint8Array;
|
||||
//# sourceMappingURL=_type_test.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/_type_test.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/_type_test.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_type_test.d.ts","sourceRoot":"","sources":["../src/_type_test.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC"}
|
||||
230
dev/env/node_modules/micro-eth-signer/esm/_type_test.js
generated
vendored
Executable file
230
dev/env/node_modules/micro-eth-signer/esm/_type_test.js
generated
vendored
Executable file
@@ -0,0 +1,230 @@
|
||||
import * as P from 'micro-packed';
|
||||
import * as abi from "./abi/decoder.js";
|
||||
import * as typed from "./typed-data.js";
|
||||
// Should not be included in npm package, just for test of typescript compilation
|
||||
const assertType = (_value) => { };
|
||||
const BytesVal = new Uint8Array();
|
||||
const BigIntVal = BigInt(0);
|
||||
const StringVal = 'string';
|
||||
StringVal;
|
||||
const _a = Uint8Array.from([]);
|
||||
_a;
|
||||
// IsEmptyArray
|
||||
const isEmpty = (a) => a;
|
||||
assertType(isEmpty([]));
|
||||
assertType(isEmpty([1]));
|
||||
assertType(isEmpty(['a', 2]));
|
||||
assertType(isEmpty(['a']));
|
||||
assertType(isEmpty([]));
|
||||
assertType(isEmpty([]));
|
||||
assertType(isEmpty([]));
|
||||
assertType(isEmpty([]));
|
||||
assertType(isEmpty([]));
|
||||
assertType(isEmpty([]));
|
||||
assertType(isEmpty([]));
|
||||
assertType(isEmpty(undefined));
|
||||
const t = [
|
||||
{
|
||||
type: 'constructor',
|
||||
inputs: [{ name: 'a', type: 'uint256' }],
|
||||
stateMutability: 'nonpayable',
|
||||
},
|
||||
];
|
||||
assertType(isEmpty(t));
|
||||
// Tests
|
||||
assertType(abi.mapComponent({ type: 'string' }));
|
||||
assertType(abi.mapComponent({ type: 'string[]' }));
|
||||
assertType(abi.mapComponent({ type: 'bytes' }));
|
||||
assertType(abi.mapComponent({ type: 'bytes[]' }));
|
||||
assertType(abi.mapComponent({ type: 'address' }));
|
||||
assertType(abi.mapComponent({ type: 'address[]' }));
|
||||
assertType(abi.mapComponent({ type: 'bool' }));
|
||||
assertType(abi.mapComponent({ type: 'bool[]' }));
|
||||
assertType(abi.mapComponent({ type: 'uint16' }));
|
||||
assertType(abi.mapComponent({ type: 'uint16[]' }));
|
||||
assertType(abi.mapComponent({ type: 'int' }));
|
||||
assertType(abi.mapComponent({ type: 'int[]' }));
|
||||
assertType(abi.mapComponent({ type: 'int24' }));
|
||||
assertType(abi.mapComponent({ type: 'int24[]' }));
|
||||
assertType(abi.mapComponent({ type: 'bytes1' }));
|
||||
assertType(abi.mapComponent({ type: 'bytes1[]' }));
|
||||
assertType(abi.mapComponent({ type: 'bytes15' }));
|
||||
assertType(abi.mapComponent({ type: 'bytes15[]' }));
|
||||
// Tuples
|
||||
assertType(abi.mapComponent({
|
||||
type: 'tuple',
|
||||
components: [
|
||||
{ type: 'uint16', name: 'lol' },
|
||||
{ type: 'string', name: 'wut' },
|
||||
],
|
||||
}));
|
||||
assertType(abi.mapComponent({
|
||||
type: 'tuple',
|
||||
components: [{ type: 'uint16', name: 'lol' }, { type: 'string' }],
|
||||
}));
|
||||
//
|
||||
assertType(abi.mapComponent({ type: 'tuple' }));
|
||||
assertType(abi.mapComponent({ type: 'int25' }));
|
||||
assertType(abi.mapComponent({ type: 'bytes0' }));
|
||||
// Args
|
||||
// If single arg -- use as is
|
||||
assertType(BytesVal);
|
||||
// no names -> tuple
|
||||
assertType([BytesVal, BigIntVal]);
|
||||
// has names -> struct
|
||||
assertType({
|
||||
lol: BytesVal,
|
||||
wut: BigIntVal,
|
||||
});
|
||||
// WHY?!
|
||||
assertType(abi.mapArgs([{ type: 'string' }]));
|
||||
assertType(abi.mapArgs([{ type: 'bytes1' }]));
|
||||
assertType(abi.mapArgs([{ type: 'string' }, { type: 'uint' }]));
|
||||
assertType(abi.mapArgs([
|
||||
{ type: 'string', name: 'lol' },
|
||||
{ type: 'uint', name: 'wut' },
|
||||
]));
|
||||
// Without const
|
||||
assertType(abi.mapArgs([
|
||||
{ type: 'string', name: 'lol' },
|
||||
{ type: 'uint', name: 'wut' },
|
||||
]));
|
||||
assertType(abi.mapArgs([{ type: 'string' }, { type: 'uint' }]));
|
||||
// unfortunately, typescript cannot detect single value arr on non-const data
|
||||
assertType(abi.mapArgs([{ type: 'bytes1' }]));
|
||||
assertType(abi.createContract([
|
||||
{
|
||||
name: 'lol',
|
||||
type: 'function',
|
||||
inputs: [{ type: 'uint' }, { type: 'string' }],
|
||||
outputs: [{ type: 'bytes' }, { type: 'address' }],
|
||||
},
|
||||
]));
|
||||
assertType(abi.createContract([
|
||||
{
|
||||
name: 'lol',
|
||||
type: 'function',
|
||||
outputs: [{ type: 'bytes' }, { type: 'address' }],
|
||||
},
|
||||
]));
|
||||
assertType(abi.createContract([
|
||||
{
|
||||
name: 'lol',
|
||||
type: 'function',
|
||||
inputs: [],
|
||||
outputs: [{ type: 'bytes' }, { type: 'address' }],
|
||||
},
|
||||
]));
|
||||
assertType(abi.createContract([
|
||||
{
|
||||
name: 'lol',
|
||||
type: 'function',
|
||||
inputs: [{ type: 'uint' }, { type: 'string' }],
|
||||
outputs: [{ type: 'bytes' }, { type: 'address' }],
|
||||
},
|
||||
], 1));
|
||||
// Without const there is not much can be derived from abi
|
||||
assertType(abi.createContract([
|
||||
{
|
||||
name: 'lol',
|
||||
type: 'function',
|
||||
inputs: [{ type: 'uint' }, { type: 'string' }],
|
||||
outputs: [{ type: 'bytes' }, { type: 'address' }],
|
||||
},
|
||||
]));
|
||||
const PAIR_CONTRACT = [
|
||||
{
|
||||
type: 'function',
|
||||
name: 'getReserves',
|
||||
outputs: [
|
||||
{ name: 'reserve0', type: 'uint112' },
|
||||
{ name: 'reserve1', type: 'uint112' },
|
||||
{ name: 'blockTimestampLast', type: 'uint32' },
|
||||
],
|
||||
},
|
||||
];
|
||||
assertType(abi.createContract(PAIR_CONTRACT));
|
||||
const TRANSFER_EVENT = [
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{ indexed: true, name: 'from', type: 'address' },
|
||||
{ indexed: true, name: 'to', type: 'address' },
|
||||
{ indexed: false, name: 'value', type: 'uint256' },
|
||||
],
|
||||
name: 'Transfer',
|
||||
type: 'event',
|
||||
},
|
||||
];
|
||||
assertType(abi.events(TRANSFER_EVENT));
|
||||
// Typed data
|
||||
const types = {
|
||||
Person: [
|
||||
{ name: 'name', type: 'string' },
|
||||
{ name: 'wallet', type: 'address' },
|
||||
],
|
||||
Mail: [
|
||||
{ name: 'from', type: 'Person' },
|
||||
{ name: 'to', type: 'Person' },
|
||||
{ name: 'contents', type: 'string' },
|
||||
],
|
||||
Group: [
|
||||
{ name: 'members', type: 'Person[]' },
|
||||
{ name: 'owner', type: 'Person' },
|
||||
],
|
||||
Complex0: [
|
||||
{ name: 'data', type: 'string[][]' }, // Complex array type
|
||||
{ name: 'info', type: 'Mail' },
|
||||
],
|
||||
Complex1: [
|
||||
{ name: 'data', type: 'string[][][]' }, // Complex array type
|
||||
{ name: 'info', type: 'Mail' },
|
||||
],
|
||||
Complex: [
|
||||
{ name: 'data', type: 'string[][3][]' }, // Complex array type
|
||||
{ name: 'info', type: 'Mail' },
|
||||
],
|
||||
};
|
||||
assertType(1);
|
||||
assertType(1);
|
||||
assertType(1);
|
||||
assertType(1);
|
||||
assertType(1);
|
||||
assertType(1);
|
||||
const recursiveTypes = {
|
||||
Node: [
|
||||
{ name: 'value', type: 'string' },
|
||||
{ name: 'children', type: 'Node[]' },
|
||||
],
|
||||
};
|
||||
assertType(1);
|
||||
// const e = typed.encoder(types);
|
||||
// e.encodeData('Person', { name: 'test', wallet: 'x' });
|
||||
// e.sign({ primaryType: 'Person', message: { name: 'test', wallet: 'x' }, domain: {} }, '');
|
||||
// e.encodeData('Person', { name: 'test', wallet: 1n }); // should fail
|
||||
// e.sign({ primaryType: 'Person', message: {name: 'test'}, domain: {} }, ''); // should fail
|
||||
// e.sign({ primaryType: 'Person', message: {name: 'test', wallet: '', s: 3}, domain: {} }, ''); // should fail
|
||||
// constructor
|
||||
abi.deployContract([{ type: 'constructor', inputs: [], stateMutability: 'nonpayable' }], '0x00');
|
||||
abi.deployContract([{ type: 'constructor', stateMutability: 'nonpayable' }], '0x00');
|
||||
// abi.deployContract(
|
||||
// [{ type: 'constructor', stateMutability: 'nonpayable' }] as const,
|
||||
// '0x00',
|
||||
// undefined
|
||||
// ); // should fail!
|
||||
abi.deployContract([{ type: 'constructor', stateMutability: 'nonpayable' }], '0x00', undefined); // if we cannot infer type - it will be 'unknown' (and user forced to provide any argument, undefined is ok)
|
||||
abi.deployContract([
|
||||
{
|
||||
type: 'constructor',
|
||||
inputs: [{ name: 'a', type: 'uint256' }],
|
||||
stateMutability: 'nonpayable',
|
||||
},
|
||||
], '0x00', BigInt(100));
|
||||
abi.deployContract([
|
||||
{
|
||||
type: 'constructor',
|
||||
inputs: [{ name: 'a', type: 'uint256' }],
|
||||
stateMutability: 'nonpayable',
|
||||
},
|
||||
], '0x00', BigInt(100));
|
||||
//# sourceMappingURL=_type_test.js.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/_type_test.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/_type_test.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
5
dev/env/node_modules/micro-eth-signer/esm/abi/common.d.ts
generated
vendored
Executable file
5
dev/env/node_modules/micro-eth-signer/esm/abi/common.d.ts
generated
vendored
Executable file
@@ -0,0 +1,5 @@
|
||||
import type { ContractABI, HintFn, HookFn } from './decoder.ts';
|
||||
export declare function addHint<T extends ContractABI>(abi: ContractABI, name: string, fn: HintFn): T;
|
||||
export declare function addHints<T extends ContractABI>(abi: T, map: Record<string, HintFn>): T;
|
||||
export declare function addHook<T extends ContractABI>(abi: T, name: string, fn: HookFn): T;
|
||||
//# sourceMappingURL=common.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/abi/common.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/abi/common.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/abi/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEhE,wBAAgB,OAAO,CAAC,CAAC,SAAS,WAAW,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC,CAO5F;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAQtF;AAED,wBAAgB,OAAO,CAAC,CAAC,SAAS,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC,CAOlF"}
|
||||
32
dev/env/node_modules/micro-eth-signer/esm/abi/common.js
generated
vendored
Executable file
32
dev/env/node_modules/micro-eth-signer/esm/abi/common.js
generated
vendored
Executable file
@@ -0,0 +1,32 @@
|
||||
export function addHint(abi, name, fn) {
|
||||
const res = [];
|
||||
for (const elm of abi) {
|
||||
if (elm.name === name)
|
||||
res.push({ ...elm, hint: fn });
|
||||
else
|
||||
res.push(elm);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
export function addHints(abi, map) {
|
||||
const res = [];
|
||||
for (const elm of abi) {
|
||||
if (['event', 'function'].includes(elm.type) && elm.name && map[elm.name]) {
|
||||
res.push({ ...elm, hint: map[elm.name] });
|
||||
}
|
||||
else
|
||||
res.push(elm);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
export function addHook(abi, name, fn) {
|
||||
const res = [];
|
||||
for (const elm of abi) {
|
||||
if (elm.type === 'function' && elm.name === name)
|
||||
res.push({ ...elm, hook: fn });
|
||||
else
|
||||
res.push(elm);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
//# sourceMappingURL=common.js.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/abi/common.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/abi/common.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/abi/common.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,OAAO,CAAwB,GAAgB,EAAE,IAAY,EAAE,EAAU;IACvF,MAAM,GAAG,GAAG,EAAE,CAAC;IACf,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI;YAAE,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;;YACjD,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,GAAmB,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,QAAQ,CAAwB,GAAM,EAAE,GAA2B;IACjF,MAAM,GAAG,GAAG,EAAE,CAAC;IACf,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1E,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,CAAC,CAAC;QAC7C,CAAC;;YAAM,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,GAAmB,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,OAAO,CAAwB,GAAM,EAAE,IAAY,EAAE,EAAU;IAC7E,MAAM,GAAG,GAAG,EAAE,CAAC;IACf,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,IAAI,GAAG,CAAC,IAAI,KAAK,UAAU,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI;YAAE,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;;YAC5E,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,GAAmB,CAAC;AAC7B,CAAC"}
|
||||
167
dev/env/node_modules/micro-eth-signer/esm/abi/decoder.d.ts
generated
vendored
Executable file
167
dev/env/node_modules/micro-eth-signer/esm/abi/decoder.d.ts
generated
vendored
Executable file
@@ -0,0 +1,167 @@
|
||||
import * as P from 'micro-packed';
|
||||
import { type IWeb3Provider } from '../utils.ts';
|
||||
type Writable<T> = T extends {} ? {
|
||||
-readonly [P in keyof T]: Writable<T[P]>;
|
||||
} : T;
|
||||
type ArrLike<T> = Array<T> | ReadonlyArray<T>;
|
||||
export type IsEmptyArray<T> = T extends ReadonlyArray<any> ? (T['length'] extends 0 ? true : false) : true;
|
||||
export type Component<T extends string> = {
|
||||
readonly name?: string;
|
||||
readonly type: T;
|
||||
};
|
||||
export type NamedComponent<T extends string> = Component<T> & {
|
||||
readonly name: string;
|
||||
};
|
||||
export type BaseComponent = Component<string>;
|
||||
export type Tuple<TC extends ArrLike<Component<string>>> = {
|
||||
readonly name?: string;
|
||||
readonly type: 'tuple';
|
||||
readonly components: TC;
|
||||
};
|
||||
type IntIdxType = '' | '8' | '16' | '24' | '32' | '40' | '48' | '56' | '64' | '72' | '80' | '88' | '96' | '104' | '112' | '120' | '128' | '136' | '144' | '152' | '160' | '168' | '176' | '184' | '192' | '200' | '208' | '216' | '224' | '232' | '240' | '248' | '256';
|
||||
type UintType = `uint${IntIdxType}`;
|
||||
type IntType = `int${IntIdxType}`;
|
||||
type NumberType = UintType | IntType;
|
||||
type ByteIdxType = '' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '13' | '14' | '15' | '16' | '17' | '18' | '19' | '20' | '21' | '22' | '23' | '24' | '25' | '26' | '27' | '28' | '29' | '30' | '31' | '32';
|
||||
type ByteType = `bytes${ByteIdxType}`;
|
||||
export type MapTuple<T> = T extends ArrLike<Component<string> & {
|
||||
name: string;
|
||||
}> ? {
|
||||
[K in T[number] as K['name']]: MapType<K>;
|
||||
} : T extends ArrLike<Component<string>> ? {
|
||||
[K in keyof T]: T[K] extends BaseComponent ? MapType<T[K]> : unknown;
|
||||
} : unknown;
|
||||
export type GetType<T extends string> = T extends `${infer Base}[]${infer Rest}` ? GetType<`${Base}${Rest}`>[] : T extends `${infer Base}[${number}]${infer Rest}` ? GetType<`${Base}${Rest}`>[] : T extends 'address' ? string : T extends 'string' ? string : T extends 'bool' ? boolean : T extends NumberType ? bigint : T extends ByteType ? Uint8Array : unknown;
|
||||
export type MapType<T extends BaseComponent> = T extends Tuple<Array<Component<string>>> ? MapTuple<T['components']> : T extends Component<infer Type> ? GetType<Type> : unknown;
|
||||
export type UnmapType<T> = T extends MapType<infer U> ? U : never;
|
||||
export declare function mapComponent<T extends BaseComponent>(c: T): P.CoderType<MapType<Writable<T>>>;
|
||||
export type ArgsType<T extends ReadonlyArray<any> | undefined> = IsEmptyArray<T> extends true ? undefined : T extends ReadonlyArray<any> ? T['length'] extends 1 ? MapType<T[0]> : MapTuple<T> : MapTuple<T>;
|
||||
export declare function mapArgs<T extends ArrLike<Component<string>>>(args: T): P.CoderType<ArgsType<Writable<T>>>;
|
||||
export type FunctionType = Component<'function'> & {
|
||||
readonly inputs?: ReadonlyArray<Component<string>>;
|
||||
readonly outputs?: ReadonlyArray<Component<string>>;
|
||||
};
|
||||
type ContractMethodDecode<T extends FunctionType, O = ArgsType<T['outputs']>> = IsEmptyArray<T['outputs']> extends true ? {
|
||||
decodeOutput: (b: Uint8Array) => void;
|
||||
} : {
|
||||
decodeOutput: (b: Uint8Array) => O;
|
||||
};
|
||||
type ContractMethodEncode<T extends FunctionType, I = ArgsType<T['inputs']>> = IsEmptyArray<T['inputs']> extends true ? {
|
||||
encodeInput: () => Uint8Array;
|
||||
} : {
|
||||
encodeInput: (v: I) => Uint8Array;
|
||||
};
|
||||
type ContractMethodGas<T extends FunctionType, I = ArgsType<T['inputs']>> = IsEmptyArray<T['inputs']> extends true ? {
|
||||
estimateGas: () => Promise<bigint>;
|
||||
} : {
|
||||
estimateGas: (v: I) => Promise<bigint>;
|
||||
};
|
||||
type ContractMethodCall<T extends FunctionType, I = ArgsType<T['inputs']>, O = ArgsType<T['outputs']>> = IsEmptyArray<T['inputs']> extends true ? IsEmptyArray<T['outputs']> extends true ? {
|
||||
call: () => Promise<void>;
|
||||
} : {
|
||||
call: () => Promise<O>;
|
||||
} : IsEmptyArray<T['outputs']> extends true ? {
|
||||
call: (v: I) => Promise<void>;
|
||||
} : {
|
||||
call: (v: I) => Promise<O>;
|
||||
};
|
||||
export type ContractMethod<T extends FunctionType> = ContractMethodEncode<T> & ContractMethodDecode<T>;
|
||||
export type ContractMethodNet<T extends FunctionType> = ContractMethod<T> & ContractMethodGas<T> & ContractMethodCall<T>;
|
||||
export type FnArg = {
|
||||
readonly type: string;
|
||||
readonly name?: string;
|
||||
readonly components?: ArrLike<FnArg>;
|
||||
readonly inputs?: ArrLike<FnArg>;
|
||||
readonly outputs?: ArrLike<FnArg>;
|
||||
readonly anonymous?: boolean;
|
||||
readonly indexed?: boolean;
|
||||
};
|
||||
export type ContractTypeFilter<T> = {
|
||||
[K in keyof T]: T[K] extends FunctionType & {
|
||||
name: string;
|
||||
} ? T[K] : never;
|
||||
};
|
||||
export type ContractType<T extends Array<FnArg>, N, F = ContractTypeFilter<T>> = F extends ArrLike<FunctionType & {
|
||||
name: string;
|
||||
}> ? {
|
||||
[K in F[number] as K['name']]: N extends IWeb3Provider ? ContractMethodNet<K> : ContractMethod<K>;
|
||||
} : never;
|
||||
export declare function evSigHash(o: FnArg): string;
|
||||
export declare function fnSigHash(o: FnArg): string;
|
||||
export declare function createContract<T extends ArrLike<FnArg>>(abi: T, net: IWeb3Provider, contract?: string): ContractType<Writable<T>, IWeb3Provider>;
|
||||
export declare function createContract<T extends ArrLike<FnArg>>(abi: T, net?: undefined, contract?: string): ContractType<Writable<T>, undefined>;
|
||||
type GetCons<T extends ArrLike<FnArg>> = Extract<T[number], {
|
||||
type: 'constructor';
|
||||
}>;
|
||||
type ConstructorType = Component<'constructor'> & {
|
||||
readonly inputs?: ReadonlyArray<Component<string>>;
|
||||
};
|
||||
type ConsArgs<T extends ConstructorType> = IsEmptyArray<T['inputs']> extends true ? undefined : ArgsType<T['inputs']>;
|
||||
export declare function deployContract<T extends ArrLike<FnArg>>(abi: T, bytecodeHex: string, ...args: GetCons<T> extends never ? [args: unknown] : ConsArgs<GetCons<T>> extends undefined ? [] : [args: ConsArgs<GetCons<T>>]): string;
|
||||
export type EventType = NamedComponent<'event'> & {
|
||||
readonly inputs: ReadonlyArray<Component<string>>;
|
||||
};
|
||||
export type ContractEventTypeFilter<T> = {
|
||||
[K in keyof T]: T[K] extends EventType ? T[K] : never;
|
||||
};
|
||||
export type TopicsValue<T> = {
|
||||
[K in keyof T]: T[K] | null;
|
||||
};
|
||||
export type EventMethod<T extends EventType> = {
|
||||
decode: (topics: string[], data: string) => ArgsType<T['inputs']>;
|
||||
topics: (values: TopicsValue<ArgsType<T['inputs']>>) => (string | null)[];
|
||||
};
|
||||
export type ContractEventType<T extends Array<FnArg>, F = ContractEventTypeFilter<T>> = F extends ArrLike<EventType> ? {
|
||||
[K in F[number] as K['name']]: EventMethod<K>;
|
||||
} : never;
|
||||
export declare function events<T extends ArrLike<FnArg>>(abi: T): ContractEventType<Writable<T>>;
|
||||
export type ContractABI = ReadonlyArray<FnArg & {
|
||||
readonly hint?: HintFn;
|
||||
readonly hook?: HookFn;
|
||||
}>;
|
||||
export type ContractInfo = {
|
||||
abi: 'ERC20' | 'ERC721' | 'ERC1155' | ContractABI;
|
||||
symbol?: string;
|
||||
decimals?: number;
|
||||
name?: string;
|
||||
price?: number;
|
||||
};
|
||||
export type HintOpt = {
|
||||
contract?: string;
|
||||
amount?: bigint;
|
||||
contractInfo?: ContractInfo;
|
||||
contracts?: Record<string, ContractInfo>;
|
||||
};
|
||||
export type HintFn = (value: unknown, opt: HintOpt) => string;
|
||||
export type HookFn = (decoder: Decoder, contract: string, info: SignatureInfo, opt: HintOpt) => SignatureInfo;
|
||||
type SignaturePacker = {
|
||||
name: string;
|
||||
signature: string;
|
||||
packer: P.CoderType<unknown>;
|
||||
hint?: HintFn;
|
||||
hook?: HookFn;
|
||||
};
|
||||
type EventSignatureDecoder = {
|
||||
name: string;
|
||||
signature: string;
|
||||
decoder: (topics: string[], _data: string) => unknown;
|
||||
hint?: HintFn;
|
||||
};
|
||||
export type SignatureInfo = {
|
||||
name: string;
|
||||
signature: string;
|
||||
value: unknown;
|
||||
hint?: string;
|
||||
};
|
||||
export declare class Decoder {
|
||||
contracts: Record<string, Record<string, SignaturePacker>>;
|
||||
sighashes: Record<string, SignaturePacker[]>;
|
||||
evContracts: Record<string, Record<string, EventSignatureDecoder>>;
|
||||
evSighashes: Record<string, EventSignatureDecoder[]>;
|
||||
add(contract: string, abi: ContractABI): void;
|
||||
method(contract: string, data: Uint8Array): string | undefined;
|
||||
decode(contract: string, _data: Uint8Array, opt: HintOpt): SignatureInfo | SignatureInfo[] | undefined;
|
||||
decodeEvent(contract: string, topics: string[], data: string, opt: HintOpt): SignatureInfo | SignatureInfo[] | undefined;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=decoder.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/abi/decoder.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/abi/decoder.d.ts.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
436
dev/env/node_modules/micro-eth-signer/esm/abi/decoder.js
generated
vendored
Executable file
436
dev/env/node_modules/micro-eth-signer/esm/abi/decoder.js
generated
vendored
Executable file
@@ -0,0 +1,436 @@
|
||||
import { keccak_256 } from '@noble/hashes/sha3';
|
||||
import { bytesToHex, concatBytes, hexToBytes } from '@noble/hashes/utils';
|
||||
import * as P from 'micro-packed';
|
||||
import { add0x, ethHex, omit, strip0x, zip, } from "../utils.js";
|
||||
/*
|
||||
There is NO network code in the file. However, a user can pass
|
||||
NetProvider instance to createContract, and the method would do
|
||||
network requests with the api.
|
||||
|
||||
There is some really crazy stuff going on here with Typescript types.
|
||||
*/
|
||||
function EPad(p) {
|
||||
return P.padLeft(32, p, P.ZeroPad);
|
||||
}
|
||||
// Main difference between regular array: length stored outside and offsets calculated without length
|
||||
function ethArray(inner) {
|
||||
return P.wrap({
|
||||
size: undefined,
|
||||
encodeStream: (w, value) => {
|
||||
U256BE_LEN.encodeStream(w, value.length);
|
||||
w.bytes(P.array(value.length, inner).encode(value));
|
||||
},
|
||||
decodeStream: (r) => P.array(U256BE_LEN.decodeStream(r), inner).decodeStream(r.offsetReader(r.pos)),
|
||||
});
|
||||
}
|
||||
const PTR = EPad(P.U32BE);
|
||||
const ARRAY_RE = /(.+)(\[(\d+)?\])$/; // TODO: is this correct?
|
||||
// Because u32 in eth is not real u32, just U256BE with limits...
|
||||
const ethInt = (bits, signed = false) => {
|
||||
if (!Number.isSafeInteger(bits) || bits <= 0 || bits % 8 !== 0 || bits > 256)
|
||||
throw new Error('ethInt: invalid numeric type');
|
||||
const _bits = BigInt(bits);
|
||||
const inner = P.bigint(32, false, signed);
|
||||
return P.validate(P.wrap({
|
||||
size: inner.size,
|
||||
encodeStream: (w, value) => inner.encodeStream(w, value),
|
||||
decodeStream: (r) => inner.decodeStream(r),
|
||||
}), (value) => {
|
||||
// TODO: validate useful for narrowing types, need to add support in types?
|
||||
if (typeof value === 'number')
|
||||
value = BigInt(value);
|
||||
P.utils.checkBounds(value, _bits, !!signed);
|
||||
return value;
|
||||
});
|
||||
};
|
||||
// Ugly hack, because tuple of pointers considered "dynamic" without any reason.
|
||||
function isDyn(args) {
|
||||
let res = false;
|
||||
if (Array.isArray(args)) {
|
||||
for (let arg of args)
|
||||
if (arg.size === undefined)
|
||||
res = true;
|
||||
}
|
||||
else {
|
||||
for (let arg in args)
|
||||
if (args[arg].size === undefined)
|
||||
res = true;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
// Re-use ptr for len. u32 should be enough.
|
||||
const U256BE_LEN = PTR;
|
||||
// NOTE: we need as const if we want to access string as values inside types :(
|
||||
export function mapComponent(c) {
|
||||
// Arrays (should be first one, since recursive)
|
||||
let m;
|
||||
if ((m = ARRAY_RE.exec(c.type))) {
|
||||
const inner = mapComponent({ ...c, type: m[1] });
|
||||
if (inner.size === 0)
|
||||
throw new Error('mapComponent: arrays of zero-size elements disabled (possible DoS attack)');
|
||||
// Static array
|
||||
if (m[3] !== undefined) {
|
||||
const m3 = Number.parseInt(m[3]);
|
||||
if (!Number.isSafeInteger(m3))
|
||||
throw new Error(`mapComponent: wrong array size=${m[3]}`);
|
||||
let out = P.array(m3, inner);
|
||||
// Static array of dynamic values should be behind pointer too, again without reason.
|
||||
if (inner.size === undefined)
|
||||
out = P.pointer(PTR, out);
|
||||
return out;
|
||||
}
|
||||
else {
|
||||
// Dynamic array
|
||||
return P.pointer(PTR, ethArray(inner));
|
||||
}
|
||||
}
|
||||
if (c.type === 'tuple') {
|
||||
const components = c.components;
|
||||
let hasNames = true;
|
||||
const args = [];
|
||||
for (let comp of components) {
|
||||
if (!comp.name)
|
||||
hasNames = false;
|
||||
args.push(mapComponent(comp));
|
||||
}
|
||||
let out;
|
||||
// If there is names for all fields -- return struct, otherwise tuple
|
||||
if (hasNames) {
|
||||
const struct = {};
|
||||
for (const arg of components) {
|
||||
if (struct[arg.name])
|
||||
throw new Error(`mapType: same field name=${arg.name}`);
|
||||
struct[arg.name] = mapComponent(arg);
|
||||
}
|
||||
out = P.struct(struct);
|
||||
}
|
||||
else
|
||||
out = P.tuple(args);
|
||||
// If tuple has dynamic elements it becomes dynamic too, without reason.
|
||||
if (isDyn(args))
|
||||
out = P.pointer(PTR, out);
|
||||
return out;
|
||||
}
|
||||
if (c.type === 'string')
|
||||
return P.pointer(PTR, P.padRight(32, P.string(U256BE_LEN), P.ZeroPad));
|
||||
if (c.type === 'bytes')
|
||||
return P.pointer(PTR, P.padRight(32, P.bytes(U256BE_LEN), P.ZeroPad));
|
||||
if (c.type === 'address')
|
||||
return EPad(P.hex(20, { isLE: false, with0x: true }));
|
||||
if (c.type === 'bool')
|
||||
return EPad(P.bool);
|
||||
if ((m = /^(u?)int([0-9]+)?$/.exec(c.type)))
|
||||
return ethInt(m[2] ? +m[2] : 256, m[1] !== 'u');
|
||||
if ((m = /^bytes([0-9]{1,2})$/.exec(c.type))) {
|
||||
const parsed = +m[1];
|
||||
if (!parsed || parsed > 32)
|
||||
throw new Error('wrong bytes<N> type');
|
||||
return P.padRight(32, P.bytes(parsed), P.ZeroPad);
|
||||
}
|
||||
throw new Error(`mapComponent: unknown component=${c}`);
|
||||
}
|
||||
// Because args and output are not tuple
|
||||
// TODO: try merge with mapComponent
|
||||
export function mapArgs(args) {
|
||||
// More ergonomic input/output
|
||||
if (args.length === 1)
|
||||
return mapComponent(args[0]);
|
||||
let hasNames = true;
|
||||
for (const arg of args)
|
||||
if (!arg.name)
|
||||
hasNames = false;
|
||||
if (hasNames) {
|
||||
const out = {};
|
||||
for (const arg of args) {
|
||||
const name = arg.name;
|
||||
if (out[name])
|
||||
throw new Error(`mapArgs: same field name=${name}`);
|
||||
out[name] = mapComponent(arg);
|
||||
}
|
||||
return P.struct(out);
|
||||
}
|
||||
else
|
||||
return P.tuple(args.map(mapComponent));
|
||||
}
|
||||
function fnSignature(o) {
|
||||
if (!o.type)
|
||||
throw new Error('ABI.fnSignature wrong argument');
|
||||
if (o.type === 'function' || o.type === 'event')
|
||||
return `${o.name || 'function'}(${(o.inputs || []).map((i) => fnSignature(i)).join(',')})`;
|
||||
if (o.type.startsWith('tuple')) {
|
||||
if (!o.components || !o.components.length)
|
||||
throw new Error('ABI.fnSignature wrong tuple');
|
||||
return `(${o.components.map((i) => fnSignature(i)).join(',')})${o.type.slice(5)}`;
|
||||
}
|
||||
return o.type;
|
||||
}
|
||||
// Function signature hash
|
||||
export function evSigHash(o) {
|
||||
return bytesToHex(keccak_256(fnSignature(o)));
|
||||
}
|
||||
export function fnSigHash(o) {
|
||||
return evSigHash(o).slice(0, 8);
|
||||
}
|
||||
export function createContract(abi, net, contract) {
|
||||
// Find non-uniq function names so we can handle overloads
|
||||
let nameCnt = {};
|
||||
for (let fn of abi) {
|
||||
if (fn.type !== 'function')
|
||||
continue;
|
||||
const name = fn.name || 'function';
|
||||
if (!nameCnt[name])
|
||||
nameCnt[name] = 1;
|
||||
else
|
||||
nameCnt[name]++;
|
||||
}
|
||||
const res = {};
|
||||
for (let fn of abi) {
|
||||
if (fn.type !== 'function')
|
||||
continue;
|
||||
let name = fn.name || 'function';
|
||||
if (nameCnt[name] > 1)
|
||||
name = fnSignature(fn);
|
||||
const sh = fnSigHash(fn);
|
||||
const inputs = fn.inputs && fn.inputs.length ? mapArgs(fn.inputs) : undefined;
|
||||
const outputs = fn.outputs ? mapArgs(fn.outputs) : undefined;
|
||||
const decodeOutput = (b) => outputs && outputs.decode(b);
|
||||
const encodeInput = (v) => concatBytes(hexToBytes(sh), inputs ? inputs.encode(v) : new Uint8Array());
|
||||
res[name] = { decodeOutput, encodeInput };
|
||||
// .call and .estimateGas call network, when net is available
|
||||
if (!net)
|
||||
continue;
|
||||
res[name].call = async (args, overrides = {}) => {
|
||||
if (!contract && !overrides.to)
|
||||
throw new Error('No contract address');
|
||||
const data = add0x(bytesToHex(encodeInput(args)));
|
||||
const callArgs = Object.assign({ to: contract, data }, overrides);
|
||||
return decodeOutput(hexToBytes(strip0x(await net.ethCall(callArgs))));
|
||||
};
|
||||
res[name].estimateGas = async (args, overrides = {}) => {
|
||||
if (!contract && !overrides.to)
|
||||
throw new Error('No contract address');
|
||||
const data = add0x(bytesToHex(encodeInput(args)));
|
||||
const callArgs = Object.assign({ to: contract, data }, overrides);
|
||||
return await net.estimateGas(callArgs);
|
||||
};
|
||||
}
|
||||
return res;
|
||||
}
|
||||
export function deployContract(abi, bytecodeHex, ...args) {
|
||||
const bytecode = ethHex.decode(bytecodeHex);
|
||||
let consCall;
|
||||
for (let fn of abi) {
|
||||
if (fn.type !== 'constructor')
|
||||
continue;
|
||||
const inputs = fn.inputs && fn.inputs.length ? mapArgs(fn.inputs) : undefined;
|
||||
if (inputs === undefined && args !== undefined && args.length)
|
||||
throw new Error('arguments to constructor without any');
|
||||
consCall = inputs ? inputs.encode(args[0]) : new Uint8Array();
|
||||
}
|
||||
if (!consCall)
|
||||
throw new Error('constructor not found');
|
||||
return ethHex.encode(concatBytes(bytecode, consCall));
|
||||
}
|
||||
// TODO: try to simplify further
|
||||
export function events(abi) {
|
||||
let res = {};
|
||||
for (let elm of abi) {
|
||||
// Only named events supported
|
||||
if (elm.type !== 'event' || !elm.name)
|
||||
continue;
|
||||
const inputs = elm.inputs || [];
|
||||
let hasNames = true;
|
||||
for (let i of inputs)
|
||||
if (!i.name)
|
||||
hasNames = false;
|
||||
const plainInp = inputs.filter((i) => !i.indexed);
|
||||
const indexedInp = inputs.filter((i) => i.indexed);
|
||||
const indexed = indexedInp.map((i) => !['string', 'bytes', 'tuple'].includes(i.type) && !ARRAY_RE.exec(i.type)
|
||||
? mapArgs([i])
|
||||
: null);
|
||||
const parser = mapArgs(hasNames ? plainInp : plainInp.map((i) => omit(i, 'name')));
|
||||
const sigHash = evSigHash(elm);
|
||||
res[elm.name] = {
|
||||
decode(topics, _data) {
|
||||
const data = hexToBytes(strip0x(_data));
|
||||
if (!elm.anonymous) {
|
||||
if (!topics[0])
|
||||
throw new Error('No signature on non-anonymous event');
|
||||
if (strip0x(topics[0]).toLowerCase() !== sigHash)
|
||||
throw new Error('Wrong signature');
|
||||
topics = topics.slice(1);
|
||||
}
|
||||
if (topics.length !== indexed.length)
|
||||
throw new Error('Wrong topics length');
|
||||
let parsed = parser ? parser.decode(data) : hasNames ? {} : [];
|
||||
const indexedParsed = indexed.map((p, i) => p ? p.decode(hexToBytes(strip0x(topics[i]))) : topics[i]);
|
||||
if (plainInp.length === 1)
|
||||
parsed = hasNames ? { [plainInp[0].name]: parsed } : [parsed];
|
||||
if (hasNames) {
|
||||
let res = { ...parsed };
|
||||
for (let [a, p] of zip(indexedInp, indexedParsed))
|
||||
res[a.name] = p;
|
||||
return res;
|
||||
}
|
||||
else
|
||||
return inputs.map((i) => (!i.indexed ? parsed : indexedParsed).shift());
|
||||
},
|
||||
topics(values) {
|
||||
let res = [];
|
||||
if (!elm.anonymous)
|
||||
res.push(add0x(sigHash));
|
||||
// We require all keys to be set, even if they are null, to be sure nothing is accidentaly missed
|
||||
if ((hasNames ? Object.keys(values) : values).length !== inputs.length)
|
||||
throw new Error('Wrong topics args');
|
||||
for (let i = 0, ii = 0; i < inputs.length && ii < indexed.length; i++) {
|
||||
const [input, packer] = [inputs[i], indexed[ii]];
|
||||
if (!input.indexed)
|
||||
continue;
|
||||
const value = values[Array.isArray(values) ? i : inputs[i].name];
|
||||
if (value === null) {
|
||||
res.push(null);
|
||||
continue;
|
||||
}
|
||||
let topic;
|
||||
if (packer)
|
||||
topic = bytesToHex(packer.encode(value));
|
||||
else if (['string', 'bytes'].includes(input.type))
|
||||
topic = bytesToHex(keccak_256(value));
|
||||
else {
|
||||
let m, parts;
|
||||
if ((m = ARRAY_RE.exec(input.type)))
|
||||
parts = value.map((j) => mapComponent({ type: m[1] }).encode(j));
|
||||
else if (input.type === 'tuple' && input.components)
|
||||
parts = input.components.map((j) => mapArgs([j]).encode(value[j.name]));
|
||||
else
|
||||
throw new Error('Unknown unsized type');
|
||||
topic = bytesToHex(keccak_256(concatBytes(...parts)));
|
||||
}
|
||||
res.push(add0x(topic));
|
||||
ii++;
|
||||
}
|
||||
return res;
|
||||
},
|
||||
};
|
||||
}
|
||||
return res;
|
||||
}
|
||||
export class Decoder {
|
||||
constructor() {
|
||||
this.contracts = {};
|
||||
this.sighashes = {};
|
||||
this.evContracts = {};
|
||||
this.evSighashes = {};
|
||||
}
|
||||
add(contract, abi) {
|
||||
const ev = events(abi);
|
||||
contract = strip0x(contract).toLowerCase();
|
||||
if (!this.contracts[contract])
|
||||
this.contracts[contract] = {};
|
||||
if (!this.evContracts[contract])
|
||||
this.evContracts[contract] = {};
|
||||
for (let fn of abi) {
|
||||
if (fn.type === 'function') {
|
||||
const selector = fnSigHash(fn);
|
||||
const value = {
|
||||
name: fn.name || 'function',
|
||||
signature: fnSignature(fn),
|
||||
packer: fn.inputs && fn.inputs.length ? mapArgs(fn.inputs) : undefined,
|
||||
hint: fn.hint,
|
||||
hook: fn.hook,
|
||||
};
|
||||
this.contracts[contract][selector] = value;
|
||||
if (!this.sighashes[selector])
|
||||
this.sighashes[selector] = [];
|
||||
this.sighashes[selector].push(value);
|
||||
}
|
||||
else if (fn.type === 'event') {
|
||||
if (fn.anonymous || !fn.name)
|
||||
continue;
|
||||
const selector = evSigHash(fn);
|
||||
const value = {
|
||||
name: fn.name,
|
||||
signature: fnSignature(fn),
|
||||
decoder: ev[fn.name]?.decode,
|
||||
hint: fn.hint,
|
||||
};
|
||||
this.evContracts[contract][selector] = value;
|
||||
if (!this.evSighashes[selector])
|
||||
this.evSighashes[selector] = [];
|
||||
this.evSighashes[selector].push(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
method(contract, data) {
|
||||
contract = strip0x(contract).toLowerCase();
|
||||
const sh = bytesToHex(data.slice(0, 4));
|
||||
if (!this.contracts[contract] || !this.contracts[contract][sh])
|
||||
return;
|
||||
const { name } = this.contracts[contract][sh];
|
||||
return name;
|
||||
}
|
||||
// Returns: exact match, possible options of matches (array) or undefined.
|
||||
// Note that empty value possible if there is no arguments in call.
|
||||
decode(contract, _data, opt) {
|
||||
contract = strip0x(contract).toLowerCase();
|
||||
const sh = bytesToHex(_data.slice(0, 4));
|
||||
const data = _data.slice(4);
|
||||
if (this.contracts[contract] && this.contracts[contract][sh]) {
|
||||
let { name, signature, packer, hint, hook } = this.contracts[contract][sh];
|
||||
const value = packer ? packer.decode(data) : undefined;
|
||||
let res = { name, signature, value };
|
||||
// NOTE: hint && hook fn is used only on exact match of contract!
|
||||
if (hook)
|
||||
res = hook(this, contract, res, opt);
|
||||
try {
|
||||
if (hint)
|
||||
res.hint = hint(value, Object.assign({ contract: add0x(contract) }, opt));
|
||||
}
|
||||
catch (e) { }
|
||||
return res;
|
||||
}
|
||||
if (!this.sighashes[sh] || !this.sighashes[sh].length)
|
||||
return;
|
||||
let res = [];
|
||||
for (let { name, signature, packer } of this.sighashes[sh]) {
|
||||
try {
|
||||
res.push({ name, signature, value: packer ? packer.decode(data) : undefined });
|
||||
}
|
||||
catch (err) { }
|
||||
}
|
||||
if (res.length)
|
||||
return res;
|
||||
return;
|
||||
}
|
||||
decodeEvent(contract, topics, data, opt) {
|
||||
contract = strip0x(contract).toLowerCase();
|
||||
if (!topics.length)
|
||||
return;
|
||||
const sh = strip0x(topics[0]);
|
||||
const event = this.evContracts[contract];
|
||||
if (event && event[sh]) {
|
||||
let { name, signature, decoder, hint } = event[sh];
|
||||
const value = decoder(topics, data);
|
||||
let res = { name, signature, value };
|
||||
try {
|
||||
if (hint)
|
||||
res.hint = hint(value, Object.assign({ contract: add0x(contract) }, opt));
|
||||
}
|
||||
catch (e) { }
|
||||
return res;
|
||||
}
|
||||
if (!this.evSighashes[sh] || !this.evSighashes[sh].length)
|
||||
return;
|
||||
let res = [];
|
||||
for (let { name, signature, decoder } of this.evSighashes[sh]) {
|
||||
try {
|
||||
res.push({ name, signature, value: decoder(topics, data) });
|
||||
}
|
||||
catch (err) { }
|
||||
}
|
||||
if (res.length)
|
||||
return res;
|
||||
return;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=decoder.js.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/abi/decoder.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/abi/decoder.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
189
dev/env/node_modules/micro-eth-signer/esm/abi/erc1155.d.ts
generated
vendored
Executable file
189
dev/env/node_modules/micro-eth-signer/esm/abi/erc1155.d.ts
generated
vendored
Executable file
@@ -0,0 +1,189 @@
|
||||
declare const ABI: readonly [{
|
||||
readonly name: "ApprovalForAll";
|
||||
readonly type: "event";
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "account";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "operator";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "approved";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "TransferBatch";
|
||||
readonly type: "event";
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "operator";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "ids";
|
||||
readonly type: "uint256[]";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "values";
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "TransferSingle";
|
||||
readonly type: "event";
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "operator";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "id";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "URI";
|
||||
readonly type: "event";
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: false;
|
||||
readonly name: "value";
|
||||
readonly type: "string";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "id";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "balanceOf";
|
||||
readonly type: "function";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "account";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "id";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "balanceOfBatch";
|
||||
readonly type: "function";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "accounts";
|
||||
readonly type: "address[]";
|
||||
}, {
|
||||
readonly name: "ids";
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "isApprovedForAll";
|
||||
readonly type: "function";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "account";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "operator";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "safeBatchTransferFrom";
|
||||
readonly type: "function";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "ids";
|
||||
readonly type: "uint256[]";
|
||||
}, {
|
||||
readonly name: "amounts";
|
||||
readonly type: "uint256[]";
|
||||
}, {
|
||||
readonly name: "data";
|
||||
readonly type: "bytes";
|
||||
}];
|
||||
readonly outputs: readonly [];
|
||||
}, {
|
||||
readonly name: "safeTransferFrom";
|
||||
readonly type: "function";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "id";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "amount";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "data";
|
||||
readonly type: "bytes";
|
||||
}];
|
||||
readonly outputs: readonly [];
|
||||
}, {
|
||||
readonly name: "setApprovalForAll";
|
||||
readonly type: "function";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "operator";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "approved";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
readonly outputs: readonly [];
|
||||
}, {
|
||||
readonly name: "supportsInterface";
|
||||
readonly type: "function";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "interfaceId";
|
||||
readonly type: "bytes4";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "uri";
|
||||
readonly type: "function";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "id";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "string";
|
||||
}];
|
||||
}];
|
||||
export default ABI;
|
||||
//# sourceMappingURL=erc1155.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/abi/erc1155.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/abi/erc1155.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"erc1155.d.ts","sourceRoot":"","sources":["../../src/abi/erc1155.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEC,CAAC;AAEX,eAAe,GAAG,CAAC"}
|
||||
7
dev/env/node_modules/micro-eth-signer/esm/abi/erc1155.js
generated
vendored
Executable file
7
dev/env/node_modules/micro-eth-signer/esm/abi/erc1155.js
generated
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
// Multi Token Standard https://eips.ethereum.org/EIPS/eip-1155
|
||||
// prettier-ignore
|
||||
const ABI = [
|
||||
{ name: 'ApprovalForAll', type: 'event', inputs: [{ indexed: true, name: 'account', type: 'address' }, { indexed: true, name: 'operator', type: 'address' }, { indexed: false, name: 'approved', type: 'bool' },], }, { name: 'TransferBatch', type: 'event', inputs: [{ indexed: true, name: 'operator', type: 'address' }, { indexed: true, name: 'from', type: 'address' }, { indexed: true, name: 'to', type: 'address' }, { indexed: false, name: 'ids', type: 'uint256[]' }, { indexed: false, name: 'values', type: 'uint256[]' },], }, { name: 'TransferSingle', type: 'event', inputs: [{ indexed: true, name: 'operator', type: 'address' }, { indexed: true, name: 'from', type: 'address' }, { indexed: true, name: 'to', type: 'address' }, { indexed: false, name: 'id', type: 'uint256' }, { indexed: false, name: 'value', type: 'uint256' },], }, { name: 'URI', type: 'event', inputs: [{ indexed: false, name: 'value', type: 'string' }, { indexed: true, name: 'id', type: 'uint256' },], }, { name: 'balanceOf', type: 'function', inputs: [{ name: 'account', type: 'address' }, { name: 'id', type: 'uint256' },], outputs: [{ type: 'uint256' }], }, { name: 'balanceOfBatch', type: 'function', inputs: [{ name: 'accounts', type: 'address[]' }, { name: 'ids', type: 'uint256[]' },], outputs: [{ type: 'uint256[]' }], }, { name: 'isApprovedForAll', type: 'function', inputs: [{ name: 'account', type: 'address' }, { name: 'operator', type: 'address' },], outputs: [{ type: 'bool' }], }, { name: 'safeBatchTransferFrom', type: 'function', inputs: [{ name: 'from', type: 'address' }, { name: 'to', type: 'address' }, { name: 'ids', type: 'uint256[]' }, { name: 'amounts', type: 'uint256[]' }, { name: 'data', type: 'bytes' },], outputs: [], }, { name: 'safeTransferFrom', type: 'function', inputs: [{ name: 'from', type: 'address' }, { name: 'to', type: 'address' }, { name: 'id', type: 'uint256' }, { name: 'amount', type: 'uint256' }, { name: 'data', type: 'bytes' },], outputs: [], }, { name: 'setApprovalForAll', type: 'function', inputs: [{ name: 'operator', type: 'address' }, { name: 'approved', type: 'bool' },], outputs: [], }, { name: 'supportsInterface', type: 'function', inputs: [{ name: 'interfaceId', type: 'bytes4' }], outputs: [{ type: 'bool' }], }, { name: 'uri', type: 'function', inputs: [{ name: 'id', type: 'uint256' }], outputs: [{ type: 'string' }] }
|
||||
];
|
||||
export default ABI;
|
||||
//# sourceMappingURL=erc1155.js.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/abi/erc1155.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/abi/erc1155.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"erc1155.js","sourceRoot":"","sources":["../../src/abi/erc1155.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,kBAAkB;AAClB,MAAM,GAAG,GAAG;IACV,EAAC,IAAI,EAAC,gBAAgB,EAAC,IAAI,EAAC,OAAO,EAAC,MAAM,EAAC,CAAC,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,OAAO,EAAC,KAAK,EAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,MAAM,EAAC,EAAE,GA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executable file
@@ -0,0 +1,308 @@
|
||||
import { type HintOpt } from './decoder.ts';
|
||||
export declare const ABI: readonly [{
|
||||
readonly type: "function";
|
||||
readonly name: "name";
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "string";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "totalSupply";
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "decimals";
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint8";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "symbol";
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "string";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "approve";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "spender";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "success";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "transferFrom";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "success";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "balances";
|
||||
readonly inputs: readonly [{
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "allowed";
|
||||
readonly inputs: readonly [{
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "balanceOf";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "balance";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "transfer";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "success";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "allowance";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "spender";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "remaining";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "Approval";
|
||||
readonly type: "event";
|
||||
readonly anonymous: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "spender";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "Transfer";
|
||||
readonly type: "event";
|
||||
readonly anonymous: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}];
|
||||
export declare const hints: {
|
||||
approve(v: any, opt: HintOpt): string;
|
||||
transferFrom(v: any, opt: HintOpt): string;
|
||||
transfer(v: any, opt: HintOpt): string;
|
||||
Approval(v: any, opt: HintOpt): string;
|
||||
Transfer(v: any, opt: HintOpt): string;
|
||||
};
|
||||
declare const ERC20ABI: readonly [{
|
||||
readonly type: "function";
|
||||
readonly name: "name";
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "string";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "totalSupply";
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "decimals";
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint8";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "symbol";
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "string";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "approve";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "spender";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "success";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "transferFrom";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "success";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "balances";
|
||||
readonly inputs: readonly [{
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "allowed";
|
||||
readonly inputs: readonly [{
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "balanceOf";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "balance";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "transfer";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "success";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "allowance";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "spender";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "remaining";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "Approval";
|
||||
readonly type: "event";
|
||||
readonly anonymous: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "spender";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "Transfer";
|
||||
readonly type: "event";
|
||||
readonly anonymous: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}];
|
||||
export default ERC20ABI;
|
||||
//# sourceMappingURL=erc20.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/abi/erc20.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/abi/erc20.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"erc20.d.ts","sourceRoot":"","sources":["../../src/abi/erc20.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEN,CAAC;AAGX,eAAO,MAAM,KAAK;eACL,GAAG,OAAO,OAAO;oBAQZ,GAAG,OAAO,OAAO;gBAQrB,GAAG,OAAO,OAAO;gBAOjB,GAAG,OAAO,OAAO;gBAOjB,GAAG,OAAO,OAAO;CAO9B,CAAC;AAEF,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAuC,CAAC;AACtD,eAAe,QAAQ,CAAC"}
|
||||
38
dev/env/node_modules/micro-eth-signer/esm/abi/erc20.js
generated
vendored
Executable file
38
dev/env/node_modules/micro-eth-signer/esm/abi/erc20.js
generated
vendored
Executable file
@@ -0,0 +1,38 @@
|
||||
import { createDecimal } from "../utils.js";
|
||||
import { addHints } from "./common.js";
|
||||
import {} from "./decoder.js";
|
||||
// prettier-ignore
|
||||
export const ABI = [
|
||||
{ type: "function", name: "name", outputs: [{ type: "string" }] }, { type: "function", name: "totalSupply", outputs: [{ type: "uint256" }] }, { type: "function", name: "decimals", outputs: [{ type: "uint8" }] }, { type: "function", name: "symbol", outputs: [{ type: "string" }] }, { type: "function", name: "approve", inputs: [{ name: "spender", type: "address" }, { name: "value", type: "uint256" }], outputs: [{ name: "success", type: "bool" }] }, { type: "function", name: "transferFrom", inputs: [{ name: "from", type: "address" }, { name: "to", type: "address" }, { name: "value", type: "uint256" }], outputs: [{ name: "success", type: "bool" }] }, { type: "function", name: "balances", inputs: [{ type: "address" }], outputs: [{ type: "uint256" }] }, { type: "function", name: "allowed", inputs: [{ type: "address" }, { type: "address" }], outputs: [{ type: "uint256" }] }, { type: "function", name: "balanceOf", inputs: [{ name: "owner", type: "address" }], outputs: [{ name: "balance", type: "uint256" }] }, { type: "function", name: "transfer", inputs: [{ name: "to", type: "address" }, { name: "value", type: "uint256" }], outputs: [{ name: "success", type: "bool" }] }, { type: "function", name: "allowance", inputs: [{ name: "owner", type: "address" }, { name: "spender", type: "address" }], outputs: [{ name: "remaining", type: "uint256" }] }, { name: "Approval", type: "event", anonymous: false, inputs: [{ indexed: true, name: "owner", type: "address" }, { indexed: true, name: "spender", type: "address" }, { indexed: false, name: "value", type: "uint256" }] }, { name: "Transfer", type: "event", anonymous: false, inputs: [{ indexed: true, name: "from", type: "address" }, { indexed: true, name: "to", type: "address" }, { indexed: false, name: "value", type: "uint256" }] }
|
||||
];
|
||||
// https://eips.ethereum.org/EIPS/eip-20
|
||||
export const hints = {
|
||||
approve(v, opt) {
|
||||
if (!opt.contractInfo || !opt.contractInfo.decimals || !opt.contractInfo.symbol)
|
||||
throw new Error('Not enough info');
|
||||
return `Allow spending ${createDecimal(opt.contractInfo.decimals).encode(v.value)} ${opt.contractInfo.symbol} by ${v.spender}`;
|
||||
},
|
||||
transferFrom(v, opt) {
|
||||
if (!opt.contractInfo || !opt.contractInfo.decimals || !opt.contractInfo.symbol)
|
||||
throw new Error('Not enough info');
|
||||
return `Transfer ${createDecimal(opt.contractInfo.decimals).encode(v.value)} ${opt.contractInfo.symbol} from ${v.from} to ${v.to}`;
|
||||
},
|
||||
transfer(v, opt) {
|
||||
if (!opt.contractInfo || !opt.contractInfo.decimals || !opt.contractInfo.symbol)
|
||||
throw new Error('Not enough info');
|
||||
return `Transfer ${createDecimal(opt.contractInfo.decimals).encode(v.value)} ${opt.contractInfo.symbol} to ${v.to}`;
|
||||
},
|
||||
Approval(v, opt) {
|
||||
if (!opt.contractInfo || !opt.contractInfo.decimals || !opt.contractInfo.symbol)
|
||||
throw new Error('Not enough info');
|
||||
return `Allow ${v.spender} spending up to ${createDecimal(opt.contractInfo.decimals).encode(v.value)} ${opt.contractInfo.symbol} from ${v.owner}`;
|
||||
},
|
||||
Transfer(v, opt) {
|
||||
if (!opt.contractInfo || !opt.contractInfo.decimals || !opt.contractInfo.symbol)
|
||||
throw new Error('Not enough info');
|
||||
return `Transfer ${createDecimal(opt.contractInfo.decimals).encode(v.value)} ${opt.contractInfo.symbol} from ${v.from} to ${v.to}`;
|
||||
},
|
||||
};
|
||||
const ERC20ABI = /* @__PURE__ */ addHints(ABI, hints);
|
||||
export default ERC20ABI;
|
||||
//# sourceMappingURL=erc20.js.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/abi/erc20.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/abi/erc20.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"erc20.js","sourceRoot":"","sources":["../../src/abi/erc20.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAgB,MAAM,cAAc,CAAC;AAE5C,kBAAkB;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AAQ,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM;YAC7E,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;QACrC,OAAO,YAAY,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IACzE,GAAG,CAAC,YAAY,CAAC,MACnB,SAAS,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC;IAC/B,CAAC;CACF,CAAC;AAEF,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AACtD,eAAe,QAAQ,CAAC"}
|
||||
220
dev/env/node_modules/micro-eth-signer/esm/abi/erc721.d.ts
generated
vendored
Executable file
220
dev/env/node_modules/micro-eth-signer/esm/abi/erc721.d.ts
generated
vendored
Executable file
@@ -0,0 +1,220 @@
|
||||
declare const ABI: readonly [{
|
||||
readonly type: "function";
|
||||
readonly name: "approve";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "approved";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "tokenId";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "balanceOf";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "ownerOf";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "tokenId";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "getApproved";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "tokenId";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "address";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "isApprovedForAll";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "operator";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "safeTransferFrom";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "tokenId";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "safeTransferFrom";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "tokenId";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "data";
|
||||
readonly type: "bytes";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "setApprovalForAll";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "operator";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "approved";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "supportsInterface";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "interfaceID";
|
||||
readonly type: "bytes4";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "transferFrom";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "tokenId";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "tokenByIndex";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "index";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "tokenOfOwnerByIndex";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "index";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "totalSupply";
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "name";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "name";
|
||||
readonly type: "string";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "symbol";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "symbol";
|
||||
readonly type: "string";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "tokenURI";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "tokenId";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "string";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "Transfer";
|
||||
readonly type: "event";
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "from";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "tokenId";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "Approval";
|
||||
readonly type: "event";
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "spender";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "tokenId";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly name: "ApprovalForAll";
|
||||
readonly type: "event";
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "owner";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "spender";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "approved";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
}];
|
||||
export default ABI;
|
||||
//# sourceMappingURL=erc721.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/abi/erc721.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/abi/erc721.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"erc721.d.ts","sourceRoot":"","sources":["../../src/abi/erc721.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEC,CAAC;AAEX,eAAe,GAAG,CAAC"}
|
||||
7
dev/env/node_modules/micro-eth-signer/esm/abi/erc721.js
generated
vendored
Executable file
7
dev/env/node_modules/micro-eth-signer/esm/abi/erc721.js
generated
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
// Non-Fungible Token Standard: https://eips.ethereum.org/EIPS/eip-721
|
||||
// prettier-ignore
|
||||
const ABI = [
|
||||
{ type: "function", name: "approve", inputs: [{ name: "approved", type: "address" }, { name: "tokenId", type: "uint256" }] }, { type: "function", name: "balanceOf", inputs: [{ name: "owner", type: "address" }], outputs: [{ type: "uint256" }] }, { type: "function", name: "ownerOf", inputs: [{ name: "tokenId", type: "uint256" }], outputs: [{ name: "owner", type: "address" }] }, { type: "function", name: "getApproved", inputs: [{ name: "tokenId", type: "uint256" }], outputs: [{ type: "address" }] }, { type: "function", name: "isApprovedForAll", inputs: [{ name: "owner", type: "address" }, { name: "operator", type: "address" }], outputs: [{ type: "bool" }] }, { type: "function", name: "safeTransferFrom", inputs: [{ name: "from", type: "address" }, { name: "to", type: "address" }, { name: "tokenId", type: "uint256" }] }, { type: "function", name: "safeTransferFrom", inputs: [{ name: "from", type: "address" }, { name: "to", type: "address" }, { name: "tokenId", type: "uint256" }, { name: "data", type: "bytes" }] }, { type: "function", name: "setApprovalForAll", inputs: [{ name: "operator", type: "address" }, { name: "approved", type: "bool" }] }, { type: "function", name: "supportsInterface", inputs: [{ name: "interfaceID", type: "bytes4" }], outputs: [{ type: "bool" }] }, { type: "function", name: "transferFrom", inputs: [{ name: "from", type: "address" }, { name: "to", type: "address" }, { name: "tokenId", type: "uint256" }] }, { type: "function", name: "tokenByIndex", inputs: [{ name: "index", type: "uint256" }], outputs: [{ type: "uint256" }] }, { type: "function", name: "tokenOfOwnerByIndex", inputs: [{ name: "owner", type: "address" }, { name: "index", type: "uint256" }], outputs: [{ type: "uint256" }] }, { type: "function", name: "totalSupply", outputs: [{ type: "uint256" }] }, { type: "function", name: "name", outputs: [{ name: "name", type: "string" }] }, { type: "function", name: "symbol", outputs: [{ name: "symbol", type: "string" }] }, { type: "function", name: "tokenURI", inputs: [{ name: "tokenId", type: "uint256" }], outputs: [{ type: "string" }] }, { name: "Transfer", type: "event", inputs: [{ indexed: true, name: "from", type: "address" }, { indexed: true, name: "to", type: "address" }, { indexed: true, name: "tokenId", type: "uint256" }] }, { name: "Approval", type: "event", inputs: [{ indexed: true, name: "owner", type: "address" }, { indexed: true, name: "spender", type: "address" }, { indexed: true, name: "tokenId", type: "uint256" }] }, { name: "ApprovalForAll", type: "event", inputs: [{ indexed: true, name: "owner", type: "address" }, { indexed: true, name: "spender", type: "address" }, { indexed: false, name: "approved", type: "bool" }] }
|
||||
];
|
||||
export default ABI;
|
||||
//# sourceMappingURL=erc721.js.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/abi/erc721.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/abi/erc721.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"erc721.js","sourceRoot":"","sources":["../../src/abi/erc721.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,kBAAkB;AAClB,MAAM,GAAG,GAAG;IACV,EAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,SAAS,EAAC,MAAM,EAAC,CAAC,EAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,IAAI,EAAC,SAAS,EAAC,IAAI,EAAC,SAAS,EAAC,CAAC,EAAC,EAAC,EAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,WAAW,EAAC,MAAM,EAAC,CAAC,EAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,SAAS,EAAC,CAAC,EAAC,OAAO,EAAC,CAAC,EAAC,IAAI,EAAC,SAAS,EAAC,CAAC,EAAC,EAAC,EAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,SAAS,EAAC,MAAM,EAAC,CAAC,EAAC,IAAI,EAAC,SAAS,EAAC,IAAI,EAAC,SAAS,EAAC,CAAC,EAAC,OAAO,EAAC,CAAC,EAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,SAAS,EAAC,CAAC,EAAC,EAAC,EAAC,IAAI,EAAC,UAAU,EAA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IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,OAAO,EAAC,KAAK,EAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,MAAM,EAAC,CAAC,EAAC;CAClvE,CAAC;AAEX,eAAe,GAAG,CAAC"}
|
||||
24
dev/env/node_modules/micro-eth-signer/esm/abi/index.d.ts
generated
vendored
Executable file
24
dev/env/node_modules/micro-eth-signer/esm/abi/index.d.ts
generated
vendored
Executable file
@@ -0,0 +1,24 @@
|
||||
import { type ContractABI, type ContractInfo, Decoder, createContract, deployContract, events } from './decoder.ts';
|
||||
import { default as ERC1155 } from './erc1155.ts';
|
||||
import { default as ERC20 } from './erc20.ts';
|
||||
import { default as ERC721 } from './erc721.ts';
|
||||
import { KYBER_NETWORK_PROXY_CONTRACT } from './kyber.ts';
|
||||
import { UNISWAP_V2_ROUTER_CONTRACT } from './uniswap-v2.ts';
|
||||
import { UNISWAP_V3_ROUTER_CONTRACT } from './uniswap-v3.ts';
|
||||
import { default as WETH } from './weth.ts';
|
||||
export { ERC1155, ERC20, ERC721, KYBER_NETWORK_PROXY_CONTRACT, UNISWAP_V2_ROUTER_CONTRACT, UNISWAP_V3_ROUTER_CONTRACT, WETH, };
|
||||
export { Decoder, createContract, deployContract, events };
|
||||
export type { ContractABI, ContractInfo };
|
||||
export declare const TOKENS: Record<string, ContractInfo>;
|
||||
export declare const CONTRACTS: Record<string, ContractInfo>;
|
||||
export declare const tokenFromSymbol: (symbol: string) => {
|
||||
contract: string;
|
||||
} & ContractInfo;
|
||||
export type DecoderOpt = {
|
||||
customContracts?: Record<string, ContractInfo>;
|
||||
noDefault?: boolean;
|
||||
};
|
||||
export declare const decodeData: (to: string, data: string, amount?: bigint, opt?: DecoderOpt) => import("./decoder.ts").SignatureInfo | import("./decoder.ts").SignatureInfo[] | undefined;
|
||||
export declare const decodeTx: (transaction: string, opt?: DecoderOpt) => import("./decoder.ts").SignatureInfo | import("./decoder.ts").SignatureInfo[] | undefined;
|
||||
export declare const decodeEvent: (to: string, topics: string[], data: string, opt?: DecoderOpt) => import("./decoder.ts").SignatureInfo | import("./decoder.ts").SignatureInfo[] | undefined;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/abi/index.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/abi/index.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/abi/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,OAAO,EACP,cAAc,EACd,cAAc,EACd,MAAM,EACP,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAkC,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAC1F,OAAO,EAAgC,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,EAAgC,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,EAAE,OAAO,IAAI,IAAI,EAAiB,MAAM,WAAW,CAAC;AAI3D,OAAO,EACL,OAAO,EACP,KAAK,EACL,MAAM,EACN,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,EAC1B,IAAI,GACL,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC;AAE3D,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;AAE1C,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAsB1C,CAAC;AAEP,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAO5C,CAAC;AAER,eAAO,MAAM,eAAe,GAC1B,QAAQ,MAAM,KACb;IACD,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,YAKH,CAAC;AAWF,MAAM,MAAM,UAAU,GAAG;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC/C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAuCF,eAAO,MAAM,UAAU,GAAI,IAAI,MAAM,EAAE,MAAM,MAAM,EAAE,SAAS,MAAM,EAAE,MAAK,UAAe,8FAWzF,CAAC;AAIF,eAAO,MAAM,QAAQ,GAAI,aAAa,MAAM,EAAE,MAAK,UAAe,8FAGjE,CAAC;AAGF,eAAO,MAAM,WAAW,GAAI,IAAI,MAAM,EAAE,QAAQ,MAAM,EAAE,EAAE,MAAM,MAAM,EAAE,MAAK,UAAe,8FAS3F,CAAC"}
|
||||
127
dev/env/node_modules/micro-eth-signer/esm/abi/index.js
generated
vendored
Executable file
127
dev/env/node_modules/micro-eth-signer/esm/abi/index.js
generated
vendored
Executable file
@@ -0,0 +1,127 @@
|
||||
import { addr } from "../address.js";
|
||||
import { Transaction } from "../index.js";
|
||||
import { ethHex } from "../utils.js";
|
||||
import { Decoder, createContract, deployContract, events, } from "./decoder.js";
|
||||
import { default as ERC1155 } from "./erc1155.js";
|
||||
import { default as ERC20 } from "./erc20.js";
|
||||
import { default as ERC721 } from "./erc721.js";
|
||||
import { default as KYBER_NETWORK_PROXY, KYBER_NETWORK_PROXY_CONTRACT } from "./kyber.js";
|
||||
import { default as UNISWAP_V2_ROUTER, UNISWAP_V2_ROUTER_CONTRACT } from "./uniswap-v2.js";
|
||||
import { default as UNISWAP_V3_ROUTER, UNISWAP_V3_ROUTER_CONTRACT } from "./uniswap-v3.js";
|
||||
import { default as WETH, WETH_CONTRACT } from "./weth.js";
|
||||
// We need to export raw contracts, because 'CONTRACTS' object requires to know address it is not static type
|
||||
// so it cannot be re-used in createContract with nice types.
|
||||
export { ERC1155, ERC20, ERC721, KYBER_NETWORK_PROXY_CONTRACT, UNISWAP_V2_ROUTER_CONTRACT, UNISWAP_V3_ROUTER_CONTRACT, WETH, };
|
||||
export { Decoder, createContract, deployContract, events };
|
||||
export const TOKENS = /* @__PURE__ */ (() => Object.freeze(Object.fromEntries([
|
||||
['UNI', '0x1f9840a85d5af5bf1d1762f925bdaddc4201f984'],
|
||||
['BAT', '0x0d8775f648430679a709e98d2b0cb6250d2887ef'],
|
||||
// Required for Uniswap multi-hop routing
|
||||
['USDT', '0xdac17f958d2ee523a2206206994597c13d831ec7', 6, 1],
|
||||
['USDC', '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', 6, 1],
|
||||
['WETH', '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'],
|
||||
['WBTC', '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', 8],
|
||||
['DAI', '0x6b175474e89094c44da98b954eedeac495271d0f', 18, 1],
|
||||
['COMP', '0xc00e94cb662c3520282e6f5717214004a7f26888'],
|
||||
['MKR', '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2'],
|
||||
['AMPL', '0xd46ba6d942050d489dbd938a2c909a5d5039a161', 9],
|
||||
].map(([symbol, addr, decimals, price]) => [
|
||||
addr,
|
||||
{ abi: 'ERC20', symbol, decimals: decimals || 18, price },
|
||||
]))))();
|
||||
// <address, contractInfo>
|
||||
export const CONTRACTS = /* @__PURE__ */ (() => Object.freeze({
|
||||
[UNISWAP_V2_ROUTER_CONTRACT]: { abi: UNISWAP_V2_ROUTER, name: 'UNISWAP V2 ROUTER' },
|
||||
[KYBER_NETWORK_PROXY_CONTRACT]: { abi: KYBER_NETWORK_PROXY, name: 'KYBER NETWORK PROXY' },
|
||||
[UNISWAP_V3_ROUTER_CONTRACT]: { abi: UNISWAP_V3_ROUTER, name: 'UNISWAP V3 ROUTER' },
|
||||
...TOKENS,
|
||||
[WETH_CONTRACT]: { abi: WETH, name: 'WETH Token', decimals: 18, symbol: 'WETH' },
|
||||
}))();
|
||||
export const tokenFromSymbol = (symbol) => {
|
||||
for (let c in TOKENS) {
|
||||
if (TOKENS[c].symbol === symbol)
|
||||
return Object.assign({ contract: c }, TOKENS[c]);
|
||||
}
|
||||
throw new Error('unknown token');
|
||||
};
|
||||
const getABI = (info) => {
|
||||
if (typeof info.abi === 'string') {
|
||||
if (info.abi === 'ERC20')
|
||||
return ERC20;
|
||||
else if (info.abi === 'ERC721')
|
||||
return ERC721;
|
||||
else
|
||||
throw new Error(`getABI: unknown abi type=${info.abi}`);
|
||||
}
|
||||
return info.abi;
|
||||
};
|
||||
// TODO: export? Seems useful enough
|
||||
// We cannot have this inside decoder itself,
|
||||
// since it will create dependencies on all default contracts
|
||||
const getDecoder = (opt = {}) => {
|
||||
const decoder = new Decoder();
|
||||
const contracts = {};
|
||||
// Add contracts
|
||||
if (!opt.noDefault)
|
||||
Object.assign(contracts, CONTRACTS);
|
||||
if (opt.customContracts) {
|
||||
for (const k in opt.customContracts)
|
||||
contracts[k.toLowerCase()] = opt.customContracts[k];
|
||||
}
|
||||
// Contract info validation
|
||||
for (const k in contracts) {
|
||||
if (!addr.isValid(k))
|
||||
throw new Error(`getDecoder: invalid contract address=${k}`);
|
||||
const c = contracts[k];
|
||||
if (c.symbol !== undefined && typeof c.symbol !== 'string')
|
||||
throw new Error(`getDecoder: wrong symbol type=${c.symbol}`);
|
||||
if (c.decimals !== undefined && !Number.isSafeInteger(c.decimals))
|
||||
throw new Error(`getDecoder: wrong decimals type=${c.decimals}`);
|
||||
if (c.name !== undefined && typeof c.name !== 'string')
|
||||
throw new Error(`getDecoder: wrong name type=${c.name}`);
|
||||
if (c.price !== undefined && typeof c.price !== 'number')
|
||||
throw new Error(`getDecoder: wrong price type=${c.price}`);
|
||||
decoder.add(k, getABI(c)); // validates c.abi
|
||||
}
|
||||
return { decoder, contracts };
|
||||
};
|
||||
// These methods are for case when user wants to inspect tx/logs/receipt,
|
||||
// but doesn't know anything about which contract is used. If you work with
|
||||
// specific contract it is better to use 'createContract' which will return nice types.
|
||||
// 'to' can point to specific known contract, but also can point to any address (it is part of tx)
|
||||
// 'to' should be part of real tx you want to parse, not hardcoded contract!
|
||||
// Even if contract is unknown, we still try to process by known function signatures
|
||||
// from other contracts.
|
||||
// Can be used to parse tx or 'eth_getTransactionReceipt' output
|
||||
export const decodeData = (to, data, amount, opt = {}) => {
|
||||
if (!addr.isValid(to))
|
||||
throw new Error(`decodeData: wrong to=${to}`);
|
||||
if (amount !== undefined && typeof amount !== 'bigint')
|
||||
throw new Error(`decodeData: wrong amount=${amount}`);
|
||||
const { decoder, contracts } = getDecoder(opt);
|
||||
return decoder.decode(to, ethHex.decode(data), {
|
||||
contract: to,
|
||||
contracts, // NOTE: we need whole contracts list here, since exchanges can use info about other contracts (tokens)
|
||||
contractInfo: contracts[to.toLowerCase()], // current contract info (for tokens)
|
||||
amount, // Amount is not neccesary, but some hints won't work without it (exchange eth to some tokens)
|
||||
});
|
||||
};
|
||||
// Requires deps on tx, but nicer API.
|
||||
// Doesn't cover all use cases of decodeData, since it can't parse 'eth_getTransactionReceipt'
|
||||
export const decodeTx = (transaction, opt = {}) => {
|
||||
const tx = Transaction.fromHex(transaction);
|
||||
return decodeData(tx.raw.to, tx.raw.data, tx.raw.value, opt);
|
||||
};
|
||||
// Parses output of eth_getLogs/eth_getTransactionReceipt
|
||||
export const decodeEvent = (to, topics, data, opt = {}) => {
|
||||
if (!addr.isValid(to))
|
||||
throw new Error(`decodeEvent: wrong to=${to}`);
|
||||
const { decoder, contracts } = getDecoder(opt);
|
||||
return decoder.decodeEvent(to, topics, data, {
|
||||
contract: to,
|
||||
contracts,
|
||||
contractInfo: contracts[to.toLowerCase()],
|
||||
// amount here is not used by our hooks. Should we ask it for consistency?
|
||||
});
|
||||
};
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/abi/index.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/abi/index.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
141
dev/env/node_modules/micro-eth-signer/esm/abi/kyber.d.ts
generated
vendored
Executable file
141
dev/env/node_modules/micro-eth-signer/esm/abi/kyber.d.ts
generated
vendored
Executable file
@@ -0,0 +1,141 @@
|
||||
declare const ABI: readonly [{
|
||||
readonly type: "function";
|
||||
readonly name: "getExpectedRate";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "src";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "dest";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "srcQty";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "expectedRate";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "worstRate";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "getExpectedRateAfterFee";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "src";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "dest";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "srcQty";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "platformFeeBps";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "hint";
|
||||
readonly type: "bytes";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "expectedRate";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "trade";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "src";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "srcAmount";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "dest";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "destAddress";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "maxDestAmount";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "minConversionRate";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "platformWallet";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "tradeWithHint";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "src";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "srcAmount";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "dest";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "destAddress";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "maxDestAmount";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "minConversionRate";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "walletId";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "hint";
|
||||
readonly type: "bytes";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}, {
|
||||
readonly type: "function";
|
||||
readonly name: "tradeWithHintAndFee";
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "src";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "srcAmount";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "dest";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "destAddress";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "maxDestAmount";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "minConversionRate";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "platformWallet";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "platformFeeBps";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly name: "hint";
|
||||
readonly type: "bytes";
|
||||
}];
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "destAmount";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
}];
|
||||
export default ABI;
|
||||
export declare const KYBER_NETWORK_PROXY_CONTRACT = "0x9aab3f75489902f3a48495025729a0af77d4b11e";
|
||||
//# sourceMappingURL=kyber.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/abi/kyber.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/abi/kyber.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"kyber.d.ts","sourceRoot":"","sources":["../../src/abi/kyber.ts"],"names":[],"mappings":"AAqCA,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAwC,CAAC;AAElD,eAAe,GAAG,CAAC;AACnB,eAAO,MAAM,4BAA4B,+CAA+C,CAAC"}
|
||||
31
dev/env/node_modules/micro-eth-signer/esm/abi/kyber.js
generated
vendored
Executable file
31
dev/env/node_modules/micro-eth-signer/esm/abi/kyber.js
generated
vendored
Executable file
@@ -0,0 +1,31 @@
|
||||
import { createDecimal } from "../utils.js";
|
||||
import { addHints } from "./common.js";
|
||||
import {} from "./decoder.js";
|
||||
// prettier-ignore
|
||||
const _ABI = [
|
||||
{ type: "function", name: "getExpectedRate", inputs: [{ name: "src", type: "address" }, { name: "dest", type: "address" }, { name: "srcQty", type: "uint256" }], outputs: [{ name: "expectedRate", type: "uint256" }, { name: "worstRate", type: "uint256" }] }, { type: "function", name: "getExpectedRateAfterFee", inputs: [{ name: "src", type: "address" }, { name: "dest", type: "address" }, { name: "srcQty", type: "uint256" }, { name: "platformFeeBps", type: "uint256" }, { name: "hint", type: "bytes" }], outputs: [{ name: "expectedRate", type: "uint256" }] }, { type: "function", name: "trade", inputs: [{ name: "src", type: "address" }, { name: "srcAmount", type: "uint256" }, { name: "dest", type: "address" }, { name: "destAddress", type: "address" }, { name: "maxDestAmount", type: "uint256" }, { name: "minConversionRate", type: "uint256" }, { name: "platformWallet", type: "address" }], outputs: [{ type: "uint256" }] }, { type: "function", name: "tradeWithHint", inputs: [{ name: "src", type: "address" }, { name: "srcAmount", type: "uint256" }, { name: "dest", type: "address" }, { name: "destAddress", type: "address" }, { name: "maxDestAmount", type: "uint256" }, { name: "minConversionRate", type: "uint256" }, { name: "walletId", type: "address" }, { name: "hint", type: "bytes" }], outputs: [{ type: "uint256" }] }, { type: "function", name: "tradeWithHintAndFee", inputs: [{ name: "src", type: "address" }, { name: "srcAmount", type: "uint256" }, { name: "dest", type: "address" }, { name: "destAddress", type: "address" }, { name: "maxDestAmount", type: "uint256" }, { name: "minConversionRate", type: "uint256" }, { name: "platformWallet", type: "address" }, { name: "platformFeeBps", type: "uint256" }, { name: "hint", type: "bytes" }], outputs: [{ name: "destAmount", type: "uint256" }] }
|
||||
];
|
||||
const _10n = BigInt(10);
|
||||
const hints = {
|
||||
tradeWithHintAndFee(v, opt) {
|
||||
if (!opt.contracts)
|
||||
throw Error('Not enough info');
|
||||
const tokenInfo = (c) => c === '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'
|
||||
? { symbol: 'ETH', decimals: 18 }
|
||||
: opt.contracts[c];
|
||||
const formatToken = (amount, info) => `${createDecimal(info.decimals).encode(amount)} ${info.symbol}`;
|
||||
const [srcInfo, destInfo] = [tokenInfo(v.src), tokenInfo(v.dest)];
|
||||
if (!srcInfo || !destInfo)
|
||||
throw Error('Not enough info');
|
||||
const destAmount = (v.srcAmount *
|
||||
v.minConversionRate *
|
||||
_10n ** BigInt(destInfo.decimals)) /
|
||||
_10n ** (BigInt(srcInfo.decimals) + BigInt(18));
|
||||
const fee = formatToken((BigInt(v.platformFeeBps) * BigInt(v.srcAmount)) / BigInt(10000), srcInfo);
|
||||
return `Swap ${formatToken(v.srcAmount, srcInfo)} For ${formatToken(destAmount, destInfo)} (with platform fee: ${fee})`;
|
||||
},
|
||||
};
|
||||
const ABI = /* @__PURE__ */ addHints(_ABI, hints);
|
||||
export default ABI;
|
||||
export const KYBER_NETWORK_PROXY_CONTRACT = '0x9aab3f75489902f3a48495025729a0af77d4b11e';
|
||||
//# sourceMappingURL=kyber.js.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/abi/kyber.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/abi/kyber.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"kyber.js","sourceRoot":"","sources":["../../src/abi/kyber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAgB,MAAM,cAAc,CAAC;AAE5C,kBAAkB;AAClB,MAAM,IAAI,GAAG;IACX,EAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,iBAAiB,EAAC,MAAM,EAAC,CAAC,EAAC,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,SAAS,EAAC,CAAC,EAAC,OAAO,EAAC,CAAC,EAAC,IAAI,EAAC,cAAc,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,IAAI,EAAC,WAAW,EAAC,IAAI,EAAC,SAAS,EAAC,CAAC,EAAC,EAAC,EAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,yBAAyB,EAAC,MAAM,EAAC,CAAC,EAAC,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,IAAI,EA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AM,CAAC,MAAM,4BAA4B,GAAG,4CAA4C,CAAC"}
|
||||
755
dev/env/node_modules/micro-eth-signer/esm/abi/uniswap-v2.d.ts
generated
vendored
Executable file
755
dev/env/node_modules/micro-eth-signer/esm/abi/uniswap-v2.d.ts
generated
vendored
Executable file
@@ -0,0 +1,755 @@
|
||||
declare const ABI: readonly [{
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "_factory";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "_WETH";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "constructor";
|
||||
}, {
|
||||
readonly inputs: readonly [];
|
||||
readonly name: "WETH";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "tokenA";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "tokenB";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountADesired";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountBDesired";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountAMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountBMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "addLiquidity";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountA";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountB";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "liquidity";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountTokenDesired";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountTokenMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountETHMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "addLiquidityETH";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountToken";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountETH";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "liquidity";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [];
|
||||
readonly name: "factory";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOut";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "reserveIn";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "reserveOut";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "getAmountIn";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "pure";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "reserveIn";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "reserveOut";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "getAmountOut";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOut";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "pure";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOut";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}];
|
||||
readonly name: "getAmountsIn";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256[]";
|
||||
readonly name: "amounts";
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}];
|
||||
readonly name: "getAmountsOut";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256[]";
|
||||
readonly name: "amounts";
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountA";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "reserveA";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "reserveB";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "quote";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountB";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "pure";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "tokenA";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "tokenB";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "liquidity";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountAMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountBMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "removeLiquidity";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountA";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountB";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "liquidity";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountTokenMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountETHMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "removeLiquidityETH";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountToken";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountETH";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "liquidity";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountTokenMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountETHMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "removeLiquidityETHSupportingFeeOnTransferTokens";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountETH";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "liquidity";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountTokenMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountETHMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "bool";
|
||||
readonly name: "approveMax";
|
||||
readonly type: "bool";
|
||||
}, {
|
||||
readonly internalType: "uint8";
|
||||
readonly name: "v";
|
||||
readonly type: "uint8";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "r";
|
||||
readonly type: "bytes32";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "s";
|
||||
readonly type: "bytes32";
|
||||
}];
|
||||
readonly name: "removeLiquidityETHWithPermit";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountToken";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountETH";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "liquidity";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountTokenMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountETHMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "bool";
|
||||
readonly name: "approveMax";
|
||||
readonly type: "bool";
|
||||
}, {
|
||||
readonly internalType: "uint8";
|
||||
readonly name: "v";
|
||||
readonly type: "uint8";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "r";
|
||||
readonly type: "bytes32";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "s";
|
||||
readonly type: "bytes32";
|
||||
}];
|
||||
readonly name: "removeLiquidityETHWithPermitSupportingFeeOnTransferTokens";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountETH";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "tokenA";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "tokenB";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "liquidity";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountAMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountBMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "bool";
|
||||
readonly name: "approveMax";
|
||||
readonly type: "bool";
|
||||
}, {
|
||||
readonly internalType: "uint8";
|
||||
readonly name: "v";
|
||||
readonly type: "uint8";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "r";
|
||||
readonly type: "bytes32";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "s";
|
||||
readonly type: "bytes32";
|
||||
}];
|
||||
readonly name: "removeLiquidityWithPermit";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountA";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountB";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOut";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "swapETHForExactTokens";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256[]";
|
||||
readonly name: "amounts";
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOutMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "swapExactETHForTokens";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256[]";
|
||||
readonly name: "amounts";
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOutMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "swapExactETHForTokensSupportingFeeOnTransferTokens";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOutMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "swapExactTokensForETH";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256[]";
|
||||
readonly name: "amounts";
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOutMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "swapExactTokensForETHSupportingFeeOnTransferTokens";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOutMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "swapExactTokensForTokens";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256[]";
|
||||
readonly name: "amounts";
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOutMin";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "swapExactTokensForTokensSupportingFeeOnTransferTokens";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOut";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountInMax";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "swapTokensForExactETH";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256[]";
|
||||
readonly name: "amounts";
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOut";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountInMax";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address[]";
|
||||
readonly name: "path";
|
||||
readonly type: "address[]";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "to";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "swapTokensForExactTokens";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256[]";
|
||||
readonly name: "amounts";
|
||||
readonly type: "uint256[]";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "receive";
|
||||
}];
|
||||
export default ABI;
|
||||
export declare const UNISWAP_V2_ROUTER_CONTRACT = "0x7a250d5630b4cf539739df2c5dacb4c659f2488d";
|
||||
//# sourceMappingURL=uniswap-v2.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/abi/uniswap-v2.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/abi/uniswap-v2.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"uniswap-v2.d.ts","sourceRoot":"","sources":["../../src/abi/uniswap-v2.ts"],"names":[],"mappings":"AAsFA,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAwC,CAAC;AAClD,eAAe,GAAG,CAAC;AACnB,eAAO,MAAM,0BAA0B,+CAA+C,CAAC"}
|
||||
80
dev/env/node_modules/micro-eth-signer/esm/abi/uniswap-v2.js
generated
vendored
Executable file
80
dev/env/node_modules/micro-eth-signer/esm/abi/uniswap-v2.js
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
1
dev/env/node_modules/micro-eth-signer/esm/abi/uniswap-v2.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/abi/uniswap-v2.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
441
dev/env/node_modules/micro-eth-signer/esm/abi/uniswap-v3.d.ts
generated
vendored
Executable file
441
dev/env/node_modules/micro-eth-signer/esm/abi/uniswap-v3.d.ts
generated
vendored
Executable file
@@ -0,0 +1,441 @@
|
||||
declare const ABI: readonly [{
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "_factory";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "_WETH9";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "constructor";
|
||||
}, {
|
||||
readonly inputs: readonly [];
|
||||
readonly name: "WETH9";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly components: readonly [{
|
||||
readonly internalType: "bytes";
|
||||
readonly name: "path";
|
||||
readonly type: "bytes";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "recipient";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOutMinimum";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly internalType: "struct ISwapRouter.ExactInputParams";
|
||||
readonly name: "params";
|
||||
readonly type: "tuple";
|
||||
}];
|
||||
readonly name: "exactInput";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOut";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly components: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "tokenIn";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "tokenOut";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint24";
|
||||
readonly name: "fee";
|
||||
readonly type: "uint24";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "recipient";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOutMinimum";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint160";
|
||||
readonly name: "sqrtPriceLimitX96";
|
||||
readonly type: "uint160";
|
||||
}];
|
||||
readonly internalType: "struct ISwapRouter.ExactInputSingleParams";
|
||||
readonly name: "params";
|
||||
readonly type: "tuple";
|
||||
}];
|
||||
readonly name: "exactInputSingle";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOut";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly components: readonly [{
|
||||
readonly internalType: "bytes";
|
||||
readonly name: "path";
|
||||
readonly type: "bytes";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "recipient";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOut";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountInMaximum";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly internalType: "struct ISwapRouter.ExactOutputParams";
|
||||
readonly name: "params";
|
||||
readonly type: "tuple";
|
||||
}];
|
||||
readonly name: "exactOutput";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly components: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "tokenIn";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "tokenOut";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint24";
|
||||
readonly name: "fee";
|
||||
readonly type: "uint24";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "recipient";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountOut";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountInMaximum";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint160";
|
||||
readonly name: "sqrtPriceLimitX96";
|
||||
readonly type: "uint160";
|
||||
}];
|
||||
readonly internalType: "struct ISwapRouter.ExactOutputSingleParams";
|
||||
readonly name: "params";
|
||||
readonly type: "tuple";
|
||||
}];
|
||||
readonly name: "exactOutputSingle";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountIn";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [];
|
||||
readonly name: "factory";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "bytes[]";
|
||||
readonly name: "data";
|
||||
readonly type: "bytes[]";
|
||||
}];
|
||||
readonly name: "multicall";
|
||||
readonly outputs: readonly [{
|
||||
readonly internalType: "bytes[]";
|
||||
readonly name: "results";
|
||||
readonly type: "bytes[]";
|
||||
}];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [];
|
||||
readonly name: "refundETH";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint8";
|
||||
readonly name: "v";
|
||||
readonly type: "uint8";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "r";
|
||||
readonly type: "bytes32";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "s";
|
||||
readonly type: "bytes32";
|
||||
}];
|
||||
readonly name: "selfPermit";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "nonce";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "expiry";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint8";
|
||||
readonly name: "v";
|
||||
readonly type: "uint8";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "r";
|
||||
readonly type: "bytes32";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "s";
|
||||
readonly type: "bytes32";
|
||||
}];
|
||||
readonly name: "selfPermitAllowed";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "nonce";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "expiry";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint8";
|
||||
readonly name: "v";
|
||||
readonly type: "uint8";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "r";
|
||||
readonly type: "bytes32";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "s";
|
||||
readonly type: "bytes32";
|
||||
}];
|
||||
readonly name: "selfPermitAllowedIfNecessary";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "value";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "deadline";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "uint8";
|
||||
readonly name: "v";
|
||||
readonly type: "uint8";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "r";
|
||||
readonly type: "bytes32";
|
||||
}, {
|
||||
readonly internalType: "bytes32";
|
||||
readonly name: "s";
|
||||
readonly type: "bytes32";
|
||||
}];
|
||||
readonly name: "selfPermitIfNecessary";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountMinimum";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "recipient";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly name: "sweepToken";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "address";
|
||||
readonly name: "token";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountMinimum";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "recipient";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "feeBips";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "feeRecipient";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly name: "sweepTokenWithFee";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "int256";
|
||||
readonly name: "amount0Delta";
|
||||
readonly type: "int256";
|
||||
}, {
|
||||
readonly internalType: "int256";
|
||||
readonly name: "amount1Delta";
|
||||
readonly type: "int256";
|
||||
}, {
|
||||
readonly internalType: "bytes";
|
||||
readonly name: "_data";
|
||||
readonly type: "bytes";
|
||||
}];
|
||||
readonly name: "uniswapV3SwapCallback";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountMinimum";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "recipient";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly name: "unwrapWETH9";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly inputs: readonly [{
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "amountMinimum";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "recipient";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly internalType: "uint256";
|
||||
readonly name: "feeBips";
|
||||
readonly type: "uint256";
|
||||
}, {
|
||||
readonly internalType: "address";
|
||||
readonly name: "feeRecipient";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly name: "unwrapWETH9WithFee";
|
||||
readonly outputs: readonly [];
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "receive";
|
||||
}];
|
||||
export default ABI;
|
||||
export declare const UNISWAP_V3_ROUTER_CONTRACT = "0xe592427a0aece92de3edee1f18e0157c05861564";
|
||||
//# sourceMappingURL=uniswap-v3.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/abi/uniswap-v3.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/abi/uniswap-v3.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"uniswap-v3.d.ts","sourceRoot":"","sources":["../../src/abi/uniswap-v3.ts"],"names":[],"mappings":"AA0EA,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAiD,CAAC;AAE3D,eAAe,GAAG,CAAC;AACnB,eAAO,MAAM,0BAA0B,+CAA+C,CAAC"}
|
||||
79
dev/env/node_modules/micro-eth-signer/esm/abi/uniswap-v3.js
generated
vendored
Executable file
79
dev/env/node_modules/micro-eth-signer/esm/abi/uniswap-v3.js
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
1
dev/env/node_modules/micro-eth-signer/esm/abi/uniswap-v3.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/abi/uniswap-v3.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
216
dev/env/node_modules/micro-eth-signer/esm/abi/weth.d.ts
generated
vendored
Executable file
216
dev/env/node_modules/micro-eth-signer/esm/abi/weth.d.ts
generated
vendored
Executable file
@@ -0,0 +1,216 @@
|
||||
declare const ABI: readonly [{
|
||||
readonly constant: true;
|
||||
readonly inputs: readonly [];
|
||||
readonly name: "name";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "string";
|
||||
}];
|
||||
readonly payable: false;
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly constant: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "guy";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "wad";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "approve";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
readonly payable: false;
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly constant: true;
|
||||
readonly inputs: readonly [];
|
||||
readonly name: "totalSupply";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly payable: false;
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly constant: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "src";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "dst";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "wad";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "transferFrom";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
readonly payable: false;
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly constant: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "wad";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "withdraw";
|
||||
readonly outputs: readonly [];
|
||||
readonly payable: false;
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly constant: true;
|
||||
readonly inputs: readonly [];
|
||||
readonly name: "decimals";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "uint8";
|
||||
}];
|
||||
readonly payable: false;
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly constant: true;
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly name: "balanceOf";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly payable: false;
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly constant: true;
|
||||
readonly inputs: readonly [];
|
||||
readonly name: "symbol";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "string";
|
||||
}];
|
||||
readonly payable: false;
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly constant: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "dst";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "wad";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "transfer";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "bool";
|
||||
}];
|
||||
readonly payable: false;
|
||||
readonly stateMutability: "nonpayable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly constant: false;
|
||||
readonly inputs: readonly [];
|
||||
readonly name: "deposit";
|
||||
readonly outputs: readonly [];
|
||||
readonly payable: true;
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly constant: true;
|
||||
readonly inputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly name: "";
|
||||
readonly type: "address";
|
||||
}];
|
||||
readonly name: "allowance";
|
||||
readonly outputs: readonly [{
|
||||
readonly name: "";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly payable: false;
|
||||
readonly stateMutability: "view";
|
||||
readonly type: "function";
|
||||
}, {
|
||||
readonly payable: true;
|
||||
readonly stateMutability: "payable";
|
||||
readonly type: "fallback";
|
||||
}, {
|
||||
readonly anonymous: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "src";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "guy";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "wad";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "Approval";
|
||||
readonly type: "event";
|
||||
}, {
|
||||
readonly anonymous: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "src";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: true;
|
||||
readonly name: "dst";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "wad";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "Transfer";
|
||||
readonly type: "event";
|
||||
}, {
|
||||
readonly anonymous: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "dst";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "wad";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "Deposit";
|
||||
readonly type: "event";
|
||||
}, {
|
||||
readonly anonymous: false;
|
||||
readonly inputs: readonly [{
|
||||
readonly indexed: true;
|
||||
readonly name: "src";
|
||||
readonly type: "address";
|
||||
}, {
|
||||
readonly indexed: false;
|
||||
readonly name: "wad";
|
||||
readonly type: "uint256";
|
||||
}];
|
||||
readonly name: "Withdrawal";
|
||||
readonly type: "event";
|
||||
}];
|
||||
export default ABI;
|
||||
export declare const WETH_CONTRACT = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2";
|
||||
//# sourceMappingURL=weth.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/abi/weth.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/abi/weth.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"weth.d.ts","sourceRoot":"","sources":["../../src/abi/weth.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA6C,CAAC;AACvD,eAAe,GAAG,CAAC;AACnB,eAAO,MAAM,aAAa,+CAA+C,CAAC"}
|
||||
10
dev/env/node_modules/micro-eth-signer/esm/abi/weth.js
generated
vendored
Executable file
10
dev/env/node_modules/micro-eth-signer/esm/abi/weth.js
generated
vendored
Executable file
@@ -0,0 +1,10 @@
|
||||
import { addHints } from "./common.js";
|
||||
import { hints as erc20hints } from "./erc20.js";
|
||||
// prettier-ignore
|
||||
const _ABI = [
|
||||
{ constant: true, inputs: [], name: "name", outputs: [{ name: "", type: "string" }], payable: false, stateMutability: "view", type: "function" }, { constant: false, inputs: [{ name: "guy", type: "address" }, { name: "wad", type: "uint256" }], name: "approve", outputs: [{ name: "", type: "bool" }], payable: false, stateMutability: "nonpayable", type: "function" }, { constant: true, inputs: [], name: "totalSupply", outputs: [{ name: "", type: "uint256" }], payable: false, stateMutability: "view", type: "function" }, { constant: false, inputs: [{ name: "src", type: "address" }, { name: "dst", type: "address" }, { name: "wad", type: "uint256" }], name: "transferFrom", outputs: [{ name: "", type: "bool" }], payable: false, stateMutability: "nonpayable", type: "function" }, { constant: false, inputs: [{ name: "wad", type: "uint256" }], name: "withdraw", outputs: [], payable: false, stateMutability: "nonpayable", type: "function" }, { constant: true, inputs: [], name: "decimals", outputs: [{ name: "", type: "uint8" }], payable: false, stateMutability: "view", type: "function" }, { constant: true, inputs: [{ name: "", type: "address" }], name: "balanceOf", outputs: [{ name: "", type: "uint256" }], payable: false, stateMutability: "view", type: "function" }, { constant: true, inputs: [], name: "symbol", outputs: [{ name: "", type: "string" }], payable: false, stateMutability: "view", type: "function" }, { constant: false, inputs: [{ name: "dst", type: "address" }, { name: "wad", type: "uint256" }], name: "transfer", outputs: [{ name: "", type: "bool" }], payable: false, stateMutability: "nonpayable", type: "function" }, { constant: false, inputs: [], name: "deposit", outputs: [], payable: true, stateMutability: "payable", type: "function" }, { constant: true, inputs: [{ name: "", type: "address" }, { name: "", type: "address" }], name: "allowance", outputs: [{ name: "", type: "uint256" }], payable: false, stateMutability: "view", type: "function" }, { payable: true, stateMutability: "payable", type: "fallback" }, { anonymous: false, inputs: [{ indexed: true, name: "src", type: "address" }, { indexed: true, name: "guy", type: "address" }, { indexed: false, name: "wad", type: "uint256" }], name: "Approval", type: "event" }, { anonymous: false, inputs: [{ indexed: true, name: "src", type: "address" }, { indexed: true, name: "dst", type: "address" }, { indexed: false, name: "wad", type: "uint256" }], name: "Transfer", type: "event" }, { anonymous: false, inputs: [{ indexed: true, name: "dst", type: "address" }, { indexed: false, name: "wad", type: "uint256" }], name: "Deposit", type: "event" }, { anonymous: false, inputs: [{ indexed: true, name: "src", type: "address" }, { indexed: false, name: "wad", type: "uint256" }], name: "Withdrawal", type: "event" }
|
||||
];
|
||||
const ABI = /* @__PURE__ */ addHints(_ABI, erc20hints);
|
||||
export default ABI;
|
||||
export const WETH_CONTRACT = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2';
|
||||
//# sourceMappingURL=weth.js.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/abi/weth.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/abi/weth.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"weth.js","sourceRoot":"","sources":["../../src/abi/weth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,YAAY,CAAC;AAEjD,kBAAkB;AAClB,MAAM,IAAI,GAAG;IACX,EAAC,QAAQ,EAAC,IAAI,EAAC,MAAM,EAAC,EAAE,EAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,QAAQ,EAAC,CAAC,EAAC,OAAO,EAAC,KAAK,EAAC,eAAe,EAAC,MAAM,EAAC,IAAI,EAAC,UAAU,EAAC,EAAC,EAAC,QAAQ,EAAC,KAAK,EAAC,MAAM,EAAC,CAAC,EAAC,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,SAAS,EAAC,CAAC,EAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,MAAM,EAAC,CAAC,EAAC,OAAO,EAAC,KAAK,EAAC,eAAe,EA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C,IAAI,EAAC,OAAO,EAAC,EAAC,EAAC,SAAS,EAAC,KAAK,EAAC,MAAM,EAAC,CAAC,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,SAAS,EAAC,EAAC,EAAC,OAAO,EAAC,KAAK,EAAC,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,SAAS,EAAC,CAAC,EAAC,IAAI,EAAC,YAAY,EAAC,IAAI,EAAC,OAAO,EAAC;CAC70E,CAAC;AAEX,MAAM,GAAG,GAAG,eAAe,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AACvD,eAAe,GAAG,CAAC;AACnB,MAAM,CAAC,MAAM,aAAa,GAAG,4CAA4C,CAAC"}
|
||||
37
dev/env/node_modules/micro-eth-signer/esm/address.d.ts
generated
vendored
Executable file
37
dev/env/node_modules/micro-eth-signer/esm/address.d.ts
generated
vendored
Executable file
@@ -0,0 +1,37 @@
|
||||
export declare const addr: {
|
||||
RE: RegExp;
|
||||
parse: (address: string, allowEmpty?: boolean) => {
|
||||
hasPrefix: boolean;
|
||||
data: string;
|
||||
};
|
||||
/**
|
||||
* Address checksum is calculated by hashing with keccak_256.
|
||||
* It hashes *string*, not a bytearray: keccak('beef') not keccak([0xbe, 0xef])
|
||||
* @param nonChecksummedAddress
|
||||
* @param allowEmpty - allows '0x'
|
||||
* @returns checksummed address
|
||||
*/
|
||||
addChecksum: (nonChecksummedAddress: string, allowEmpty?: boolean) => string;
|
||||
/**
|
||||
* Creates address from secp256k1 public key.
|
||||
*/
|
||||
fromPublicKey: (key: string | Uint8Array) => string;
|
||||
/**
|
||||
* Creates address from ETH private key in hex or ui8a format.
|
||||
*/
|
||||
fromPrivateKey: (key: string | Uint8Array) => string;
|
||||
/**
|
||||
* Generates hex string with new random private key and address. Uses CSPRNG internally.
|
||||
*/
|
||||
random(): {
|
||||
privateKey: string;
|
||||
address: string;
|
||||
};
|
||||
/**
|
||||
* Verifies checksum if the address is checksummed.
|
||||
* Always returns true when the address is not checksummed.
|
||||
* @param allowEmpty - allows '0x'
|
||||
*/
|
||||
isValid: (checksummedAddress: string, allowEmpty?: boolean) => boolean;
|
||||
};
|
||||
//# sourceMappingURL=address.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/address.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/address.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../src/address.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,IAAI;QACwC,MAAM;qBAElD,MAAM,2BAEd;QACD,SAAS,EAAE,OAAO,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;KACd;IAgBD;;;;;;OAMG;yCACkC,MAAM,2BAAuB,MAAM;IAYxE;;OAEG;yBACkB,MAAM,GAAG,UAAU,KAAG,MAAM;IAQjD;;OAEG;0BACmB,MAAM,GAAG,UAAU,KAAG,MAAM;IAKlD;;OAEG;cACO;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;IAKjD;;;;OAIG;kCAC2B,MAAM,2BAAuB,OAAO;CAcnE,CAAC"}
|
||||
91
dev/env/node_modules/micro-eth-signer/esm/address.js
generated
vendored
Executable file
91
dev/env/node_modules/micro-eth-signer/esm/address.js
generated
vendored
Executable file
@@ -0,0 +1,91 @@
|
||||
/*! micro-eth-signer - MIT License (c) 2021 Paul Miller (paulmillr.com) */
|
||||
import { secp256k1 } from '@noble/curves/secp256k1';
|
||||
import { keccak_256 } from '@noble/hashes/sha3';
|
||||
import { bytesToHex } from '@noble/hashes/utils';
|
||||
import { add0x, astr, ethHex, strip0x } from "./utils.js";
|
||||
export const addr = {
|
||||
RE: /^(0[xX])?([0-9a-fA-F]{40})?$/,
|
||||
parse: (address, allowEmpty = false) => {
|
||||
astr(address);
|
||||
// NOTE: empty address allowed for 'to', but would be mistake for other address fields.
|
||||
// '0x' instead of null/undefined because we don't want to send contract creation tx if user
|
||||
// accidentally missed 'to' field.
|
||||
if (allowEmpty && address === '0x')
|
||||
return { hasPrefix: true, data: '' };
|
||||
const res = address.match(addr.RE) || [];
|
||||
const hasPrefix = res[1] != null;
|
||||
const data = res[2];
|
||||
if (!data) {
|
||||
const len = hasPrefix ? 42 : 40;
|
||||
throw new Error(`address must be ${len}-char hex, got ${address.length}-char ${address}`);
|
||||
}
|
||||
return { hasPrefix, data };
|
||||
},
|
||||
/**
|
||||
* Address checksum is calculated by hashing with keccak_256.
|
||||
* It hashes *string*, not a bytearray: keccak('beef') not keccak([0xbe, 0xef])
|
||||
* @param nonChecksummedAddress
|
||||
* @param allowEmpty - allows '0x'
|
||||
* @returns checksummed address
|
||||
*/
|
||||
addChecksum: (nonChecksummedAddress, allowEmpty = false) => {
|
||||
const low = addr.parse(nonChecksummedAddress, allowEmpty).data.toLowerCase();
|
||||
const hash = bytesToHex(keccak_256(low));
|
||||
let checksummed = '';
|
||||
for (let i = 0; i < low.length; i++) {
|
||||
const hi = Number.parseInt(hash[i], 16);
|
||||
const li = low[i];
|
||||
checksummed += hi <= 7 ? li : li.toUpperCase(); // if char is 9-f, upcase it
|
||||
}
|
||||
return add0x(checksummed);
|
||||
},
|
||||
/**
|
||||
* Creates address from secp256k1 public key.
|
||||
*/
|
||||
fromPublicKey: (key) => {
|
||||
if (!key)
|
||||
throw new Error('invalid public key: ' + key);
|
||||
const pub65b = secp256k1.ProjectivePoint.fromHex(key).toRawBytes(false);
|
||||
const hashed = keccak_256(pub65b.subarray(1, 65));
|
||||
const address = bytesToHex(hashed).slice(24); // slice 24..64
|
||||
return addr.addChecksum(address);
|
||||
},
|
||||
/**
|
||||
* Creates address from ETH private key in hex or ui8a format.
|
||||
*/
|
||||
fromPrivateKey: (key) => {
|
||||
if (typeof key === 'string')
|
||||
key = strip0x(key);
|
||||
return addr.fromPublicKey(secp256k1.getPublicKey(key, false));
|
||||
},
|
||||
/**
|
||||
* Generates hex string with new random private key and address. Uses CSPRNG internally.
|
||||
*/
|
||||
random() {
|
||||
const privateKey = ethHex.encode(secp256k1.utils.randomPrivateKey());
|
||||
return { privateKey, address: addr.fromPrivateKey(privateKey) };
|
||||
},
|
||||
/**
|
||||
* Verifies checksum if the address is checksummed.
|
||||
* Always returns true when the address is not checksummed.
|
||||
* @param allowEmpty - allows '0x'
|
||||
*/
|
||||
isValid: (checksummedAddress, allowEmpty = false) => {
|
||||
let parsed;
|
||||
try {
|
||||
parsed = addr.parse(checksummedAddress, allowEmpty);
|
||||
}
|
||||
catch (error) {
|
||||
return false;
|
||||
}
|
||||
const { data: address, hasPrefix } = parsed;
|
||||
if (!hasPrefix)
|
||||
return false;
|
||||
const low = address.toLowerCase();
|
||||
const upp = address.toUpperCase();
|
||||
if (address === low || address === upp)
|
||||
return true;
|
||||
return addr.addChecksum(low, allowEmpty) === checksummedAddress;
|
||||
},
|
||||
};
|
||||
//# sourceMappingURL=address.js.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/address.js.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/address.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"address.js","sourceRoot":"","sources":["../src/address.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1D,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,EAAE,EAAE,8BAAyD;IAC7D,KAAK,EAAE,CACL,OAAe,EACf,UAAU,GAAG,KAAK,EAIlB,EAAE;QACF,IAAI,CAAC,OAAO,CAAC,CAAC;QACd,uFAAuF;QACvF,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I,MAA4C,CAAC;QACjD,IAAI,CAAC;YACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;QACtD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC5C,IAAI,CAAC,SAAS;YAAE,OAAO,KAAK,CAAC;QAC7B,MAAM,GAAG,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;QAClC,MAAM,GAAG,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;QAClC,IAAI,OAAO,KAAK,GAAG,IAAI,OAAO,KAAK,GAAG;YAAE,OAAO,IAAI,CAAC;QACpD,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,UAAU,CAAC,KAAK,kBAAkB,CAAC;IAClE,CAAC;CACF,CAAC"}
|
||||
108
dev/env/node_modules/micro-eth-signer/esm/index.d.ts
generated
vendored
Executable file
108
dev/env/node_modules/micro-eth-signer/esm/index.d.ts
generated
vendored
Executable file
@@ -0,0 +1,108 @@
|
||||
import { addr } from './address.ts';
|
||||
import { type AuthorizationItem, type AuthorizationRequest, type TxCoder, type TxType } from './tx.ts';
|
||||
import { weieth, weigwei } from './utils.ts';
|
||||
export { addr, weieth, weigwei };
|
||||
/**
|
||||
* EIP-7702 Authorizations
|
||||
*/
|
||||
export declare const authorization: {
|
||||
_getHash(req: AuthorizationRequest): Uint8Array;
|
||||
sign(req: AuthorizationRequest, privateKey: string): AuthorizationItem;
|
||||
getAuthority(item: AuthorizationItem): string;
|
||||
};
|
||||
declare const TX_DEFAULTS: {
|
||||
readonly accessList: readonly [];
|
||||
readonly authorizationList: readonly [];
|
||||
readonly chainId: bigint;
|
||||
readonly data: "";
|
||||
readonly gasLimit: bigint;
|
||||
readonly maxPriorityFeePerGas: bigint;
|
||||
readonly type: "eip1559";
|
||||
};
|
||||
type DefaultField = keyof typeof TX_DEFAULTS;
|
||||
type DefaultType = (typeof TX_DEFAULTS)['type'];
|
||||
type DefaultsOptional<T> = {
|
||||
[P in keyof T as P extends DefaultField ? P : never]?: T[P];
|
||||
} & {
|
||||
[P in keyof T as P extends DefaultField ? never : P]: T[P];
|
||||
};
|
||||
type HumanInputInner<T extends TxType> = DefaultsOptional<{
|
||||
type: T;
|
||||
} & TxCoder<T>>;
|
||||
type HumanInputInnerDefault = DefaultsOptional<TxCoder<DefaultType>>;
|
||||
type Required<T> = T extends undefined ? never : T;
|
||||
type HumanInput<T extends TxType | undefined> = T extends undefined ? HumanInputInnerDefault : HumanInputInner<Required<T>>;
|
||||
export declare class Transaction<T extends TxType> {
|
||||
readonly type: T;
|
||||
readonly raw: TxCoder<T>;
|
||||
readonly isSigned: boolean;
|
||||
constructor(type: T, raw: TxCoder<T>, strict?: boolean, allowSignatureFields?: boolean);
|
||||
static prepare<T extends {
|
||||
type: undefined;
|
||||
}>(data: T & HumanInputInnerDefault, strict?: boolean): Transaction<(typeof TX_DEFAULTS)['type']>;
|
||||
static prepare<TT extends TxType, T extends {
|
||||
type: TT;
|
||||
} & HumanInput<TT>>(data: HumanInput<TT>, strict?: boolean): Transaction<T['type']>;
|
||||
/**
|
||||
* Creates transaction which sends whole account balance. Does two things:
|
||||
* 1. `amount = accountBalance - maxFeePerGas * gasLimit`
|
||||
* 2. `maxPriorityFeePerGas = maxFeePerGas`
|
||||
*
|
||||
* Every eth block sets a fee for all its transactions, called base fee.
|
||||
* maxFeePerGas indicates how much gas user is able to spend in the worst case.
|
||||
* If the block's base fee is 5 gwei, while user is able to spend 10 gwei in maxFeePerGas,
|
||||
* the transaction would only consume 5 gwei. That means, base fee is unknown
|
||||
* before the transaction is included in a block.
|
||||
*
|
||||
* By setting priorityFee to maxFee, we make the process deterministic:
|
||||
* `maxFee = 10, maxPriority = 10, baseFee = 5` would always spend 10 gwei.
|
||||
* In the end, the balance would become 0.
|
||||
*
|
||||
* WARNING: using the method would decrease privacy of a transfer, because
|
||||
* payments for services have specific amounts, and not *the whole amount*.
|
||||
* @param accountBalance - account balance in wei
|
||||
* @param burnRemaining - send unspent fee to miners. When false, some "small amount" would remain
|
||||
* @returns new transaction with adjusted amounts
|
||||
*/
|
||||
setWholeAmount(accountBalance: bigint, burnRemaining?: boolean): Transaction<T>;
|
||||
static fromRawBytes(bytes: Uint8Array, strict?: boolean): Transaction<'legacy' | 'eip2930' | 'eip1559' | 'eip4844' | 'eip7702'>;
|
||||
static fromHex(hex: string, strict?: boolean): Transaction<'eip1559' | 'legacy' | 'eip2930' | 'eip4844' | 'eip7702'>;
|
||||
private assertIsSigned;
|
||||
/**
|
||||
* Converts transaction to RLP.
|
||||
* @param includeSignature whether to include signature
|
||||
*/
|
||||
toRawBytes(includeSignature?: boolean): Uint8Array;
|
||||
/**
|
||||
* Converts transaction to hex.
|
||||
* @param includeSignature whether to include signature
|
||||
*/
|
||||
toHex(includeSignature?: boolean): string;
|
||||
/** Calculates keccak-256 hash of signed transaction. Used in block explorers. */
|
||||
get hash(): string;
|
||||
/** Returns sender's address. */
|
||||
get sender(): string;
|
||||
/**
|
||||
* For legacy transactions, but can be used with libraries when yParity presented as v.
|
||||
*/
|
||||
get v(): bigint | undefined;
|
||||
private calcHash;
|
||||
/** Calculates MAXIMUM fee in wei that could be spent. */
|
||||
get fee(): bigint;
|
||||
clone(): Transaction<T>;
|
||||
verifySignature(): boolean;
|
||||
removeSignature(): Transaction<T>;
|
||||
/**
|
||||
* Signs transaction with a private key.
|
||||
* @param privateKey key in hex or Uint8Array format
|
||||
* @param opts extraEntropy will increase security of sig by mixing rfc6979 randomness
|
||||
* @returns new "same" transaction, but signed
|
||||
*/
|
||||
signBy(privateKey: string | Uint8Array, extraEntropy?: boolean | Uint8Array): Transaction<T>;
|
||||
/** Calculates public key and address from signed transaction's signature. */
|
||||
recoverSender(): {
|
||||
publicKey: string;
|
||||
address: string;
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
dev/env/node_modules/micro-eth-signer/esm/index.d.ts.map
generated
vendored
Executable file
1
dev/env/node_modules/micro-eth-signer/esm/index.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,OAAO,EACZ,KAAK,MAAM,EAQZ,MAAM,SAAS,CAAC;AAEjB,OAAO,EAMkB,MAAM,EAAE,OAAO,EACvC,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAIjC;;GAEG;AACH,eAAO,MAAM,aAAa;kBACV,oBAAoB,GAAG,UAAU;cAIrC,oBAAoB,cAAc,MAAM,GAAG,iBAAiB;uBAKnD,iBAAiB,GAAG,MAAM;CAO9C,CAAC;AAIF,QAAA,MAAM,WAAW;;;sBAGwB,MAAM;;uBAED,MAAM;mCACmB,MAAM;;CAEnE,CAAC;AACX,KAAK,YAAY,GAAG,MAAM,OAAO,WAAW,CAAC;AAC7C,KAAK,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAChD,KAAK,gBAAgB,CAAC,CAAC,IAAI;KACxB,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,YAAY,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAC5D,GAAG;KACD,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,YAAY,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAC3D,CAAC;AACF,KAAK,eAAe,CAAC,CAAC,SAAS,MAAM,IAAI,gBAAgB,CAAC;IAAE,IAAI,EAAE,CAAC,CAAA;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