@slvr-labs/sdk 0.1.0 → 0.1.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/README.md +42 -0
- package/dist/index.d.mts +2117 -0
- package/dist/index.d.ts +1903 -34
- package/dist/index.js +3091 -427
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3035 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +19 -11
- package/skills/slvr-bot/SKILL.md +9 -8
- package/skills/slvr-bot/references/api.md +8 -0
- package/dist/connect.d.ts +0 -47
- package/dist/connect.d.ts.map +0 -1
- package/dist/connect.js +0 -56
- package/dist/connect.js.map +0 -1
- package/dist/contracts/autoCommit.d.ts +0 -151
- package/dist/contracts/autoCommit.d.ts.map +0 -1
- package/dist/contracts/autoCommit.js +0 -426
- package/dist/contracts/autoCommit.js.map +0 -1
- package/dist/contracts/hub.d.ts +0 -50
- package/dist/contracts/hub.d.ts.map +0 -1
- package/dist/contracts/hub.js +0 -118
- package/dist/contracts/hub.js.map +0 -1
- package/dist/contracts/index.d.ts +0 -8
- package/dist/contracts/index.d.ts.map +0 -1
- package/dist/contracts/index.js +0 -18
- package/dist/contracts/index.js.map +0 -1
- package/dist/contracts/jackpot.d.ts +0 -21
- package/dist/contracts/jackpot.d.ts.map +0 -1
- package/dist/contracts/jackpot.js +0 -44
- package/dist/contracts/jackpot.js.map +0 -1
- package/dist/contracts/lottery.d.ts +0 -256
- package/dist/contracts/lottery.d.ts.map +0 -1
- package/dist/contracts/lottery.js +0 -767
- package/dist/contracts/lottery.js.map +0 -1
- package/dist/contracts/registry.d.ts +0 -53
- package/dist/contracts/registry.d.ts.map +0 -1
- package/dist/contracts/registry.js +0 -143
- package/dist/contracts/registry.js.map +0 -1
- package/dist/contracts/staking.d.ts +0 -101
- package/dist/contracts/staking.d.ts.map +0 -1
- package/dist/contracts/staking.js +0 -306
- package/dist/contracts/staking.js.map +0 -1
- package/dist/contracts/token.d.ts +0 -95
- package/dist/contracts/token.d.ts.map +0 -1
- package/dist/contracts/token.js +0 -273
- package/dist/contracts/token.js.map +0 -1
- package/dist/deployments.d.ts +0 -117
- package/dist/deployments.d.ts.map +0 -1
- package/dist/deployments.js +0 -74
- package/dist/deployments.js.map +0 -1
- package/dist/errors.d.ts +0 -39
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -67
- package/dist/errors.js.map +0 -1
- package/dist/ev.d.ts +0 -123
- package/dist/ev.d.ts.map +0 -1
- package/dist/ev.js +0 -111
- package/dist/ev.js.map +0 -1
- package/dist/events.d.ts +0 -418
- package/dist/events.d.ts.map +0 -1
- package/dist/events.js +0 -87
- package/dist/events.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/oracle.d.ts +0 -48
- package/dist/oracle.d.ts.map +0 -1
- package/dist/oracle.js +0 -77
- package/dist/oracle.js.map +0 -1
- package/dist/price.d.ts +0 -52
- package/dist/price.d.ts.map +0 -1
- package/dist/price.js +0 -78
- package/dist/price.js.map +0 -1
- package/dist/transaction.d.ts +0 -54
- package/dist/transaction.d.ts.map +0 -1
- package/dist/transaction.js +0 -105
- package/dist/transaction.js.map +0 -1
- package/dist/types.d.ts +0 -162
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -23
- package/dist/types.js.map +0 -1
- package/dist/utils.d.ts +0 -58
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -110
- package/dist/utils.js.map +0 -1
package/dist/connect.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Account, Chain, PublicClient, Transport, WalletClient } from 'viem';
|
|
2
|
-
import { SlvrDeployment } from './deployments';
|
|
3
|
-
/**
|
|
4
|
-
* Options for {@link createSlvrClients} / {@link SlvrSDK.connect}.
|
|
5
|
-
*/
|
|
6
|
-
export interface ConnectOptions {
|
|
7
|
-
/** Which deployment to target. Defaults to `robinhood`. */
|
|
8
|
-
deployment?: SlvrDeployment;
|
|
9
|
-
/** RPC URL. Defaults to the deployment's `rpcUrl`. Ignored if `transport` is given. */
|
|
10
|
-
rpcUrl?: string;
|
|
11
|
-
/** A fully-custom viem transport (overrides `rpcUrl`). */
|
|
12
|
-
transport?: Transport;
|
|
13
|
-
/** A private key to build a wallet client from (for sending transactions). */
|
|
14
|
-
privateKey?: `0x${string}`;
|
|
15
|
-
/** …or an already-built viem `Account` (alternative to `privateKey`). */
|
|
16
|
-
account?: Account;
|
|
17
|
-
/** Auto-batch concurrent reads through Multicall3. Defaults to `true`. */
|
|
18
|
-
batchMulticall?: boolean;
|
|
19
|
-
/** viem polling interval (ms) used by event watchers. */
|
|
20
|
-
pollingInterval?: number;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Build a viem `Chain` for a deployment. Returns the shipped `robinhoodChain`
|
|
24
|
-
* (which already registers Multicall3) for the Robinhood deployment; otherwise
|
|
25
|
-
* synthesizes one, wiring `multicall3` when the deployment provides it.
|
|
26
|
-
*/
|
|
27
|
-
export declare function chainFromDeployment(deployment: SlvrDeployment): Chain;
|
|
28
|
-
/** Clients returned by {@link createSlvrClients}. */
|
|
29
|
-
export interface SlvrClients {
|
|
30
|
-
chain: Chain;
|
|
31
|
-
publicClient: PublicClient;
|
|
32
|
-
/** Present only when a `privateKey` or `account` was supplied. */
|
|
33
|
-
walletClient?: WalletClient;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Create ready-to-use viem clients for a Slvr deployment with sensible, resilient
|
|
37
|
-
* defaults — Multicall3 auto-batching, a longer timeout, and retries — so you
|
|
38
|
-
* don't have to hand-tune the transport for a polling bot.
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* ```typescript
|
|
42
|
-
* import { createSlvrClients } from '@slvr-labs/sdk';
|
|
43
|
-
* const { publicClient, walletClient } = createSlvrClients({ privateKey: process.env.PRIVATE_KEY });
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
export declare function createSlvrClients(opts?: ConnectOptions): SlvrClients;
|
|
47
|
-
//# sourceMappingURL=connect.d.ts.map
|
package/dist/connect.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,KAAK,EACL,YAAY,EACZ,SAAS,EACT,YAAY,EAKb,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,cAAc,EAA6B,MAAM,eAAe,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,2DAA2D;IAC3D,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,uFAAuF;IACvF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,8EAA8E;IAC9E,UAAU,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;IAC3B,yEAAyE;IACzE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0EAA0E;IAC1E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yDAAyD;IACzD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,cAAc,GAAG,KAAK,CAcrE;AAED,qDAAqD;AACrD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,YAAY,CAAC;IAC3B,kEAAkE;IAClE,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,cAAmB,GAAG,WAAW,CAkBxE"}
|
package/dist/connect.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.chainFromDeployment = chainFromDeployment;
|
|
4
|
-
exports.createSlvrClients = createSlvrClients;
|
|
5
|
-
const viem_1 = require("viem");
|
|
6
|
-
const accounts_1 = require("viem/accounts");
|
|
7
|
-
const deployments_1 = require("./deployments");
|
|
8
|
-
/**
|
|
9
|
-
* Build a viem `Chain` for a deployment. Returns the shipped `robinhoodChain`
|
|
10
|
-
* (which already registers Multicall3) for the Robinhood deployment; otherwise
|
|
11
|
-
* synthesizes one, wiring `multicall3` when the deployment provides it.
|
|
12
|
-
*/
|
|
13
|
-
function chainFromDeployment(deployment) {
|
|
14
|
-
if (deployment.chainId === deployments_1.robinhood.chainId)
|
|
15
|
-
return deployments_1.robinhoodChain;
|
|
16
|
-
return (0, viem_1.defineChain)({
|
|
17
|
-
id: deployment.chainId,
|
|
18
|
-
name: deployment.name,
|
|
19
|
-
nativeCurrency: { decimals: 18, name: 'Ether', symbol: 'ETH' },
|
|
20
|
-
rpcUrls: { default: { http: [deployment.rpcUrl] } },
|
|
21
|
-
...(deployment.blockExplorer
|
|
22
|
-
? { blockExplorers: { default: { name: 'Explorer', url: deployment.blockExplorer } } }
|
|
23
|
-
: {}),
|
|
24
|
-
...(deployment.addresses.multicall3
|
|
25
|
-
? { contracts: { multicall3: { address: deployment.addresses.multicall3 } } }
|
|
26
|
-
: {}),
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Create ready-to-use viem clients for a Slvr deployment with sensible, resilient
|
|
31
|
-
* defaults — Multicall3 auto-batching, a longer timeout, and retries — so you
|
|
32
|
-
* don't have to hand-tune the transport for a polling bot.
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```typescript
|
|
36
|
-
* import { createSlvrClients } from '@slvr-labs/sdk';
|
|
37
|
-
* const { publicClient, walletClient } = createSlvrClients({ privateKey: process.env.PRIVATE_KEY });
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
function createSlvrClients(opts = {}) {
|
|
41
|
-
const deployment = opts.deployment ?? deployments_1.robinhood;
|
|
42
|
-
const chain = chainFromDeployment(deployment);
|
|
43
|
-
const transport = opts.transport ?? (0, viem_1.http)(opts.rpcUrl ?? deployment.rpcUrl, { timeout: 20000, retryCount: 3 });
|
|
44
|
-
const publicClient = (0, viem_1.createPublicClient)({
|
|
45
|
-
chain,
|
|
46
|
-
transport,
|
|
47
|
-
batch: { multicall: opts.batchMulticall ?? true },
|
|
48
|
-
...(opts.pollingInterval ? { pollingInterval: opts.pollingInterval } : {}),
|
|
49
|
-
});
|
|
50
|
-
const account = opts.account ?? (opts.privateKey ? (0, accounts_1.privateKeyToAccount)(opts.privateKey) : undefined);
|
|
51
|
-
const walletClient = account
|
|
52
|
-
? (0, viem_1.createWalletClient)({ chain, transport, account })
|
|
53
|
-
: undefined;
|
|
54
|
-
return { chain, publicClient, walletClient };
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=connect.js.map
|
package/dist/connect.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":";;AAuCA,kDAcC;AAqBD,8CAkBC;AA5FD,+BAUc;AACd,4CAAoD;AACpD,+CAA0E;AAsB1E;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,UAA0B;IAC5D,IAAI,UAAU,CAAC,OAAO,KAAK,uBAAS,CAAC,OAAO;QAAE,OAAO,4BAAc,CAAC;IACpE,OAAO,IAAA,kBAAW,EAAC;QACjB,EAAE,EAAE,UAAU,CAAC,OAAO;QACtB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,cAAc,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE;QAC9D,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,EAAE;QACnD,GAAG,CAAC,UAAU,CAAC,aAAa;YAC1B,CAAC,CAAC,EAAE,cAAc,EAAE,EAAE,OAAO,EAAE,E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AK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAkB;QACrE,CAAC,CAAC,SAAS,CAAC;IAEd,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { Address, PublicClient, WalletClient } from 'viem';
|
|
2
|
-
import { AutoCommitPlan } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* SlvrAutoCommitV2 contract interface
|
|
5
|
-
*
|
|
6
|
-
* V2 economics: executors calling executeFor/claimFor are reimbursed their
|
|
7
|
-
* metered gas (plus a premium, capped at maxFeePerExecution — both owner-tunable
|
|
8
|
-
* within hard ceilings) from the user's plan balance — there is no flat
|
|
9
|
-
* AUTOMATION_FEE and the execution functions are nonpayable. Claimable winning
|
|
10
|
-
* rounds are discovered off-chain and passed in explicitly via claimRounds.
|
|
11
|
-
*/
|
|
12
|
-
export declare class SlvrAutoCommit {
|
|
13
|
-
private publicClient;
|
|
14
|
-
private walletClient?;
|
|
15
|
-
private address;
|
|
16
|
-
private static readonly ABI;
|
|
17
|
-
constructor(publicClient: PublicClient, walletClient: WalletClient | undefined, address: Address);
|
|
18
|
-
/**
|
|
19
|
-
* Update the wallet client
|
|
20
|
-
* @param walletClient New wallet client
|
|
21
|
-
*/
|
|
22
|
-
setWalletClient(walletClient: WalletClient | undefined): void;
|
|
23
|
-
/**
|
|
24
|
-
* Get plan information for a user
|
|
25
|
-
*/
|
|
26
|
-
planInfo(user: Address): Promise<AutoCommitPlan>;
|
|
27
|
-
/**
|
|
28
|
-
* Check whether a plan is ready to execute, and if not, why
|
|
29
|
-
*/
|
|
30
|
-
needsExecution(user: Address): Promise<{
|
|
31
|
-
ready: boolean;
|
|
32
|
-
reason: string;
|
|
33
|
-
}>;
|
|
34
|
-
/**
|
|
35
|
-
* Check whether a specific round has already been executed for a user
|
|
36
|
-
*/
|
|
37
|
-
executedRound(user: Address, roundId: bigint): Promise<boolean>;
|
|
38
|
-
/**
|
|
39
|
-
* Get lottery contract address
|
|
40
|
-
*/
|
|
41
|
-
lottery(): Promise<Address>;
|
|
42
|
-
/**
|
|
43
|
-
* Get the sentinel plays value meaning "unlimited plays"
|
|
44
|
-
*/
|
|
45
|
-
unlimitedPlays(): Promise<number>;
|
|
46
|
-
/**
|
|
47
|
-
* Get max plays per execution
|
|
48
|
-
*/
|
|
49
|
-
maxPlaysPerExecution(): Promise<number>;
|
|
50
|
-
/**
|
|
51
|
-
* Get max claim rounds accepted per execution
|
|
52
|
-
*/
|
|
53
|
-
maxClaimsPerExecution(): Promise<bigint>;
|
|
54
|
-
/**
|
|
55
|
-
* Get the current cap on the executor fee reimbursed per execution
|
|
56
|
-
* (owner-tunable within the contract's hard ceiling)
|
|
57
|
-
*/
|
|
58
|
-
maxFeePerExecution(): Promise<bigint>;
|
|
59
|
-
/**
|
|
60
|
-
* Get the current executor-fee premium in basis points
|
|
61
|
-
* (owner-tunable within the contract's hard ceiling)
|
|
62
|
-
*/
|
|
63
|
-
feePremiumBps(): Promise<number>;
|
|
64
|
-
/**
|
|
65
|
-
* Deposit native tokens to auto-commit plan
|
|
66
|
-
* @param value Amount to deposit
|
|
67
|
-
* @returns Transaction hash
|
|
68
|
-
* @throws WalletClientRequiredError if wallet client is not available
|
|
69
|
-
* @throws ValidationError if amount is invalid
|
|
70
|
-
* @throws ContractCallError if contract call fails
|
|
71
|
-
*/
|
|
72
|
-
deposit(value: bigint): Promise<`0x${string}`>;
|
|
73
|
-
/**
|
|
74
|
-
* Withdraw from auto-commit plan
|
|
75
|
-
* @param amount Amount to withdraw
|
|
76
|
-
* @param to Recipient address
|
|
77
|
-
* @returns Transaction hash
|
|
78
|
-
* @throws WalletClientRequiredError if wallet client is not available
|
|
79
|
-
* @throws ValidationError if inputs are invalid
|
|
80
|
-
* @throws ContractCallError if contract call fails
|
|
81
|
-
*/
|
|
82
|
-
withdraw(amount: bigint, to: Address): Promise<`0x${string}`>;
|
|
83
|
-
/**
|
|
84
|
-
* Configure auto-commit plan
|
|
85
|
-
* @param plays Number of plays (UNLIMITED_PLAYS = 4294967295 for unlimited;
|
|
86
|
-
* forced to unlimited on-chain when autoClaim is true)
|
|
87
|
-
* @param amountPerPlay Amount per play
|
|
88
|
-
* @param squares Square indices to bet on
|
|
89
|
-
* @param bpsAlloc Basis points allocation for each square (must sum to 10000)
|
|
90
|
-
* @param autoClaim Whether the keeper should claim winnings back into the plan balance
|
|
91
|
-
* @returns Transaction hash
|
|
92
|
-
* @throws WalletClientRequiredError if wallet client is not available
|
|
93
|
-
* @throws ValidationError if inputs are invalid
|
|
94
|
-
* @throws ContractCallError if contract call fails
|
|
95
|
-
*/
|
|
96
|
-
configurePlan(plays: number, amountPerPlay: bigint, squares: number[], bpsAlloc: number[], autoClaim: boolean): Promise<`0x${string}`>;
|
|
97
|
-
/**
|
|
98
|
-
* Configure auto-commit plan and deposit funds in a single transaction
|
|
99
|
-
* @param plays Number of plays (see configurePlan)
|
|
100
|
-
* @param amountPerPlay Amount per play
|
|
101
|
-
* @param squares Square indices to bet on
|
|
102
|
-
* @param bpsAlloc Basis points allocation for each square (must sum to 10000)
|
|
103
|
-
* @param autoClaim Whether the keeper should claim winnings back into the plan balance
|
|
104
|
-
* @param value Amount to deposit
|
|
105
|
-
* @returns Transaction hash
|
|
106
|
-
* @throws WalletClientRequiredError if wallet client is not available
|
|
107
|
-
* @throws ValidationError if inputs are invalid
|
|
108
|
-
* @throws ContractCallError if contract call fails
|
|
109
|
-
*/
|
|
110
|
-
configurePlanAndDeposit(plays: number, amountPerPlay: bigint, squares: number[], bpsAlloc: number[], autoClaim: boolean, value: bigint): Promise<`0x${string}`>;
|
|
111
|
-
/**
|
|
112
|
-
* Disable auto-commit plan
|
|
113
|
-
* @returns Transaction hash
|
|
114
|
-
* @throws WalletClientRequiredError if wallet client is not available
|
|
115
|
-
* @throws ContractCallError if contract call fails
|
|
116
|
-
*/
|
|
117
|
-
disablePlan(): Promise<`0x${string}`>;
|
|
118
|
-
/**
|
|
119
|
-
* Cancel the plan and refund the entire remaining balance to the caller
|
|
120
|
-
* @returns Transaction hash
|
|
121
|
-
* @throws WalletClientRequiredError if wallet client is not available
|
|
122
|
-
* @throws ContractCallError if contract call fails
|
|
123
|
-
*/
|
|
124
|
-
cancelPlan(): Promise<`0x${string}`>;
|
|
125
|
-
/**
|
|
126
|
-
* Execute auto-commit plan for a user (anyone can call).
|
|
127
|
-
* The caller is reimbursed metered gas + premium from the user's plan balance.
|
|
128
|
-
* @param user User address
|
|
129
|
-
* @param maxPlays Maximum number of plays to execute
|
|
130
|
-
* @param claimRounds Winning round ids to claim into the plan balance before
|
|
131
|
-
* betting (discovered off-chain; non-claimable entries are no-ops)
|
|
132
|
-
* @returns Transaction hash
|
|
133
|
-
* @throws WalletClientRequiredError if wallet client is not available
|
|
134
|
-
* @throws ValidationError if inputs are invalid
|
|
135
|
-
* @throws ContractCallError if contract call fails
|
|
136
|
-
*/
|
|
137
|
-
executeFor(user: Address, maxPlays: number, claimRounds?: bigint[]): Promise<`0x${string}`>;
|
|
138
|
-
/**
|
|
139
|
-
* Claim winning rounds into a user's plan balance without betting (anyone can
|
|
140
|
-
* call). Useful when the plan balance is too low to bet until winnings land.
|
|
141
|
-
* @param user User address
|
|
142
|
-
* @param claimRounds Winning round ids to claim (discovered off-chain)
|
|
143
|
-
* @returns Transaction hash
|
|
144
|
-
* @throws WalletClientRequiredError if wallet client is not available
|
|
145
|
-
* @throws ValidationError if inputs are invalid
|
|
146
|
-
* @throws ContractCallError if contract call fails
|
|
147
|
-
*/
|
|
148
|
-
claimFor(user: Address, claimRounds: bigint[]): Promise<`0x${string}`>;
|
|
149
|
-
private validatePlanConfig;
|
|
150
|
-
}
|
|
151
|
-
//# sourceMappingURL=autoCommit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"autoCommit.d.ts","sourceRoot":"","sources":["../../src/contracts/autoCommit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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