@thesingularitynetwork/darkswap-sdk 0.2.1 → 0.2.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/dist/index.d.ts CHANGED
@@ -7,4 +7,3 @@ export * from './proof/noteService';
7
7
  export * from './config';
8
8
  export * from './types';
9
9
  export * from './utils/swapUtils';
10
- export * from './proof/synara/bridgeOrderProof';
@@ -1,8 +1,13 @@
1
1
  import { DarkSwap } from '../../darkSwap';
2
2
  import { RetailCreateOrderProofResult } from '../../proof/retail/depositOrderProof';
3
- import { RetailBridgeOrderProofResult } from '../../proof/synara/bridgeOrderProof';
4
3
  import { DarkSwapMessage, DarkSwapNote, DarkSwapOrderNote } from '../../types';
5
4
  import { BaseContext } from '../BaseService';
5
+ export interface AttestationDetails {
6
+ attestationId: bigint;
7
+ merklePath: string[];
8
+ leafCount: bigint;
9
+ index: bigint;
10
+ }
6
11
  declare class BridgeCreateOrderContext extends BaseContext {
7
12
  private _orderNote?;
8
13
  private _swapInNote?;
@@ -15,6 +20,12 @@ declare class BridgeCreateOrderContext extends BaseContext {
15
20
  private _sourceAmount?;
16
21
  private _bridgeFeeAmount?;
17
22
  private _depositId?;
23
+ private _attestationDetails?;
24
+ private _relayer?;
25
+ private _jobId?;
26
+ private _canonicalId?;
27
+ private _callDataHash?;
28
+ private _nonce?;
18
29
  constructor(signature: string);
19
30
  set orderNote(orderNote: DarkSwapOrderNote | undefined);
20
31
  get orderNote(): DarkSwapOrderNote | undefined;
@@ -38,15 +49,37 @@ declare class BridgeCreateOrderContext extends BaseContext {
38
49
  get bridgeFeeAmount(): bigint | undefined;
39
50
  set depositId(depositId: string | undefined);
40
51
  get depositId(): string | undefined;
52
+ set attestationDetails(attestationDetails: AttestationDetails | undefined);
53
+ get attestationDetails(): AttestationDetails | undefined;
54
+ set relayer(relayer: string | undefined);
55
+ get relayer(): string | undefined;
56
+ set jobId(jobId: string | undefined);
57
+ get jobId(): string | undefined;
58
+ set canonicalId(canonicalId: string | undefined);
59
+ get canonicalId(): string | undefined;
60
+ set callDataHash(callDataHash: string | undefined);
61
+ get callDataHash(): string | undefined;
62
+ set nonce(nonce: bigint | undefined);
63
+ get nonce(): bigint | undefined;
41
64
  }
65
+ export declare type SubmitProofRelayerRequest = {
66
+ proof: string;
67
+ publicSignals: string[];
68
+ vkHash: string;
69
+ };
42
70
  export declare class BridgeCreateOrderService {
43
71
  protected _darkSwapOfSourceChain: DarkSwap;
44
72
  protected _darkSwapOfDestChain: DarkSwap;
45
73
  constructor(_darkSwapOfSourceChain: DarkSwap, _darkSwapOfDestChain: DarkSwap);
46
- prepare(address: string, sourceChainId: number, sourceAsset: string, sourceAmount: bigint, depositId: string, bridgeFee: bigint, destChainId: number, depositAsset: string, depositAmount: bigint, swapInAsset: string, swapInAmount: bigint, signature: string): Promise<{
74
+ prepare(address: string, sourceChainId: number, sourceAsset: string, sourceAmount: bigint, canonicalId: string, bridgeFee: bigint, destChainId: number, depositAsset: string, depositAmount: bigint, swapInAsset: string, swapInAmount: bigint, signature: string): Promise<{
47
75
  context: BridgeCreateOrderContext;
48
76
  swapMessage: DarkSwapMessage;
49
77
  }>;
50
- generateProof(context: BridgeCreateOrderContext): Promise<RetailBridgeOrderProofResult>;
78
+ private computeDepositId;
79
+ protected allowance(context: BridgeCreateOrderContext): Promise<void>;
80
+ execute(context: BridgeCreateOrderContext): Promise<{
81
+ depositId: string;
82
+ txHash: string;
83
+ }>;
51
84
  }
52
85
  export {};
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.2.1",
7
+ "version": "0.2.2",
8
8
  "description": "DarkSwap SDK for browser and Node.js",
9
9
  "main": "dist/index.js",
10
10
  "typings": "dist/index.d.ts",
@@ -32,15 +32,16 @@
32
32
  "@noir-lang/noir_js": "1.0.0-beta.6",
33
33
  "@noir-lang/noir_wasm": "1.0.0-beta.6",
34
34
  "@noir-lang/types": "1.0.0-beta.6",
35
+ "axios": "^1.13.1",
35
36
  "tiny-invariant": "^1.1.0",
36
37
  "tiny-warning": "^1.0.3"
37
38
  },
38
39
  "devDependencies": {
39
40
  "@types/jest": "^24.0.25",
40
41
  "@types/lodash": "^4.17.4",
42
+ "ethers": "^6.14.3",
41
43
  "tsdx": "^0.14.1",
42
- "vitest": "^3.1.4",
43
- "ethers": "^6.14.3"
44
+ "vitest": "^3.1.4"
44
45
  },
45
46
  "resolutions": {
46
47
  "regenerator-runtime": "^0.14.1"
@@ -57,4 +58,4 @@
57
58
  "singleQuote": true
58
59
  },
59
60
  "packageManager": "yarn@1.22.21+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72"
60
- }
61
+ }