@thesingularitynetwork/darkswap-sdk 0.1.5 → 0.1.6
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.esm.js +10 -10
- package/dist/index.js +10 -10
- package/dist/index.umd.js +10 -10
- package/dist/types/src/config/contractConfig.d.ts +1 -1
- package/dist/types/src/services/pro/createOrder.d.ts +1 -1
- package/package.json +1 -1
- package/src/abis/DarkSwapAssetManager.json +1 -1
- package/src/config/contractConfig.ts +6 -6
- package/src/services/base/deposit.ts +2 -1
- package/src/services/pro/createOrder.ts +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -1846,7 +1846,7 @@ var abi$a = [
|
|
|
1846
1846
|
name: "retailDepositCreateOrder",
|
|
1847
1847
|
outputs: [
|
|
1848
1848
|
],
|
|
1849
|
-
stateMutability: "
|
|
1849
|
+
stateMutability: "payable",
|
|
1850
1850
|
type: "function"
|
|
1851
1851
|
},
|
|
1852
1852
|
{
|
|
@@ -2943,7 +2943,7 @@ class DepositService extends BaseContractService {
|
|
|
2943
2943
|
const contract = new ethers.Contract(this._darkSwap.contracts.darkSwapAssetManager, DarkSwapAssetManagerAbi.abi, signer);
|
|
2944
2944
|
if (!isNativeAsset(context.newBalance.asset)) {
|
|
2945
2945
|
await this.allowance(context);
|
|
2946
|
-
const tx = await contract.deposit(context.merkleRoot, context.newBalance.asset, hexlify32(context.depositAmount), context.proof.oldBalanceNullifier, hexlify32(context.newBalance.note), context.proof.newBalanceFooter, context.proof.proof);
|
|
2946
|
+
const tx = await contract.deposit(context.merkleRoot, context.newBalance.asset, hexlify32(context.depositAmount), context.proof.oldBalanceNullifier, hexlify32(context.newBalance.note), context.proof.newBalanceFooter, context.proof.proof, { value: 0n });
|
|
2947
2947
|
await tx.wait();
|
|
2948
2948
|
return tx.hash;
|
|
2949
2949
|
}
|
|
@@ -4384,10 +4384,10 @@ class ProCreateOrderService extends BaseContractService {
|
|
|
4384
4384
|
constructor(_darkSwap) {
|
|
4385
4385
|
super(_darkSwap);
|
|
4386
4386
|
}
|
|
4387
|
-
async prepare(address,
|
|
4387
|
+
async prepare(address, orderAsset, orderAmount, swapInAsset, swapInAmount, balanceNote, signature) {
|
|
4388
4388
|
const [pubKey, privKey] = await generateKeyPair(signature);
|
|
4389
|
-
const orderNote = createOrderNoteExt(address,
|
|
4390
|
-
const newBalance = createNote(address,
|
|
4389
|
+
const orderNote = createOrderNoteExt(address, orderAsset, orderAmount, FEE_RATIO, pubKey);
|
|
4390
|
+
const newBalance = createNote(address, orderAsset, balanceNote.amount - orderAmount, pubKey);
|
|
4391
4391
|
const swapInNote = createNote(address, swapInAsset, swapInAmount, pubKey);
|
|
4392
4392
|
const context = new ProCreateOrderContext(signature);
|
|
4393
4393
|
context.orderNote = orderNote;
|
|
@@ -6115,7 +6115,7 @@ const contractConfig = {
|
|
|
6115
6115
|
merkleTreeOperator: '0x0', //FIXME
|
|
6116
6116
|
darkSwapAssetManager: '0x0', //FIXME
|
|
6117
6117
|
darkSwapFeeAssetManager: '0x0', //FIXME
|
|
6118
|
-
|
|
6118
|
+
drakSwapSubgraphUrl: 'https://subgraph.satsuma-prod.com/1c6a44a9ed6e/pgs-team--611591/singularity-subgraph/version/v0.0.1/api',
|
|
6119
6119
|
},
|
|
6120
6120
|
[ChainId.ARBITRUM_ONE]: {
|
|
6121
6121
|
priceOracle: '0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8',
|
|
@@ -6124,7 +6124,7 @@ const contractConfig = {
|
|
|
6124
6124
|
merkleTreeOperator: '0x0', //FIXME
|
|
6125
6125
|
darkSwapAssetManager: '0x0', //FIXME
|
|
6126
6126
|
darkSwapFeeAssetManager: '0x0', //FIXME
|
|
6127
|
-
|
|
6127
|
+
drakSwapSubgraphUrl: 'https://subgraph.satsuma-prod.com/1c6a44a9ed6e/pgs-team--611591/singularity-arb-subgraph/api'
|
|
6128
6128
|
},
|
|
6129
6129
|
[ChainId.BASE]: {
|
|
6130
6130
|
priceOracle: '0xf224a25453D76A41c4427DD1C05369BC9f498444',
|
|
@@ -6133,7 +6133,7 @@ const contractConfig = {
|
|
|
6133
6133
|
merkleTreeOperator: '0x0', //FIXME
|
|
6134
6134
|
darkSwapAssetManager: '0x0', //FIXME
|
|
6135
6135
|
darkSwapFeeAssetManager: '0x0', //FIXME
|
|
6136
|
-
|
|
6136
|
+
drakSwapSubgraphUrl: 'https://subgraph.satsuma-prod.com/1c6a44a9ed6e/pgs-team--611591/singularity-base-subgraph/api'
|
|
6137
6137
|
},
|
|
6138
6138
|
[ChainId.SEPOLIA]: {
|
|
6139
6139
|
priceOracle: '0x4Fe44a9aC8Ef059Be2dB97f9e3bcA32Ab698C2f2',
|
|
@@ -6142,7 +6142,7 @@ const contractConfig = {
|
|
|
6142
6142
|
merkleTreeOperator: '0x0', //FIXME
|
|
6143
6143
|
darkSwapAssetManager: '0x0', //FIXME
|
|
6144
6144
|
darkSwapFeeAssetManager: '0x0', //FIXME
|
|
6145
|
-
|
|
6145
|
+
drakSwapSubgraphUrl: ''
|
|
6146
6146
|
},
|
|
6147
6147
|
[ChainId.HARDHAT]: {
|
|
6148
6148
|
priceOracle: '0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8',
|
|
@@ -6151,7 +6151,7 @@ const contractConfig = {
|
|
|
6151
6151
|
merkleTreeOperator: '0xEd8D7d3A98CB4ea6C91a80dcd2220719c264531f',
|
|
6152
6152
|
darkSwapAssetManager: '0xeF66010868Ff77119171628B7eFa0F6179779375',
|
|
6153
6153
|
darkSwapFeeAssetManager: '0xe3EF345391654121f385679613Cea79A692C2Dd8',
|
|
6154
|
-
|
|
6154
|
+
drakSwapSubgraphUrl: 'https://34.142.142.240:8080/subgraphs/name/singularity/',
|
|
6155
6155
|
}
|
|
6156
6156
|
};
|
|
6157
6157
|
|
package/dist/index.js
CHANGED
|
@@ -1846,7 +1846,7 @@ var abi$a = [
|
|
|
1846
1846
|
name: "retailDepositCreateOrder",
|
|
1847
1847
|
outputs: [
|
|
1848
1848
|
],
|
|
1849
|
-
stateMutability: "
|
|
1849
|
+
stateMutability: "payable",
|
|
1850
1850
|
type: "function"
|
|
1851
1851
|
},
|
|
1852
1852
|
{
|
|
@@ -2943,7 +2943,7 @@ class DepositService extends BaseContractService {
|
|
|
2943
2943
|
const contract = new ethers.Contract(this._darkSwap.contracts.darkSwapAssetManager, DarkSwapAssetManagerAbi.abi, signer);
|
|
2944
2944
|
if (!isNativeAsset(context.newBalance.asset)) {
|
|
2945
2945
|
await this.allowance(context);
|
|
2946
|
-
const tx = await contract.deposit(context.merkleRoot, context.newBalance.asset, hexlify32(context.depositAmount), context.proof.oldBalanceNullifier, hexlify32(context.newBalance.note), context.proof.newBalanceFooter, context.proof.proof);
|
|
2946
|
+
const tx = await contract.deposit(context.merkleRoot, context.newBalance.asset, hexlify32(context.depositAmount), context.proof.oldBalanceNullifier, hexlify32(context.newBalance.note), context.proof.newBalanceFooter, context.proof.proof, { value: 0n });
|
|
2947
2947
|
await tx.wait();
|
|
2948
2948
|
return tx.hash;
|
|
2949
2949
|
}
|
|
@@ -4384,10 +4384,10 @@ class ProCreateOrderService extends BaseContractService {
|
|
|
4384
4384
|
constructor(_darkSwap) {
|
|
4385
4385
|
super(_darkSwap);
|
|
4386
4386
|
}
|
|
4387
|
-
async prepare(address,
|
|
4387
|
+
async prepare(address, orderAsset, orderAmount, swapInAsset, swapInAmount, balanceNote, signature) {
|
|
4388
4388
|
const [pubKey, privKey] = await generateKeyPair(signature);
|
|
4389
|
-
const orderNote = createOrderNoteExt(address,
|
|
4390
|
-
const newBalance = createNote(address,
|
|
4389
|
+
const orderNote = createOrderNoteExt(address, orderAsset, orderAmount, FEE_RATIO, pubKey);
|
|
4390
|
+
const newBalance = createNote(address, orderAsset, balanceNote.amount - orderAmount, pubKey);
|
|
4391
4391
|
const swapInNote = createNote(address, swapInAsset, swapInAmount, pubKey);
|
|
4392
4392
|
const context = new ProCreateOrderContext(signature);
|
|
4393
4393
|
context.orderNote = orderNote;
|
|
@@ -6115,7 +6115,7 @@ const contractConfig = {
|
|
|
6115
6115
|
merkleTreeOperator: '0x0', //FIXME
|
|
6116
6116
|
darkSwapAssetManager: '0x0', //FIXME
|
|
6117
6117
|
darkSwapFeeAssetManager: '0x0', //FIXME
|
|
6118
|
-
|
|
6118
|
+
drakSwapSubgraphUrl: 'https://subgraph.satsuma-prod.com/1c6a44a9ed6e/pgs-team--611591/singularity-subgraph/version/v0.0.1/api',
|
|
6119
6119
|
},
|
|
6120
6120
|
[ChainId.ARBITRUM_ONE]: {
|
|
6121
6121
|
priceOracle: '0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8',
|
|
@@ -6124,7 +6124,7 @@ const contractConfig = {
|
|
|
6124
6124
|
merkleTreeOperator: '0x0', //FIXME
|
|
6125
6125
|
darkSwapAssetManager: '0x0', //FIXME
|
|
6126
6126
|
darkSwapFeeAssetManager: '0x0', //FIXME
|
|
6127
|
-
|
|
6127
|
+
drakSwapSubgraphUrl: 'https://subgraph.satsuma-prod.com/1c6a44a9ed6e/pgs-team--611591/singularity-arb-subgraph/api'
|
|
6128
6128
|
},
|
|
6129
6129
|
[ChainId.BASE]: {
|
|
6130
6130
|
priceOracle: '0xf224a25453D76A41c4427DD1C05369BC9f498444',
|
|
@@ -6133,7 +6133,7 @@ const contractConfig = {
|
|
|
6133
6133
|
merkleTreeOperator: '0x0', //FIXME
|
|
6134
6134
|
darkSwapAssetManager: '0x0', //FIXME
|
|
6135
6135
|
darkSwapFeeAssetManager: '0x0', //FIXME
|
|
6136
|
-
|
|
6136
|
+
drakSwapSubgraphUrl: 'https://subgraph.satsuma-prod.com/1c6a44a9ed6e/pgs-team--611591/singularity-base-subgraph/api'
|
|
6137
6137
|
},
|
|
6138
6138
|
[ChainId.SEPOLIA]: {
|
|
6139
6139
|
priceOracle: '0x4Fe44a9aC8Ef059Be2dB97f9e3bcA32Ab698C2f2',
|
|
@@ -6142,7 +6142,7 @@ const contractConfig = {
|
|
|
6142
6142
|
merkleTreeOperator: '0x0', //FIXME
|
|
6143
6143
|
darkSwapAssetManager: '0x0', //FIXME
|
|
6144
6144
|
darkSwapFeeAssetManager: '0x0', //FIXME
|
|
6145
|
-
|
|
6145
|
+
drakSwapSubgraphUrl: ''
|
|
6146
6146
|
},
|
|
6147
6147
|
[ChainId.HARDHAT]: {
|
|
6148
6148
|
priceOracle: '0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8',
|
|
@@ -6151,7 +6151,7 @@ const contractConfig = {
|
|
|
6151
6151
|
merkleTreeOperator: '0xEd8D7d3A98CB4ea6C91a80dcd2220719c264531f',
|
|
6152
6152
|
darkSwapAssetManager: '0xeF66010868Ff77119171628B7eFa0F6179779375',
|
|
6153
6153
|
darkSwapFeeAssetManager: '0xe3EF345391654121f385679613Cea79A692C2Dd8',
|
|
6154
|
-
|
|
6154
|
+
drakSwapSubgraphUrl: 'https://34.142.142.240:8080/subgraphs/name/singularity/',
|
|
6155
6155
|
}
|
|
6156
6156
|
};
|
|
6157
6157
|
|
package/dist/index.umd.js
CHANGED
|
@@ -1846,7 +1846,7 @@
|
|
|
1846
1846
|
name: "retailDepositCreateOrder",
|
|
1847
1847
|
outputs: [
|
|
1848
1848
|
],
|
|
1849
|
-
stateMutability: "
|
|
1849
|
+
stateMutability: "payable",
|
|
1850
1850
|
type: "function"
|
|
1851
1851
|
},
|
|
1852
1852
|
{
|
|
@@ -2943,7 +2943,7 @@
|
|
|
2943
2943
|
const contract = new ethers.ethers.Contract(this._darkSwap.contracts.darkSwapAssetManager, DarkSwapAssetManagerAbi.abi, signer);
|
|
2944
2944
|
if (!isNativeAsset(context.newBalance.asset)) {
|
|
2945
2945
|
await this.allowance(context);
|
|
2946
|
-
const tx = await contract.deposit(context.merkleRoot, context.newBalance.asset, hexlify32(context.depositAmount), context.proof.oldBalanceNullifier, hexlify32(context.newBalance.note), context.proof.newBalanceFooter, context.proof.proof);
|
|
2946
|
+
const tx = await contract.deposit(context.merkleRoot, context.newBalance.asset, hexlify32(context.depositAmount), context.proof.oldBalanceNullifier, hexlify32(context.newBalance.note), context.proof.newBalanceFooter, context.proof.proof, { value: 0n });
|
|
2947
2947
|
await tx.wait();
|
|
2948
2948
|
return tx.hash;
|
|
2949
2949
|
}
|
|
@@ -4384,10 +4384,10 @@
|
|
|
4384
4384
|
constructor(_darkSwap) {
|
|
4385
4385
|
super(_darkSwap);
|
|
4386
4386
|
}
|
|
4387
|
-
async prepare(address,
|
|
4387
|
+
async prepare(address, orderAsset, orderAmount, swapInAsset, swapInAmount, balanceNote, signature) {
|
|
4388
4388
|
const [pubKey, privKey] = await generateKeyPair(signature);
|
|
4389
|
-
const orderNote = createOrderNoteExt(address,
|
|
4390
|
-
const newBalance = createNote(address,
|
|
4389
|
+
const orderNote = createOrderNoteExt(address, orderAsset, orderAmount, FEE_RATIO, pubKey);
|
|
4390
|
+
const newBalance = createNote(address, orderAsset, balanceNote.amount - orderAmount, pubKey);
|
|
4391
4391
|
const swapInNote = createNote(address, swapInAsset, swapInAmount, pubKey);
|
|
4392
4392
|
const context = new ProCreateOrderContext(signature);
|
|
4393
4393
|
context.orderNote = orderNote;
|
|
@@ -6115,7 +6115,7 @@
|
|
|
6115
6115
|
merkleTreeOperator: '0x0', //FIXME
|
|
6116
6116
|
darkSwapAssetManager: '0x0', //FIXME
|
|
6117
6117
|
darkSwapFeeAssetManager: '0x0', //FIXME
|
|
6118
|
-
|
|
6118
|
+
drakSwapSubgraphUrl: 'https://subgraph.satsuma-prod.com/1c6a44a9ed6e/pgs-team--611591/singularity-subgraph/version/v0.0.1/api',
|
|
6119
6119
|
},
|
|
6120
6120
|
[exports.ChainId.ARBITRUM_ONE]: {
|
|
6121
6121
|
priceOracle: '0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8',
|
|
@@ -6124,7 +6124,7 @@
|
|
|
6124
6124
|
merkleTreeOperator: '0x0', //FIXME
|
|
6125
6125
|
darkSwapAssetManager: '0x0', //FIXME
|
|
6126
6126
|
darkSwapFeeAssetManager: '0x0', //FIXME
|
|
6127
|
-
|
|
6127
|
+
drakSwapSubgraphUrl: 'https://subgraph.satsuma-prod.com/1c6a44a9ed6e/pgs-team--611591/singularity-arb-subgraph/api'
|
|
6128
6128
|
},
|
|
6129
6129
|
[exports.ChainId.BASE]: {
|
|
6130
6130
|
priceOracle: '0xf224a25453D76A41c4427DD1C05369BC9f498444',
|
|
@@ -6133,7 +6133,7 @@
|
|
|
6133
6133
|
merkleTreeOperator: '0x0', //FIXME
|
|
6134
6134
|
darkSwapAssetManager: '0x0', //FIXME
|
|
6135
6135
|
darkSwapFeeAssetManager: '0x0', //FIXME
|
|
6136
|
-
|
|
6136
|
+
drakSwapSubgraphUrl: 'https://subgraph.satsuma-prod.com/1c6a44a9ed6e/pgs-team--611591/singularity-base-subgraph/api'
|
|
6137
6137
|
},
|
|
6138
6138
|
[exports.ChainId.SEPOLIA]: {
|
|
6139
6139
|
priceOracle: '0x4Fe44a9aC8Ef059Be2dB97f9e3bcA32Ab698C2f2',
|
|
@@ -6142,7 +6142,7 @@
|
|
|
6142
6142
|
merkleTreeOperator: '0x0', //FIXME
|
|
6143
6143
|
darkSwapAssetManager: '0x0', //FIXME
|
|
6144
6144
|
darkSwapFeeAssetManager: '0x0', //FIXME
|
|
6145
|
-
|
|
6145
|
+
drakSwapSubgraphUrl: ''
|
|
6146
6146
|
},
|
|
6147
6147
|
[exports.ChainId.HARDHAT]: {
|
|
6148
6148
|
priceOracle: '0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8',
|
|
@@ -6151,7 +6151,7 @@
|
|
|
6151
6151
|
merkleTreeOperator: '0xEd8D7d3A98CB4ea6C91a80dcd2220719c264531f',
|
|
6152
6152
|
darkSwapAssetManager: '0xeF66010868Ff77119171628B7eFa0F6179779375',
|
|
6153
6153
|
darkSwapFeeAssetManager: '0xe3EF345391654121f385679613Cea79A692C2Dd8',
|
|
6154
|
-
|
|
6154
|
+
drakSwapSubgraphUrl: 'https://34.142.142.240:8080/subgraphs/name/singularity/',
|
|
6155
6155
|
}
|
|
6156
6156
|
};
|
|
6157
6157
|
|
|
@@ -5,7 +5,7 @@ export type ContractConfiguartion = {
|
|
|
5
5
|
merkleTreeOperator: string;
|
|
6
6
|
darkSwapAssetManager: string;
|
|
7
7
|
darkSwapFeeAssetManager: string;
|
|
8
|
-
|
|
8
|
+
drakSwapSubgraphUrl: string;
|
|
9
9
|
};
|
|
10
10
|
export declare const contractConfig: {
|
|
11
11
|
[chainId: number]: ContractConfiguartion;
|
|
@@ -28,7 +28,7 @@ declare class ProCreateOrderContext extends BaseContext {
|
|
|
28
28
|
}
|
|
29
29
|
export declare class ProCreateOrderService extends BaseContractService {
|
|
30
30
|
constructor(_darkSwap: DarkSwap);
|
|
31
|
-
prepare(address: string,
|
|
31
|
+
prepare(address: string, orderAsset: string, orderAmount: bigint, swapInAsset: string, swapInAmount: bigint, balanceNote: DarkSwapNote, signature: string): Promise<{
|
|
32
32
|
context: ProCreateOrderContext;
|
|
33
33
|
orderNote: DarkSwapOrderNote;
|
|
34
34
|
swapInNote: DarkSwapNote;
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ export type ContractConfiguartion = {
|
|
|
7
7
|
merkleTreeOperator: string;
|
|
8
8
|
darkSwapAssetManager: string;
|
|
9
9
|
darkSwapFeeAssetManager: string;
|
|
10
|
-
|
|
10
|
+
drakSwapSubgraphUrl: string;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const contractConfig: { [chainId: number]: ContractConfiguartion } = {
|
|
@@ -18,7 +18,7 @@ export const contractConfig: { [chainId: number]: ContractConfiguartion } = {
|
|
|
18
18
|
merkleTreeOperator: '0x0', //FIXME
|
|
19
19
|
darkSwapAssetManager: '0x0', //FIXME
|
|
20
20
|
darkSwapFeeAssetManager: '0x0', //FIXME
|
|
21
|
-
|
|
21
|
+
drakSwapSubgraphUrl:
|
|
22
22
|
'https://subgraph.satsuma-prod.com/1c6a44a9ed6e/pgs-team--611591/singularity-subgraph/version/v0.0.1/api',
|
|
23
23
|
},
|
|
24
24
|
[ChainId.ARBITRUM_ONE]: {
|
|
@@ -28,7 +28,7 @@ export const contractConfig: { [chainId: number]: ContractConfiguartion } = {
|
|
|
28
28
|
merkleTreeOperator: '0x0', //FIXME
|
|
29
29
|
darkSwapAssetManager: '0x0', //FIXME
|
|
30
30
|
darkSwapFeeAssetManager: '0x0', //FIXME
|
|
31
|
-
|
|
31
|
+
drakSwapSubgraphUrl: 'https://subgraph.satsuma-prod.com/1c6a44a9ed6e/pgs-team--611591/singularity-arb-subgraph/api'
|
|
32
32
|
},
|
|
33
33
|
[ChainId.BASE]: {
|
|
34
34
|
priceOracle: '0xf224a25453D76A41c4427DD1C05369BC9f498444',
|
|
@@ -37,7 +37,7 @@ export const contractConfig: { [chainId: number]: ContractConfiguartion } = {
|
|
|
37
37
|
merkleTreeOperator: '0x0', //FIXME
|
|
38
38
|
darkSwapAssetManager: '0x0', //FIXME
|
|
39
39
|
darkSwapFeeAssetManager: '0x0', //FIXME
|
|
40
|
-
|
|
40
|
+
drakSwapSubgraphUrl: 'https://subgraph.satsuma-prod.com/1c6a44a9ed6e/pgs-team--611591/singularity-base-subgraph/api'
|
|
41
41
|
},
|
|
42
42
|
[ChainId.SEPOLIA]: {
|
|
43
43
|
priceOracle: '0x4Fe44a9aC8Ef059Be2dB97f9e3bcA32Ab698C2f2',
|
|
@@ -46,7 +46,7 @@ export const contractConfig: { [chainId: number]: ContractConfiguartion } = {
|
|
|
46
46
|
merkleTreeOperator: '0x0', //FIXME
|
|
47
47
|
darkSwapAssetManager: '0x0', //FIXME
|
|
48
48
|
darkSwapFeeAssetManager: '0x0', //FIXME
|
|
49
|
-
|
|
49
|
+
drakSwapSubgraphUrl: ''
|
|
50
50
|
},
|
|
51
51
|
[ChainId.HARDHAT]: {
|
|
52
52
|
priceOracle: '0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8',
|
|
@@ -55,7 +55,7 @@ export const contractConfig: { [chainId: number]: ContractConfiguartion } = {
|
|
|
55
55
|
merkleTreeOperator: '0xEd8D7d3A98CB4ea6C91a80dcd2220719c264531f',
|
|
56
56
|
darkSwapAssetManager: '0xeF66010868Ff77119171628B7eFa0F6179779375',
|
|
57
57
|
darkSwapFeeAssetManager: '0xe3EF345391654121f385679613Cea79A692C2Dd8',
|
|
58
|
-
|
|
58
|
+
drakSwapSubgraphUrl: 'https://34.142.142.240:8080/subgraphs/name/singularity/',
|
|
59
59
|
|
|
60
60
|
}
|
|
61
61
|
};
|
|
@@ -131,7 +131,8 @@ export class DepositService extends BaseContractService {
|
|
|
131
131
|
context.proof.oldBalanceNullifier,
|
|
132
132
|
hexlify32(context.newBalance.note),
|
|
133
133
|
context.proof.newBalanceFooter,
|
|
134
|
-
context.proof.proof
|
|
134
|
+
context.proof.proof,
|
|
135
|
+
{ value: 0n }
|
|
135
136
|
);
|
|
136
137
|
await tx.wait();
|
|
137
138
|
return tx.hash;
|
|
@@ -87,16 +87,16 @@ export class ProCreateOrderService extends BaseContractService {
|
|
|
87
87
|
|
|
88
88
|
public async prepare(
|
|
89
89
|
address: string,
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
orderAsset: string,
|
|
91
|
+
orderAmount: bigint,
|
|
92
92
|
swapInAsset: string,
|
|
93
93
|
swapInAmount: bigint,
|
|
94
94
|
balanceNote: DarkSwapNote,
|
|
95
95
|
signature: string
|
|
96
96
|
): Promise<{ context: ProCreateOrderContext; orderNote: DarkSwapOrderNote, swapInNote: DarkSwapNote, newBalance: DarkSwapNote }> {
|
|
97
97
|
const [pubKey, privKey] = await generateKeyPair(signature);
|
|
98
|
-
const orderNote = createOrderNoteExt(address,
|
|
99
|
-
const newBalance = createNote(address,
|
|
98
|
+
const orderNote = createOrderNoteExt(address, orderAsset, orderAmount, FEE_RATIO, pubKey);
|
|
99
|
+
const newBalance = createNote(address, orderAsset, balanceNote.amount - orderAmount, pubKey);
|
|
100
100
|
const swapInNote = createNote(address, swapInAsset, swapInAmount, pubKey);
|
|
101
101
|
const context = new ProCreateOrderContext(signature);
|
|
102
102
|
context.orderNote = orderNote;
|