Skip to content

Commit dab83bc

Browse files
committed
noot
1 parent 56d8a21 commit dab83bc

29 files changed

+9487
-2838
lines changed

bun.lock

+179-135
Large diffs are not rendered by default.

cli-core/README.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# NTT cli
2+
3+
## Prerequisites
4+
5+
- [bun](https://bun.sh/docs/installation)
6+
7+
Depending on the platforms you will deploy on:
8+
- [foundry](https://book.getfoundry.sh/) (evm)
9+
- [anchor](https://book.anchor-lang.com/getting_started/installation.html) (solana)
10+
11+
## Installation
12+
13+
Run
14+
15+
``` bash
16+
curl -fsSL https://raw.githubusercontent.com/wormhole-foundation/example-native-token-transfers/main/cli/install.sh | bash
17+
```
18+
19+
The installer will put the `ntt` binary in `$HOME/.bun/bin`, so make sure that directory is included in your `$PATH`. Once `ntt` is installed, it can be updated to the latest release any time by running
20+
21+
``` bash
22+
ntt update
23+
```
24+
25+
Or to a specific branch by running
26+
27+
``` bash
28+
ntt update --branch foo
29+
```
30+
31+
## Development
32+
33+
The easiest way to work on the CLI is to first install using the script above, then clone the repo, and run
34+
35+
``` bash
36+
ntt update --path path/to/ntt/repo
37+
```

cli-core/dist/configuration.d.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { type Chain } from "@wormhole-foundation/sdk";
2+
import * as yargs from "yargs";
3+
type ChainConfig = Partial<typeof configTemplate>;
4+
declare const configTemplate: {
5+
scan_api_key: string;
6+
};
7+
export declare const command: (args: yargs.Argv<{}>) => yargs.Argv<{}>;
8+
export declare function get(chain: Chain, key: keyof ChainConfig, { reportError }: {
9+
reportError?: boolean | undefined;
10+
}): string | undefined;
11+
export {};

cli-core/dist/diff.d.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export type Diff<T> = {
2+
push?: T;
3+
pull?: T;
4+
};
5+
type DiffMap<T> = {
6+
[K in keyof T]: T[K] extends object ? Partial<DiffMap<T[K]>> : Diff<T[K]>;
7+
};
8+
export declare function diffObjects<T extends Record<string, any>>(obj1: T, obj2: T): Partial<DiffMap<T>>;
9+
export declare function colorizeDiff(diff: any, indent?: number): string;
10+
export {};

cli-core/dist/evmsigner.d.ts

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import type { Network, SignOnlySigner, SignedTx, Signer, UnsignedTransaction } from '@wormhole-foundation/sdk-connect';
2+
import { PlatformNativeSigner } from '@wormhole-foundation/sdk-connect';
3+
import { type EvmChains } from '@wormhole-foundation/sdk-evm';
4+
import type { Signer as EthersSigner, Provider } from 'ethers';
5+
export declare function getEvmSigner(rpc: Provider, key: string | EthersSigner, opts?: {
6+
maxGasLimit?: bigint;
7+
chain?: EvmChains;
8+
debug?: boolean;
9+
}): Promise<Signer>;
10+
export declare function getEvmSignerForKey(rpc: Provider, privateKey: string): Promise<Signer>;
11+
export declare function getEvmSignerForSigner(signer: EthersSigner): Promise<Signer>;
12+
export declare class EvmNativeSigner<N extends Network, C extends EvmChains = EvmChains> extends PlatformNativeSigner<EthersSigner, N, C> implements SignOnlySigner<N, C> {
13+
readonly opts?: {
14+
maxGasLimit?: bigint | undefined;
15+
debug?: boolean | undefined;
16+
} | undefined;
17+
constructor(_chain: C, _address: string, _signer: EthersSigner, opts?: {
18+
maxGasLimit?: bigint | undefined;
19+
debug?: boolean | undefined;
20+
} | undefined);
21+
chain(): C;
22+
address(): string;
23+
sign(tx: UnsignedTransaction<N, C>[]): Promise<SignedTx[]>;
24+
}
25+
export declare function isEvmNativeSigner<N extends Network>(signer: Signer<N>): signer is EvmNativeSigner<N>;

cli-core/dist/getSigner.d.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { ChainContext, type Chain, type ChainAddress, type Network, type Signer } from "@wormhole-foundation/sdk";
2+
export type SignerType = "privateKey" | "ledger";
3+
export type SignerSource = {
4+
type: SignerType;
5+
source: string;
6+
};
7+
export interface SignerStuff<N extends Network, C extends Chain> {
8+
chain: ChainContext<N, C>;
9+
signer: Signer<N, C>;
10+
address: ChainAddress<C>;
11+
source: SignerSource;
12+
}
13+
export declare function forgeSignerArgs(source: SignerSource): string;
14+
export declare function getSigner<N extends Network, C extends Chain>(chain: ChainContext<N, C>, type: SignerType, source?: string, filePath?: string): Promise<SignerStuff<N, C>>;

0 commit comments

Comments
 (0)