@trustwallet/cli 0.21.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-wallet-loader.d.ts +31 -0
- package/dist/agent-wallet-loader.d.ts.map +1 -0
- package/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/erc8004.d.ts.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/onramp.d.ts.map +1 -1
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/swap.d.ts.map +1 -1
- package/dist/commands/transfer.d.ts.map +1 -1
- package/dist/commands/wallet.d.ts.map +1 -1
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/config-loader.d.ts +6 -5
- package/dist/config-loader.d.ts.map +1 -1
- package/dist/credentials-error.d.ts +5 -0
- package/dist/credentials-error.d.ts.map +1 -0
- package/dist/index.js +590 -459
- package/dist/serve-bootstrap.d.ts +32 -0
- package/dist/serve-bootstrap.d.ts.map +1 -0
- package/dist/stdio-console.d.ts +13 -0
- package/dist/stdio-console.d.ts.map +1 -0
- package/dist/walletconnect-config.d.ts +7 -4
- package/dist/walletconnect-config.d.ts.map +1 -1
- package/package.json +14 -14
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { AgentWalletProvider } from '@twak/wallet';
|
|
2
|
+
export interface AgentWalletLoaderDeps {
|
|
3
|
+
walletExists: () => Promise<boolean>;
|
|
4
|
+
/** Read on every attempt, so a source that changes (the OS keychain) is
|
|
5
|
+
* picked up; undefined when no source has a password. */
|
|
6
|
+
resolvePassword: () => Promise<string | undefined>;
|
|
7
|
+
open: (password: string) => Promise<AgentWalletProvider>;
|
|
8
|
+
/** Runs once, for the wallet that loaded. */
|
|
9
|
+
onLoaded: (wallet: AgentWalletProvider) => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Loads the on-disk agent wallet on demand and keeps the loaded instance, so
|
|
13
|
+
* a wallet created or unlocked after `twak serve` started can still be used.
|
|
14
|
+
*
|
|
15
|
+
* `load` returns the loaded wallet, or loads it: a failure is not cached, so
|
|
16
|
+
* the next call retries; concurrent calls share one attempt. It requires the
|
|
17
|
+
* Trust SDK to be initialized (opening the wallet derives keys through it).
|
|
18
|
+
*/
|
|
19
|
+
export declare class AgentWalletLoader {
|
|
20
|
+
private readonly deps;
|
|
21
|
+
private loaded?;
|
|
22
|
+
private attempt?;
|
|
23
|
+
constructor(deps: AgentWalletLoaderDeps);
|
|
24
|
+
private open;
|
|
25
|
+
/** The loaded wallet; never loads. */
|
|
26
|
+
get current(): AgentWalletProvider | undefined;
|
|
27
|
+
/** Rejects with WalletError WALLET_NOT_FOUND, PASSWORD_MISSING or
|
|
28
|
+
* WALLET_AUTH_FAILED, or the underlying error when unclassified. */
|
|
29
|
+
load(): Promise<AgentWalletProvider>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=agent-wallet-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-wallet-loader.d.ts","sourceRoot":"","sources":["../src/agent-wallet-loader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExD,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACrC;6DACyD;IACzD,eAAe,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACnD,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACzD,6CAA6C;IAC7C,QAAQ,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACjD;AAED;;;;;;;GAOG;AACH,qBAAa,iBAAiB;IAIhB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAHjC,OAAO,CAAC,MAAM,CAAC,CAAsB;IACrC,OAAO,CAAC,OAAO,CAAC,CAA+B;gBAElB,IAAI,EAAE,qBAAqB;YAE1C,IAAI;IA4BlB,sCAAsC;IACtC,IAAI,OAAO,IAAI,mBAAmB,GAAG,SAAS,CAE7C;IAED;wEACoE;IAC9D,IAAI,IAAI,OAAO,CAAC,mBAAmB,CAAC;CAS3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+C1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"erc8004.d.ts","sourceRoot":"","sources":["../../src/commands/erc8004.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4BpC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"erc8004.d.ts","sourceRoot":"","sources":["../../src/commands/erc8004.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4BpC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiM7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqBpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqBpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqG1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onramp.d.ts","sourceRoot":"","sources":["../../src/commands/onramp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2KpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"onramp.d.ts","sourceRoot":"","sources":["../../src/commands/onramp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2KpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkY5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4CpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+P3D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../src/commands/swap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../src/commands/swap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAgQ1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer.d.ts","sourceRoot":"","sources":["../../src/commands/transfer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiBpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"transfer.d.ts","sourceRoot":"","sources":["../../src/commands/transfer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiBpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuI9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/commands/wallet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/commands/wallet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiFpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAymB5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/commands/watch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/commands/watch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmJ3D"}
|
package/dist/config-loader.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { TwakHttpClient } from '@twak/core';
|
|
1
|
+
import { TwakHttpClient, type TwakCredentials } from '@twak/core';
|
|
2
2
|
import { AgentWalletProvider } from '@twak/wallet';
|
|
3
|
-
|
|
4
|
-
accessId: string;
|
|
5
|
-
hmacSecret: string;
|
|
6
|
-
}
|
|
3
|
+
type Credentials = TwakCredentials;
|
|
7
4
|
export declare function getClientFromEnv(): TwakHttpClient;
|
|
5
|
+
/** API credentials from TWAK_ACCESS_ID / TWAK_HMAC_SECRET, then
|
|
6
|
+
* ~/.twak/credentials.json; null when neither has them. */
|
|
7
|
+
export declare function loadCredentials(): Promise<Credentials | null>;
|
|
8
8
|
export declare function getCredentials(): Promise<Credentials>;
|
|
9
9
|
export declare function getClient(): Promise<TwakHttpClient>;
|
|
10
10
|
export declare function tryGetClient(): Promise<TwakHttpClient | undefined>;
|
|
11
|
+
export declare function initTrustSDKWithCredentials(creds: Credentials): Promise<void>;
|
|
11
12
|
export declare function ensureTrustSDK(): Promise<Credentials>;
|
|
12
13
|
export declare function registerWalletWithBackend(creds: Credentials, provider: AgentWalletProvider): Promise<void>;
|
|
13
14
|
export declare function resolvePassword(opts?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../src/config-loader.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../src/config-loader.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,cAAc,EAGd,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAcnD,KAAK,WAAW,GAAG,eAAe,CAAC;AAEnC,wBAAgB,gBAAgB,IAAI,cAAc,CAejD;AAED;2DAC2D;AAC3D,wBAAsB,eAAe,IAAI,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAanE;AAED,wBAAsB,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAQ3D;AAED,wBAAsB,SAAS,IAAI,OAAO,CAAC,cAAc,CAAC,CAGzD;AAED,wBAAsB,YAAY,IAAI,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAGxE;AAED,wBAAsB,2BAA2B,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAMnF;AAED,wBAAsB,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAI3D;AAED,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,mBAAmB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAef;AAED,wBAAsB,eAAe,CAAC,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBnF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials-error.d.ts","sourceRoot":"","sources":["../src/credentials-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C;0BAC0B;AAC1B,wBAAgB,uBAAuB,IAAI,YAAY,CAMtD"}
|