@1sat/sweep-ui 0.0.86 → 0.0.88
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/components/SweepApp.d.ts +9 -0
- package/dist/components/SweepApp.d.ts.map +1 -0
- package/dist/components/asset-preview.d.ts +38 -0
- package/dist/components/asset-preview.d.ts.map +1 -0
- package/dist/components/connect-wallet.d.ts +8 -0
- package/dist/components/connect-wallet.d.ts.map +1 -0
- package/dist/components/opns-section.d.ts +14 -0
- package/dist/components/opns-section.d.ts.map +1 -0
- package/dist/components/sweep-progress.d.ts +9 -0
- package/dist/components/sweep-progress.d.ts.map +1 -0
- package/dist/components/tx-history.d.ts +14 -0
- package/dist/components/tx-history.d.ts.map +1 -0
- package/dist/components/ui/badge.d.ts +8 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +9 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/card.d.ts +10 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/tabs.d.ts +14 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/wif-input.d.ts +9 -0
- package/dist/components/wif-input.d.ts.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2878 -0
- package/dist/lib/legacy-send.d.ts +24 -0
- package/dist/lib/legacy-send.d.ts.map +1 -0
- package/dist/lib/scanner.d.ts +19 -0
- package/dist/lib/scanner.d.ts.map +1 -0
- package/dist/lib/services.d.ts +4 -0
- package/dist/lib/services.d.ts.map +1 -0
- package/dist/lib/sweeper.d.ts +39 -0
- package/dist/lib/sweeper.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +6 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/wallet.d.ts +9 -0
- package/dist/lib/wallet.d.ts.map +1 -0
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { IndexedOutput } from '@1sat/types';
|
|
2
|
+
import type { LegacyKeys } from '../types';
|
|
3
|
+
export interface LegacySendResult {
|
|
4
|
+
txid: string;
|
|
5
|
+
rawtx: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function legacySendBsv(params: {
|
|
8
|
+
funding: IndexedOutput[];
|
|
9
|
+
keys: LegacyKeys;
|
|
10
|
+
destination: string;
|
|
11
|
+
amount?: number;
|
|
12
|
+
}): Promise<LegacySendResult>;
|
|
13
|
+
export declare function legacySendOrdinals(params: {
|
|
14
|
+
ordinals: IndexedOutput[];
|
|
15
|
+
funding: IndexedOutput[];
|
|
16
|
+
keys: LegacyKeys;
|
|
17
|
+
destination: string;
|
|
18
|
+
}): Promise<LegacySendResult>;
|
|
19
|
+
export declare function legacyBurnOrdinals(params: {
|
|
20
|
+
ordinals: IndexedOutput[];
|
|
21
|
+
funding: IndexedOutput[];
|
|
22
|
+
keys: LegacyKeys;
|
|
23
|
+
}): Promise<LegacySendResult>;
|
|
24
|
+
//# sourceMappingURL=legacy-send.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-send.d.ts","sourceRoot":"","sources":["../../src/lib/legacy-send.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAIhD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAI1C,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACb;AAuCD,wBAAsB,aAAa,CAAC,MAAM,EAAE;IAC3C,OAAO,EAAE,aAAa,EAAE,CAAA;IACxB,IAAI,EAAE,UAAU,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAiD5B;AAED,wBAAsB,kBAAkB,CAAC,MAAM,EAAE;IAChD,QAAQ,EAAE,aAAa,EAAE,CAAA;IACzB,OAAO,EAAE,aAAa,EAAE,CAAA;IACxB,IAAI,EAAE,UAAU,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;CACnB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA0D5B;AAED,wBAAsB,kBAAkB,CAAC,MAAM,EAAE;IAChD,QAAQ,EAAE,aAAa,EAAE,CAAA;IACzB,OAAO,EAAE,aAAa,EAAE,CAAA;IACxB,IAAI,EAAE,UAAU,CAAA;CAChB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA8D5B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ScanProgress, type ScanResult, type TokenBalance } from '@1sat/actions';
|
|
2
|
+
import type { IndexedOutput } from '@1sat/types';
|
|
3
|
+
export type { TokenBalance, ScanProgress, ScanResult };
|
|
4
|
+
export interface EnrichedOrdinal extends IndexedOutput {
|
|
5
|
+
origin?: string;
|
|
6
|
+
contentType?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
contentUrl: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ScannedAssets extends Omit<ScanResult, 'ordinals' | 'opnsNames'> {
|
|
11
|
+
ordinals: EnrichedOrdinal[];
|
|
12
|
+
opnsNames: EnrichedOrdinal[];
|
|
13
|
+
bsv21Tokens: TokenBalance[];
|
|
14
|
+
totalBsv: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function deriveAddress(wif: string): string;
|
|
17
|
+
export declare function scanAddress(address: string, onProgress?: (p: ScanProgress) => void): Promise<ScannedAssets>;
|
|
18
|
+
export declare function scanAddresses(addresses: string[], onProgress?: (p: ScanProgress) => void): Promise<ScannedAssets>;
|
|
19
|
+
//# sourceMappingURL=scanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../../src/lib/scanner.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,YAAY,EAEjB,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAIhD,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,CAAA;AAEtD,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACrD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,aAChB,SAAQ,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,WAAW,CAAC;IAClD,QAAQ,EAAE,eAAe,EAAE,CAAA;IAC3B,SAAS,EAAE,eAAe,EAAE,CAAA;IAC5B,WAAW,EAAE,YAAY,EAAE,CAAA;IAC3B,QAAQ,EAAE,MAAM,CAAA;CAChB;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjD;AA2CD,wBAAsB,WAAW,CAChC,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,IAAI,GACpC,OAAO,CAAC,aAAa,CAAC,CAGxB;AAED,wBAAsB,aAAa,CAClC,SAAS,EAAE,MAAM,EAAE,EACnB,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,IAAI,GACpC,OAAO,CAAC,aAAa,CAAC,CAIxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/lib/services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAK7C,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAGvD;AAED,wBAAgB,WAAW,IAAI,cAAc,CAS5C"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { IndexedOutput } from '@1sat/types';
|
|
2
|
+
import type { PrivateKey, WalletInterface } from '@bsv/sdk';
|
|
3
|
+
import type { TokenBalance } from './scanner';
|
|
4
|
+
/** Page size, select-page size, and createAction batch size for ordinal/OpNS sweeps. */
|
|
5
|
+
export declare const SWEEP_BATCH_SIZE = 25;
|
|
6
|
+
export interface SweepResult {
|
|
7
|
+
bsvTxid?: string;
|
|
8
|
+
ordinalTxids: string[];
|
|
9
|
+
bsv21Txids: string[];
|
|
10
|
+
errors: string[];
|
|
11
|
+
/** Outpoints successfully swept (ordinals/OpNS). */
|
|
12
|
+
sweptOutpoints: string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Sweep BSV funding and ordinals into the connected wallet.
|
|
16
|
+
* Ordinals are processed in batches of {@link SWEEP_BATCH_SIZE}; stops on first batch error.
|
|
17
|
+
*/
|
|
18
|
+
export declare function executeSweep(params: {
|
|
19
|
+
wallet: WalletInterface;
|
|
20
|
+
keys: Map<string, PrivateKey>;
|
|
21
|
+
funding: IndexedOutput[];
|
|
22
|
+
ordinals: IndexedOutput[];
|
|
23
|
+
amount?: number;
|
|
24
|
+
onProgress: (stage: string) => void;
|
|
25
|
+
}): Promise<SweepResult>;
|
|
26
|
+
/**
|
|
27
|
+
* Sweep a single BSV-21 token into the connected wallet.
|
|
28
|
+
* Each token requires its own transaction since all inputs must share a tokenId.
|
|
29
|
+
*/
|
|
30
|
+
export declare function sweepBsv21Token(params: {
|
|
31
|
+
wallet: WalletInterface;
|
|
32
|
+
keys: Map<string, PrivateKey>;
|
|
33
|
+
token: TokenBalance;
|
|
34
|
+
onProgress: (stage: string) => void;
|
|
35
|
+
}): Promise<{
|
|
36
|
+
txid?: string;
|
|
37
|
+
error?: string;
|
|
38
|
+
}>;
|
|
39
|
+
//# sourceMappingURL=sweeper.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AAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA4B7C"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ClassValue } from 'clsx';
|
|
2
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
3
|
+
export declare function formatSats(sats: number): string;
|
|
4
|
+
export declare function formatTokenAmount(rawAmount: string, decimals: number): string;
|
|
5
|
+
export declare function truncate(s: string, len?: number): string;
|
|
6
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAA;AAG5C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAM7E;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,SAAI,GAAG,MAAM,CAGnD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ConnectWalletResult } from '@1sat/connect';
|
|
2
|
+
import type { WalletInterface } from '@bsv/sdk';
|
|
3
|
+
export declare function connectWallet(): Promise<ConnectWalletResult>;
|
|
4
|
+
export declare function getWallet(): WalletInterface | null;
|
|
5
|
+
export declare function getIdentityKey(): string | null;
|
|
6
|
+
export declare function getProvider(): string | null;
|
|
7
|
+
export declare function disconnectWallet(): void;
|
|
8
|
+
export declare function isConnected(): boolean;
|
|
9
|
+
//# sourceMappingURL=wallet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/lib/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,mBAAmB,EAExB,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI/C,wBAAsB,aAAa,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAKlE;AAED,wBAAgB,SAAS,IAAI,eAAe,GAAG,IAAI,CAElD;AAED,wBAAgB,cAAc,IAAI,MAAM,GAAG,IAAI,CAE9C;AAED,wBAAgB,WAAW,IAAI,MAAM,GAAG,IAAI,CAE3C;AAED,wBAAgB,gBAAgB,IAAI,IAAI,CAGvC;AAED,wBAAgB,WAAW,IAAI,OAAO,CAErC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;CACnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1sat/sweep-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.88",
|
|
4
4
|
"description": "Sweep UI components for migrating legacy BSV assets",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
],
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@1sat/actions": "0.0.
|
|
33
|
-
"@1sat/client": "0.0.
|
|
34
|
-
"@1sat/connect": "0.0.
|
|
35
|
-
"@1sat/types": "0.0.
|
|
36
|
-
"@1sat/utils": "0.0.
|
|
32
|
+
"@1sat/actions": "0.0.204",
|
|
33
|
+
"@1sat/client": "0.0.51",
|
|
34
|
+
"@1sat/connect": "0.0.90",
|
|
35
|
+
"@1sat/types": "0.0.41",
|
|
36
|
+
"@1sat/utils": "0.0.34",
|
|
37
37
|
"bitcoin-backup": "^0.0.11",
|
|
38
38
|
"class-variance-authority": "^0.7.1",
|
|
39
39
|
"clsx": "^2.1.1",
|