@optimex-xyz/market-maker-sdk 0.5.0-dev-4237adc → 0.5.0-dev-4772ae2
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/index.d.mts +22 -7
- package/dist/index.d.ts +22 -7
- package/dist/index.js +25 -0
- package/dist/index.mjs +25 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4590,10 +4590,15 @@ declare namespace index {
|
|
|
4590
4590
|
export { index_ERC20__factory as ERC20__factory, index_Payment__factory as Payment__factory, index_Router__factory as Router__factory, index_Signer__factory as Signer__factory };
|
|
4591
4591
|
}
|
|
4592
4592
|
|
|
4593
|
-
declare class RouterService {
|
|
4594
|
-
private
|
|
4595
|
-
private
|
|
4593
|
+
declare class RouterService implements ConfigObserver {
|
|
4594
|
+
private provider;
|
|
4595
|
+
private contract;
|
|
4596
4596
|
constructor();
|
|
4597
|
+
/**
|
|
4598
|
+
* Implementation of ConfigObserver interface
|
|
4599
|
+
* Updates service when config changes
|
|
4600
|
+
*/
|
|
4601
|
+
onConfigUpdate(newConfig: AppConfig): void;
|
|
4597
4602
|
getSigner(): Promise<string>;
|
|
4598
4603
|
getCurrentPubkey(network: string): Promise<ITypes.MPCInfoStructOutput>;
|
|
4599
4604
|
getCurrentStage(tradeId: BytesLike): Promise<bigint>;
|
|
@@ -4620,10 +4625,15 @@ declare class RouterService {
|
|
|
4620
4625
|
}
|
|
4621
4626
|
declare const routerService: RouterService;
|
|
4622
4627
|
|
|
4623
|
-
declare class SignerService {
|
|
4624
|
-
private
|
|
4628
|
+
declare class SignerService implements ConfigObserver {
|
|
4629
|
+
private provider;
|
|
4625
4630
|
private readonly routerService;
|
|
4626
4631
|
constructor();
|
|
4632
|
+
/**
|
|
4633
|
+
* Implementation of ConfigObserver interface
|
|
4634
|
+
* Updates service when config changes
|
|
4635
|
+
*/
|
|
4636
|
+
onConfigUpdate(newConfig: AppConfig): void;
|
|
4627
4637
|
getDomain(): Promise<{
|
|
4628
4638
|
name: string;
|
|
4629
4639
|
version: string;
|
|
@@ -4664,9 +4674,14 @@ declare const SubmitSettlementResponseSchema: z.ZodObject<{
|
|
|
4664
4674
|
}>;
|
|
4665
4675
|
type SubmitSettlementRequest = z.infer<typeof SubmitSettlementRequestSchema>;
|
|
4666
4676
|
type SubmitSettlementResponse = z.infer<typeof SubmitSettlementResponseSchema>;
|
|
4667
|
-
declare class SolverService {
|
|
4668
|
-
private
|
|
4677
|
+
declare class SolverService implements ConfigObserver {
|
|
4678
|
+
private baseURL;
|
|
4669
4679
|
constructor();
|
|
4680
|
+
/**
|
|
4681
|
+
* Implementation of ConfigObserver interface
|
|
4682
|
+
* Updates service when config changes
|
|
4683
|
+
*/
|
|
4684
|
+
onConfigUpdate(newConfig: AppConfig): void;
|
|
4670
4685
|
/**
|
|
4671
4686
|
* Submits a settlement transaction to the solver backend
|
|
4672
4687
|
* @param params Settlement transaction parameters
|
package/dist/index.d.ts
CHANGED
|
@@ -4590,10 +4590,15 @@ declare namespace index {
|
|
|
4590
4590
|
export { index_ERC20__factory as ERC20__factory, index_Payment__factory as Payment__factory, index_Router__factory as Router__factory, index_Signer__factory as Signer__factory };
|
|
4591
4591
|
}
|
|
4592
4592
|
|
|
4593
|
-
declare class RouterService {
|
|
4594
|
-
private
|
|
4595
|
-
private
|
|
4593
|
+
declare class RouterService implements ConfigObserver {
|
|
4594
|
+
private provider;
|
|
4595
|
+
private contract;
|
|
4596
4596
|
constructor();
|
|
4597
|
+
/**
|
|
4598
|
+
* Implementation of ConfigObserver interface
|
|
4599
|
+
* Updates service when config changes
|
|
4600
|
+
*/
|
|
4601
|
+
onConfigUpdate(newConfig: AppConfig): void;
|
|
4597
4602
|
getSigner(): Promise<string>;
|
|
4598
4603
|
getCurrentPubkey(network: string): Promise<ITypes.MPCInfoStructOutput>;
|
|
4599
4604
|
getCurrentStage(tradeId: BytesLike): Promise<bigint>;
|
|
@@ -4620,10 +4625,15 @@ declare class RouterService {
|
|
|
4620
4625
|
}
|
|
4621
4626
|
declare const routerService: RouterService;
|
|
4622
4627
|
|
|
4623
|
-
declare class SignerService {
|
|
4624
|
-
private
|
|
4628
|
+
declare class SignerService implements ConfigObserver {
|
|
4629
|
+
private provider;
|
|
4625
4630
|
private readonly routerService;
|
|
4626
4631
|
constructor();
|
|
4632
|
+
/**
|
|
4633
|
+
* Implementation of ConfigObserver interface
|
|
4634
|
+
* Updates service when config changes
|
|
4635
|
+
*/
|
|
4636
|
+
onConfigUpdate(newConfig: AppConfig): void;
|
|
4627
4637
|
getDomain(): Promise<{
|
|
4628
4638
|
name: string;
|
|
4629
4639
|
version: string;
|
|
@@ -4664,9 +4674,14 @@ declare const SubmitSettlementResponseSchema: z.ZodObject<{
|
|
|
4664
4674
|
}>;
|
|
4665
4675
|
type SubmitSettlementRequest = z.infer<typeof SubmitSettlementRequestSchema>;
|
|
4666
4676
|
type SubmitSettlementResponse = z.infer<typeof SubmitSettlementResponseSchema>;
|
|
4667
|
-
declare class SolverService {
|
|
4668
|
-
private
|
|
4677
|
+
declare class SolverService implements ConfigObserver {
|
|
4678
|
+
private baseURL;
|
|
4669
4679
|
constructor();
|
|
4680
|
+
/**
|
|
4681
|
+
* Implementation of ConfigObserver interface
|
|
4682
|
+
* Updates service when config changes
|
|
4683
|
+
*/
|
|
4684
|
+
onConfigUpdate(newConfig: AppConfig): void;
|
|
4670
4685
|
/**
|
|
4671
4686
|
* Submits a settlement transaction to the solver backend
|
|
4672
4687
|
* @param params Settlement transaction parameters
|
package/dist/index.js
CHANGED
|
@@ -3502,6 +3502,15 @@ var RouterService = class {
|
|
|
3502
3502
|
constructor() {
|
|
3503
3503
|
this.provider = new import_ethers5.JsonRpcProvider(config.getRpcUrl());
|
|
3504
3504
|
this.contract = Router__factory.connect(config.getRouterAddress(), this.provider);
|
|
3505
|
+
config.registerObserver(this);
|
|
3506
|
+
}
|
|
3507
|
+
/**
|
|
3508
|
+
* Implementation of ConfigObserver interface
|
|
3509
|
+
* Updates service when config changes
|
|
3510
|
+
*/
|
|
3511
|
+
onConfigUpdate(newConfig) {
|
|
3512
|
+
this.provider = new import_ethers5.JsonRpcProvider(newConfig.rpcUrl);
|
|
3513
|
+
this.contract = Router__factory.connect(newConfig.routerAddress, this.provider);
|
|
3505
3514
|
}
|
|
3506
3515
|
async getSigner() {
|
|
3507
3516
|
return await this.contract.SIGNER();
|
|
@@ -3581,6 +3590,14 @@ var SignerService = class {
|
|
|
3581
3590
|
constructor() {
|
|
3582
3591
|
this.routerService = routerService;
|
|
3583
3592
|
this.provider = new import_ethers6.JsonRpcProvider(config.getRpcUrl());
|
|
3593
|
+
config.registerObserver(this);
|
|
3594
|
+
}
|
|
3595
|
+
/**
|
|
3596
|
+
* Implementation of ConfigObserver interface
|
|
3597
|
+
* Updates service when config changes
|
|
3598
|
+
*/
|
|
3599
|
+
onConfigUpdate(newConfig) {
|
|
3600
|
+
this.provider = new import_ethers6.JsonRpcProvider(newConfig.rpcUrl);
|
|
3584
3601
|
}
|
|
3585
3602
|
async getDomain() {
|
|
3586
3603
|
const signerAddress = await this.routerService.getSigner();
|
|
@@ -3659,6 +3676,14 @@ var SubmitSettlementResponseSchema = import_zod.z.object({
|
|
|
3659
3676
|
var SolverService = class {
|
|
3660
3677
|
constructor() {
|
|
3661
3678
|
this.baseURL = config.getBackendUrl();
|
|
3679
|
+
config.registerObserver(this);
|
|
3680
|
+
}
|
|
3681
|
+
/**
|
|
3682
|
+
* Implementation of ConfigObserver interface
|
|
3683
|
+
* Updates service when config changes
|
|
3684
|
+
*/
|
|
3685
|
+
onConfigUpdate(newConfig) {
|
|
3686
|
+
this.baseURL = newConfig.backendUrl;
|
|
3662
3687
|
}
|
|
3663
3688
|
/**
|
|
3664
3689
|
* Submits a settlement transaction to the solver backend
|
package/dist/index.mjs
CHANGED
|
@@ -3437,6 +3437,15 @@ var RouterService = class {
|
|
|
3437
3437
|
constructor() {
|
|
3438
3438
|
this.provider = new JsonRpcProvider(config.getRpcUrl());
|
|
3439
3439
|
this.contract = Router__factory.connect(config.getRouterAddress(), this.provider);
|
|
3440
|
+
config.registerObserver(this);
|
|
3441
|
+
}
|
|
3442
|
+
/**
|
|
3443
|
+
* Implementation of ConfigObserver interface
|
|
3444
|
+
* Updates service when config changes
|
|
3445
|
+
*/
|
|
3446
|
+
onConfigUpdate(newConfig) {
|
|
3447
|
+
this.provider = new JsonRpcProvider(newConfig.rpcUrl);
|
|
3448
|
+
this.contract = Router__factory.connect(newConfig.routerAddress, this.provider);
|
|
3440
3449
|
}
|
|
3441
3450
|
async getSigner() {
|
|
3442
3451
|
return await this.contract.SIGNER();
|
|
@@ -3516,6 +3525,14 @@ var SignerService = class {
|
|
|
3516
3525
|
constructor() {
|
|
3517
3526
|
this.routerService = routerService;
|
|
3518
3527
|
this.provider = new JsonRpcProvider2(config.getRpcUrl());
|
|
3528
|
+
config.registerObserver(this);
|
|
3529
|
+
}
|
|
3530
|
+
/**
|
|
3531
|
+
* Implementation of ConfigObserver interface
|
|
3532
|
+
* Updates service when config changes
|
|
3533
|
+
*/
|
|
3534
|
+
onConfigUpdate(newConfig) {
|
|
3535
|
+
this.provider = new JsonRpcProvider2(newConfig.rpcUrl);
|
|
3519
3536
|
}
|
|
3520
3537
|
async getDomain() {
|
|
3521
3538
|
const signerAddress = await this.routerService.getSigner();
|
|
@@ -3594,6 +3611,14 @@ var SubmitSettlementResponseSchema = z.object({
|
|
|
3594
3611
|
var SolverService = class {
|
|
3595
3612
|
constructor() {
|
|
3596
3613
|
this.baseURL = config.getBackendUrl();
|
|
3614
|
+
config.registerObserver(this);
|
|
3615
|
+
}
|
|
3616
|
+
/**
|
|
3617
|
+
* Implementation of ConfigObserver interface
|
|
3618
|
+
* Updates service when config changes
|
|
3619
|
+
*/
|
|
3620
|
+
onConfigUpdate(newConfig) {
|
|
3621
|
+
this.baseURL = newConfig.backendUrl;
|
|
3597
3622
|
}
|
|
3598
3623
|
/**
|
|
3599
3624
|
* Submits a settlement transaction to the solver backend
|