@layr-labs/ecloud-sdk 0.4.0-dev.1 → 0.4.0-dev.2
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/VERSION +2 -0
- package/dist/attest.cjs +185 -0
- package/dist/attest.cjs.map +1 -0
- package/dist/attest.d.cts +28 -0
- package/dist/attest.d.ts +28 -0
- package/dist/attest.js +147 -0
- package/dist/attest.js.map +1 -0
- package/dist/billing.cjs +1380 -4
- package/dist/billing.cjs.map +1 -1
- package/dist/billing.d.cts +25 -3
- package/dist/billing.d.ts +25 -3
- package/dist/billing.js +1380 -4
- package/dist/billing.js.map +1 -1
- package/dist/browser.cjs +3 -2
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +4 -4
- package/dist/browser.d.ts +4 -4
- package/dist/browser.js +3 -2
- package/dist/browser.js.map +1 -1
- package/dist/{compute-DccJLbtV.d.cts → compute-BRDk7QM4.d.cts} +1 -1
- package/dist/{compute-DlilmZYC.d.ts → compute-CC55YQ_a.d.ts} +1 -1
- package/dist/compute.cjs +8 -3
- package/dist/compute.cjs.map +1 -1
- package/dist/compute.d.cts +2 -2
- package/dist/compute.d.ts +2 -2
- package/dist/compute.js +8 -3
- package/dist/compute.js.map +1 -1
- package/dist/{helpers-D_AbDeP4.d.ts → helpers-BcoV07Me.d.ts} +1 -1
- package/dist/{helpers-BNeMZYcY.d.cts → helpers-DdtPaQr9.d.cts} +1 -1
- package/dist/{index-DD7ZLbqD.d.cts → index-BEbhrwWl.d.cts} +1 -0
- package/dist/{index-DD7ZLbqD.d.ts → index-BEbhrwWl.d.ts} +1 -0
- package/dist/index.cjs +330 -95
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.js +328 -95
- package/dist/index.js.map +1 -1
- package/package.json +16 -10
- package/tools/kms-client-linux-amd64 +0 -0
- package/tools/tls-keygen-linux-amd64 +0 -0
- package/LICENSE +0 -7
package/dist/billing.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Address, WalletClient } from 'viem';
|
|
2
|
-
import { av as SubscriptionOpts, aq as SubscribeResponse, au as ProductSubscriptionResponse, at as CancelResponse } from './index-
|
|
1
|
+
import { Address, Hex, WalletClient, PublicClient } from 'viem';
|
|
2
|
+
import { av as SubscriptionOpts, aq as SubscribeResponse, au as ProductSubscriptionResponse, at as CancelResponse } from './index-BEbhrwWl.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Main Billing namespace entry point
|
|
@@ -8,17 +8,39 @@ import { av as SubscriptionOpts, aq as SubscribeResponse, au as ProductSubscript
|
|
|
8
8
|
* (privateKeyToAccount) and external signers (MetaMask, etc.).
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
interface TopUpOpts {
|
|
12
|
+
/** Amount in raw USDC units (6 decimals, e.g. 50_000_000n = 50 USDC) */
|
|
13
|
+
amount: bigint;
|
|
14
|
+
/** Target account for purchaseCreditsFor (defaults to wallet address) */
|
|
15
|
+
account?: Address;
|
|
16
|
+
}
|
|
17
|
+
interface TopUpResult {
|
|
18
|
+
txHash: Hex;
|
|
19
|
+
walletAddress: Address;
|
|
20
|
+
}
|
|
21
|
+
interface TopUpInfo {
|
|
22
|
+
usdcAddress: Address;
|
|
23
|
+
minimumPurchase: bigint;
|
|
24
|
+
usdcBalance: bigint;
|
|
25
|
+
currentAllowance: bigint;
|
|
26
|
+
}
|
|
11
27
|
interface BillingModule {
|
|
12
28
|
address: Address;
|
|
13
29
|
subscribe: (opts?: SubscriptionOpts) => Promise<SubscribeResponse>;
|
|
14
30
|
getStatus: (opts?: SubscriptionOpts) => Promise<ProductSubscriptionResponse>;
|
|
15
31
|
cancel: (opts?: SubscriptionOpts) => Promise<CancelResponse>;
|
|
32
|
+
/** Read on-chain state needed for top-up */
|
|
33
|
+
getTopUpInfo: () => Promise<TopUpInfo>;
|
|
34
|
+
/** Purchase credits with USDC on-chain */
|
|
35
|
+
topUp: (opts: TopUpOpts) => Promise<TopUpResult>;
|
|
16
36
|
}
|
|
17
37
|
interface BillingModuleConfig {
|
|
18
38
|
verbose?: boolean;
|
|
19
39
|
walletClient: WalletClient;
|
|
20
40
|
skipTelemetry?: boolean;
|
|
41
|
+
publicClient: PublicClient;
|
|
42
|
+
environment: string;
|
|
21
43
|
}
|
|
22
44
|
declare function createBillingModule(config: BillingModuleConfig): BillingModule;
|
|
23
45
|
|
|
24
|
-
export { type BillingModule, type BillingModuleConfig, createBillingModule };
|
|
46
|
+
export { type BillingModule, type BillingModuleConfig, type TopUpInfo, type TopUpOpts, type TopUpResult, createBillingModule };
|
package/dist/billing.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Address, WalletClient } from 'viem';
|
|
2
|
-
import { av as SubscriptionOpts, aq as SubscribeResponse, au as ProductSubscriptionResponse, at as CancelResponse } from './index-
|
|
1
|
+
import { Address, Hex, WalletClient, PublicClient } from 'viem';
|
|
2
|
+
import { av as SubscriptionOpts, aq as SubscribeResponse, au as ProductSubscriptionResponse, at as CancelResponse } from './index-BEbhrwWl.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Main Billing namespace entry point
|
|
@@ -8,17 +8,39 @@ import { av as SubscriptionOpts, aq as SubscribeResponse, au as ProductSubscript
|
|
|
8
8
|
* (privateKeyToAccount) and external signers (MetaMask, etc.).
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
interface TopUpOpts {
|
|
12
|
+
/** Amount in raw USDC units (6 decimals, e.g. 50_000_000n = 50 USDC) */
|
|
13
|
+
amount: bigint;
|
|
14
|
+
/** Target account for purchaseCreditsFor (defaults to wallet address) */
|
|
15
|
+
account?: Address;
|
|
16
|
+
}
|
|
17
|
+
interface TopUpResult {
|
|
18
|
+
txHash: Hex;
|
|
19
|
+
walletAddress: Address;
|
|
20
|
+
}
|
|
21
|
+
interface TopUpInfo {
|
|
22
|
+
usdcAddress: Address;
|
|
23
|
+
minimumPurchase: bigint;
|
|
24
|
+
usdcBalance: bigint;
|
|
25
|
+
currentAllowance: bigint;
|
|
26
|
+
}
|
|
11
27
|
interface BillingModule {
|
|
12
28
|
address: Address;
|
|
13
29
|
subscribe: (opts?: SubscriptionOpts) => Promise<SubscribeResponse>;
|
|
14
30
|
getStatus: (opts?: SubscriptionOpts) => Promise<ProductSubscriptionResponse>;
|
|
15
31
|
cancel: (opts?: SubscriptionOpts) => Promise<CancelResponse>;
|
|
32
|
+
/** Read on-chain state needed for top-up */
|
|
33
|
+
getTopUpInfo: () => Promise<TopUpInfo>;
|
|
34
|
+
/** Purchase credits with USDC on-chain */
|
|
35
|
+
topUp: (opts: TopUpOpts) => Promise<TopUpResult>;
|
|
16
36
|
}
|
|
17
37
|
interface BillingModuleConfig {
|
|
18
38
|
verbose?: boolean;
|
|
19
39
|
walletClient: WalletClient;
|
|
20
40
|
skipTelemetry?: boolean;
|
|
41
|
+
publicClient: PublicClient;
|
|
42
|
+
environment: string;
|
|
21
43
|
}
|
|
22
44
|
declare function createBillingModule(config: BillingModuleConfig): BillingModule;
|
|
23
45
|
|
|
24
|
-
export { type BillingModule, type BillingModuleConfig, createBillingModule };
|
|
46
|
+
export { type BillingModule, type BillingModuleConfig, type TopUpInfo, type TopUpOpts, type TopUpResult, createBillingModule };
|