@compass-labs/api-sdk 2.1.10-rc.5 → 2.1.10-rc.7
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 +5 -5
- package/dist/commonjs/funcs/{cctpCCTPBurn.d.ts → bridgeCctpBurn.d.ts} +7 -7
- package/dist/commonjs/funcs/bridgeCctpBurn.d.ts.map +1 -0
- package/dist/commonjs/funcs/{cctpCCTPBurn.js → bridgeCctpBurn.js} +8 -8
- package/dist/commonjs/funcs/bridgeCctpBurn.js.map +1 -0
- package/dist/commonjs/funcs/{cctpCCTPMint.d.ts → bridgeCctpMint.d.ts} +13 -12
- package/dist/commonjs/funcs/bridgeCctpMint.d.ts.map +1 -0
- package/dist/commonjs/funcs/{cctpCCTPMint.js → bridgeCctpMint.js} +14 -13
- package/dist/commonjs/funcs/bridgeCctpMint.js.map +1 -0
- package/dist/{esm/sdk/cctp.d.ts → commonjs/sdk/bridge.d.ts} +18 -17
- package/dist/commonjs/sdk/bridge.d.ts.map +1 -0
- package/dist/commonjs/sdk/{cctp.js → bridge.js} +24 -23
- package/dist/commonjs/sdk/bridge.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -3
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +3 -3
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/funcs/{cctpCCTPBurn.d.ts → bridgeCctpBurn.d.ts} +7 -7
- package/dist/esm/funcs/bridgeCctpBurn.d.ts.map +1 -0
- package/dist/esm/funcs/{cctpCCTPBurn.js → bridgeCctpBurn.js} +7 -7
- package/dist/esm/funcs/bridgeCctpBurn.js.map +1 -0
- package/dist/esm/funcs/{cctpCCTPMint.d.ts → bridgeCctpMint.d.ts} +13 -12
- package/dist/esm/funcs/bridgeCctpMint.d.ts.map +1 -0
- package/dist/esm/funcs/{cctpCCTPMint.js → bridgeCctpMint.js} +13 -12
- package/dist/esm/funcs/bridgeCctpMint.js.map +1 -0
- package/dist/{commonjs/sdk/cctp.d.ts → esm/sdk/bridge.d.ts} +18 -17
- package/dist/esm/sdk/bridge.d.ts.map +1 -0
- package/dist/esm/sdk/{cctp.js → bridge.js} +22 -21
- package/dist/esm/sdk/bridge.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -3
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +3 -3
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/package.json +1 -1
- package/src/funcs/{cctpCCTPBurn.ts → bridgeCctpBurn.ts} +6 -6
- package/src/funcs/{cctpCCTPMint.ts → bridgeCctpMint.ts} +12 -11
- package/src/sdk/{cctp.ts → bridge.ts} +21 -20
- package/src/sdk/sdk.ts +4 -4
- package/dist/commonjs/funcs/cctpCCTPBurn.d.ts.map +0 -1
- package/dist/commonjs/funcs/cctpCCTPBurn.js.map +0 -1
- package/dist/commonjs/funcs/cctpCCTPMint.d.ts.map +0 -1
- package/dist/commonjs/funcs/cctpCCTPMint.js.map +0 -1
- package/dist/commonjs/sdk/cctp.d.ts.map +0 -1
- package/dist/commonjs/sdk/cctp.js.map +0 -1
- package/dist/esm/funcs/cctpCCTPBurn.d.ts.map +0 -1
- package/dist/esm/funcs/cctpCCTPBurn.js.map +0 -1
- package/dist/esm/funcs/cctpCCTPMint.d.ts.map +0 -1
- package/dist/esm/funcs/cctpCCTPMint.js.map +0 -1
- package/dist/esm/sdk/cctp.d.ts.map +0 -1
- package/dist/esm/sdk/cctp.js.map +0 -1
|
@@ -10,26 +10,25 @@ import * as operations from "../models/operations/index.js";
|
|
|
10
10
|
import { APIPromise } from "../types/async.js";
|
|
11
11
|
import { Result } from "../types/fp.js";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Confirm USDC bridging
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
|
-
*
|
|
16
|
+
* ***This endpoint is only needed to be called in rare cases when bridging was not confirmed automatically***
|
|
17
|
+
*
|
|
18
|
+
* Prepare a receiveMessage transaction to mint USDC to any Product Account on the
|
|
17
19
|
* destination chain.
|
|
18
20
|
*
|
|
19
21
|
* **How it works:**
|
|
20
22
|
*
|
|
21
23
|
* This endpoint uses the `bridge_id` from `/burn` to:
|
|
22
|
-
* 1. Look up the bridge session
|
|
23
|
-
* 2.
|
|
24
|
-
* 3.
|
|
25
|
-
* 4. Check if Circle's attestation is ready
|
|
26
|
-
* 5. Return the mint transaction wrapped in Safe execTransaction
|
|
24
|
+
* 1. Look up the bridge session
|
|
25
|
+
* 2. Check if Circle's attestation is ready
|
|
26
|
+
* 3. Return the mint transaction
|
|
27
27
|
*
|
|
28
28
|
* **Request parameters:**
|
|
29
29
|
*
|
|
30
30
|
* - `bridge_id`: The bridge ID returned from `/burn`
|
|
31
|
-
* - `
|
|
32
|
-
* - `gas_sponsorship`: If true, returns EIP-712 typed data for gas-sponsored execution
|
|
31
|
+
* - `burn_tx_hash`: The transaction hash of the burn transaction on the source chain
|
|
33
32
|
*
|
|
34
33
|
* **Response codes:**
|
|
35
34
|
*
|
|
@@ -39,6 +38,8 @@ import { Result } from "../types/fp.js";
|
|
|
39
38
|
*
|
|
40
39
|
* **After receiving 202:**
|
|
41
40
|
*
|
|
41
|
+
* The SSE stream and status endpoint are in progress. Keep an eye on the updates from our team.
|
|
42
|
+
*
|
|
42
43
|
* Either:
|
|
43
44
|
* - Connect to the SSE stream at `sse_url` and wait for `attestation_ready` event
|
|
44
45
|
* - Poll this endpoint periodically until you get 200
|
|
@@ -46,7 +47,7 @@ import { Result } from "../types/fp.js";
|
|
|
46
47
|
* **After receiving 200:**
|
|
47
48
|
*
|
|
48
49
|
* Sign and broadcast the returned transaction on the destination chain to mint USDC
|
|
49
|
-
* to your
|
|
50
|
+
* to your Product Account.
|
|
50
51
|
*/
|
|
51
|
-
export declare function
|
|
52
|
-
//# sourceMappingURL=
|
|
52
|
+
export declare function bridgeCctpMint(client: CompassApiSDKCore, request: components.MintPrepareRequest, options?: RequestOptions): APIPromise<Result<operations.V2CctpMintResponse, errors.HTTPValidationError | CompassAPISDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
53
|
+
//# sourceMappingURL=bridgeCctpMint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridgeCctpMint.d.ts","sourceRoot":"","sources":["../../../src/funcs/bridgeCctpMint.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAK/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,UAAU,CAAC,kBAAkB,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,kBAAkB,EAC3B,MAAM,CAAC,mBAAmB,GAC1B,kBAAkB,GAClB,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
|
|
@@ -12,26 +12,25 @@ import * as errors from "../models/errors/index.js";
|
|
|
12
12
|
import * as operations from "../models/operations/index.js";
|
|
13
13
|
import { APIPromise } from "../types/async.js";
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Confirm USDC bridging
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
|
-
*
|
|
18
|
+
* ***This endpoint is only needed to be called in rare cases when bridging was not confirmed automatically***
|
|
19
|
+
*
|
|
20
|
+
* Prepare a receiveMessage transaction to mint USDC to any Product Account on the
|
|
19
21
|
* destination chain.
|
|
20
22
|
*
|
|
21
23
|
* **How it works:**
|
|
22
24
|
*
|
|
23
25
|
* This endpoint uses the `bridge_id` from `/burn` to:
|
|
24
|
-
* 1. Look up the bridge session
|
|
25
|
-
* 2.
|
|
26
|
-
* 3.
|
|
27
|
-
* 4. Check if Circle's attestation is ready
|
|
28
|
-
* 5. Return the mint transaction wrapped in Safe execTransaction
|
|
26
|
+
* 1. Look up the bridge session
|
|
27
|
+
* 2. Check if Circle's attestation is ready
|
|
28
|
+
* 3. Return the mint transaction
|
|
29
29
|
*
|
|
30
30
|
* **Request parameters:**
|
|
31
31
|
*
|
|
32
32
|
* - `bridge_id`: The bridge ID returned from `/burn`
|
|
33
|
-
* - `
|
|
34
|
-
* - `gas_sponsorship`: If true, returns EIP-712 typed data for gas-sponsored execution
|
|
33
|
+
* - `burn_tx_hash`: The transaction hash of the burn transaction on the source chain
|
|
35
34
|
*
|
|
36
35
|
* **Response codes:**
|
|
37
36
|
*
|
|
@@ -41,6 +40,8 @@ import { APIPromise } from "../types/async.js";
|
|
|
41
40
|
*
|
|
42
41
|
* **After receiving 202:**
|
|
43
42
|
*
|
|
43
|
+
* The SSE stream and status endpoint are in progress. Keep an eye on the updates from our team.
|
|
44
|
+
*
|
|
44
45
|
* Either:
|
|
45
46
|
* - Connect to the SSE stream at `sse_url` and wait for `attestation_ready` event
|
|
46
47
|
* - Poll this endpoint periodically until you get 200
|
|
@@ -48,9 +49,9 @@ import { APIPromise } from "../types/async.js";
|
|
|
48
49
|
* **After receiving 200:**
|
|
49
50
|
*
|
|
50
51
|
* Sign and broadcast the returned transaction on the destination chain to mint USDC
|
|
51
|
-
* to your
|
|
52
|
+
* to your Product Account.
|
|
52
53
|
*/
|
|
53
|
-
export function
|
|
54
|
+
export function bridgeCctpMint(client, request, options) {
|
|
54
55
|
return new APIPromise($do(client, request, options));
|
|
55
56
|
}
|
|
56
57
|
async function $do(client, request, options) {
|
|
@@ -113,4 +114,4 @@ async function $do(client, request, options) {
|
|
|
113
114
|
}
|
|
114
115
|
return [result, { status: "complete", request: req, response }];
|
|
115
116
|
}
|
|
116
|
-
//# sourceMappingURL=
|
|
117
|
+
//# sourceMappingURL=bridgeCctpMint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridgeCctpMint.js","sourceRoot":"","sources":["../../../src/funcs/bridgeCctpMint.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAS5D,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AAGpD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGxD;;;;;;;;;;;;;;;;;;;;;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,CAAC,EAAE,EAAE,CAAC;QACjB,OAAO,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;IAC/D,CAAC;IACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEhC,MAAM,cAAc,GAAG;QACrB,QAAQ,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE;KAC/C,CAAC;IAEF,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,KAAK,CAY5B,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,gCAAgC,CAAC,EACxD,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,gCAAgC,CAAC,EACxD,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,iCAAiC,CAAC,EACxD,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EACb,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CACd,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC;IAClD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
2
2
|
import * as components from "../models/components/index.js";
|
|
3
3
|
import * as operations from "../models/operations/index.js";
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class Bridge extends ClientSDK {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Initiate USDC bridging
|
|
7
7
|
*
|
|
8
8
|
* @remarks
|
|
9
|
-
* Build a transaction to burn USDC from
|
|
9
|
+
* Build a transaction to burn USDC from any Product Account on the source chain
|
|
10
10
|
* and initiate a cross-chain transfer via Circle's CCTP V2 (Cross-Chain Transfer Protocol).
|
|
11
11
|
*
|
|
12
12
|
* **Transfer modes:**
|
|
@@ -23,38 +23,37 @@ export declare class Cctp extends ClientSDK {
|
|
|
23
23
|
* 4. Wait for Circle's attestation service to attest the burn
|
|
24
24
|
* 5. Call the mint endpoint to receive USDC on the destination chain
|
|
25
25
|
*
|
|
26
|
+
* Step 5 is only required as a fail safe mechanism to mint USDC on a destination chain when bridging has not been confirmed up automatically.
|
|
27
|
+
*
|
|
26
28
|
* **Supported chains:**
|
|
27
29
|
* - Ethereum (domain 0)
|
|
28
30
|
* - Arbitrum (domain 3)
|
|
29
31
|
* - Base (domain 6)
|
|
30
32
|
*
|
|
31
|
-
* **Note:** The USDC must already be deposited in the
|
|
33
|
+
* **Note:** The USDC must already be deposited in the Product Account. If approval is needed
|
|
32
34
|
* for the TokenMessengerV2 contract, it will be included in the transaction automatically.
|
|
33
|
-
*
|
|
34
|
-
* **Gas estimate:** ~200,000 gas units (includes Safe execTransaction overhead)
|
|
35
35
|
*/
|
|
36
36
|
cctpBurn(request: components.DepositForBurnRequest, options?: RequestOptions): Promise<components.DepositForBurnResponse>;
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
38
|
+
* Confirm USDC bridging
|
|
39
39
|
*
|
|
40
40
|
* @remarks
|
|
41
|
-
*
|
|
41
|
+
* ***This endpoint is only needed to be called in rare cases when bridging was not confirmed automatically***
|
|
42
|
+
*
|
|
43
|
+
* Prepare a receiveMessage transaction to mint USDC to any Product Account on the
|
|
42
44
|
* destination chain.
|
|
43
45
|
*
|
|
44
46
|
* **How it works:**
|
|
45
47
|
*
|
|
46
48
|
* This endpoint uses the `bridge_id` from `/burn` to:
|
|
47
|
-
* 1. Look up the bridge session
|
|
48
|
-
* 2.
|
|
49
|
-
* 3.
|
|
50
|
-
* 4. Check if Circle's attestation is ready
|
|
51
|
-
* 5. Return the mint transaction wrapped in Safe execTransaction
|
|
49
|
+
* 1. Look up the bridge session
|
|
50
|
+
* 2. Check if Circle's attestation is ready
|
|
51
|
+
* 3. Return the mint transaction
|
|
52
52
|
*
|
|
53
53
|
* **Request parameters:**
|
|
54
54
|
*
|
|
55
55
|
* - `bridge_id`: The bridge ID returned from `/burn`
|
|
56
|
-
* - `
|
|
57
|
-
* - `gas_sponsorship`: If true, returns EIP-712 typed data for gas-sponsored execution
|
|
56
|
+
* - `burn_tx_hash`: The transaction hash of the burn transaction on the source chain
|
|
58
57
|
*
|
|
59
58
|
* **Response codes:**
|
|
60
59
|
*
|
|
@@ -64,6 +63,8 @@ export declare class Cctp extends ClientSDK {
|
|
|
64
63
|
*
|
|
65
64
|
* **After receiving 202:**
|
|
66
65
|
*
|
|
66
|
+
* The SSE stream and status endpoint are in progress. Keep an eye on the updates from our team.
|
|
67
|
+
*
|
|
67
68
|
* Either:
|
|
68
69
|
* - Connect to the SSE stream at `sse_url` and wait for `attestation_ready` event
|
|
69
70
|
* - Poll this endpoint periodically until you get 200
|
|
@@ -71,8 +72,8 @@ export declare class Cctp extends ClientSDK {
|
|
|
71
72
|
* **After receiving 200:**
|
|
72
73
|
*
|
|
73
74
|
* Sign and broadcast the returned transaction on the destination chain to mint USDC
|
|
74
|
-
* to your
|
|
75
|
+
* to your Product Account.
|
|
75
76
|
*/
|
|
76
77
|
cctpMint(request: components.MintPrepareRequest, options?: RequestOptions): Promise<operations.V2CctpMintResponse>;
|
|
77
78
|
}
|
|
78
|
-
//# sourceMappingURL=
|
|
79
|
+
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../../src/sdk/bridge.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,MAAO,SAAQ,SAAS;IACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACG,QAAQ,CACZ,OAAO,EAAE,UAAU,CAAC,qBAAqB,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,sBAAsB,CAAC;IAQ7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACG,QAAQ,CACZ,OAAO,EAAE,UAAU,CAAC,kBAAkB,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC;CAO1C"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { bridgeCctpBurn } from "../funcs/bridgeCctpBurn.js";
|
|
5
|
+
import { bridgeCctpMint } from "../funcs/bridgeCctpMint.js";
|
|
6
6
|
import { ClientSDK } from "../lib/sdks.js";
|
|
7
7
|
import { unwrapAsync } from "../types/fp.js";
|
|
8
|
-
export class
|
|
8
|
+
export class Bridge extends ClientSDK {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Initiate USDC bridging
|
|
11
11
|
*
|
|
12
12
|
* @remarks
|
|
13
|
-
* Build a transaction to burn USDC from
|
|
13
|
+
* Build a transaction to burn USDC from any Product Account on the source chain
|
|
14
14
|
* and initiate a cross-chain transfer via Circle's CCTP V2 (Cross-Chain Transfer Protocol).
|
|
15
15
|
*
|
|
16
16
|
* **Transfer modes:**
|
|
@@ -27,40 +27,39 @@ export class Cctp extends ClientSDK {
|
|
|
27
27
|
* 4. Wait for Circle's attestation service to attest the burn
|
|
28
28
|
* 5. Call the mint endpoint to receive USDC on the destination chain
|
|
29
29
|
*
|
|
30
|
+
* Step 5 is only required as a fail safe mechanism to mint USDC on a destination chain when bridging has not been confirmed up automatically.
|
|
31
|
+
*
|
|
30
32
|
* **Supported chains:**
|
|
31
33
|
* - Ethereum (domain 0)
|
|
32
34
|
* - Arbitrum (domain 3)
|
|
33
35
|
* - Base (domain 6)
|
|
34
36
|
*
|
|
35
|
-
* **Note:** The USDC must already be deposited in the
|
|
37
|
+
* **Note:** The USDC must already be deposited in the Product Account. If approval is needed
|
|
36
38
|
* for the TokenMessengerV2 contract, it will be included in the transaction automatically.
|
|
37
|
-
*
|
|
38
|
-
* **Gas estimate:** ~200,000 gas units (includes Safe execTransaction overhead)
|
|
39
39
|
*/
|
|
40
40
|
async cctpBurn(request, options) {
|
|
41
|
-
return unwrapAsync(
|
|
41
|
+
return unwrapAsync(bridgeCctpBurn(this, request, options));
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Confirm USDC bridging
|
|
45
45
|
*
|
|
46
46
|
* @remarks
|
|
47
|
-
*
|
|
47
|
+
* ***This endpoint is only needed to be called in rare cases when bridging was not confirmed automatically***
|
|
48
|
+
*
|
|
49
|
+
* Prepare a receiveMessage transaction to mint USDC to any Product Account on the
|
|
48
50
|
* destination chain.
|
|
49
51
|
*
|
|
50
52
|
* **How it works:**
|
|
51
53
|
*
|
|
52
54
|
* This endpoint uses the `bridge_id` from `/burn` to:
|
|
53
|
-
* 1. Look up the bridge session
|
|
54
|
-
* 2.
|
|
55
|
-
* 3.
|
|
56
|
-
* 4. Check if Circle's attestation is ready
|
|
57
|
-
* 5. Return the mint transaction wrapped in Safe execTransaction
|
|
55
|
+
* 1. Look up the bridge session
|
|
56
|
+
* 2. Check if Circle's attestation is ready
|
|
57
|
+
* 3. Return the mint transaction
|
|
58
58
|
*
|
|
59
59
|
* **Request parameters:**
|
|
60
60
|
*
|
|
61
61
|
* - `bridge_id`: The bridge ID returned from `/burn`
|
|
62
|
-
* - `
|
|
63
|
-
* - `gas_sponsorship`: If true, returns EIP-712 typed data for gas-sponsored execution
|
|
62
|
+
* - `burn_tx_hash`: The transaction hash of the burn transaction on the source chain
|
|
64
63
|
*
|
|
65
64
|
* **Response codes:**
|
|
66
65
|
*
|
|
@@ -70,6 +69,8 @@ export class Cctp extends ClientSDK {
|
|
|
70
69
|
*
|
|
71
70
|
* **After receiving 202:**
|
|
72
71
|
*
|
|
72
|
+
* The SSE stream and status endpoint are in progress. Keep an eye on the updates from our team.
|
|
73
|
+
*
|
|
73
74
|
* Either:
|
|
74
75
|
* - Connect to the SSE stream at `sse_url` and wait for `attestation_ready` event
|
|
75
76
|
* - Poll this endpoint periodically until you get 200
|
|
@@ -77,10 +78,10 @@ export class Cctp extends ClientSDK {
|
|
|
77
78
|
* **After receiving 200:**
|
|
78
79
|
*
|
|
79
80
|
* Sign and broadcast the returned transaction on the destination chain to mint USDC
|
|
80
|
-
* to your
|
|
81
|
+
* to your Product Account.
|
|
81
82
|
*/
|
|
82
83
|
async cctpMint(request, options) {
|
|
83
|
-
return unwrapAsync(
|
|
84
|
+
return unwrapAsync(bridgeCctpMint(this, request, options));
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
|
-
//# sourceMappingURL=
|
|
87
|
+
//# sourceMappingURL=bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../../../src/sdk/bridge.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,MAAO,SAAQ,SAAS;IACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,KAAK,CAAC,QAAQ,CACZ,OAAyC,EACzC,OAAwB;QAExB,OAAO,WAAW,CAAC,cAAc,CAC/B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACH,KAAK,CAAC,QAAQ,CACZ,OAAsC,EACtC,OAAwB;QAExB,OAAO,WAAW,CAAC,cAAc,CAC/B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/dist/esm/sdk/sdk.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ClientSDK } from "../lib/sdks.js";
|
|
2
2
|
import { AaveV3 } from "./aavev3.js";
|
|
3
3
|
import { AerodromeSlipstream } from "./aerodromeslipstream.js";
|
|
4
|
-
import {
|
|
4
|
+
import { Bridge } from "./bridge.js";
|
|
5
5
|
import { Earn } from "./earn.js";
|
|
6
6
|
import { Erc4626Vaults } from "./erc4626vaults.js";
|
|
7
7
|
import { Ethena } from "./ethena.js";
|
|
@@ -49,7 +49,7 @@ export declare class CompassApiSDK extends ClientSDK {
|
|
|
49
49
|
get gasSponsorship(): GasSponsorship;
|
|
50
50
|
private _earn?;
|
|
51
51
|
get earn(): Earn;
|
|
52
|
-
private
|
|
53
|
-
get
|
|
52
|
+
private _bridge?;
|
|
53
|
+
get bridge(): Bridge;
|
|
54
54
|
}
|
|
55
55
|
//# sourceMappingURL=sdk.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/sdk/sdk.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,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Slipstream } from "./aerodromeslipstream.js";
|
|
7
|
-
import {
|
|
7
|
+
import { Bridge } from "./bridge.js";
|
|
8
8
|
import { Earn } from "./earn.js";
|
|
9
9
|
import { Erc4626Vaults } from "./erc4626vaults.js";
|
|
10
10
|
import { Ethena } from "./ethena.js";
|
|
@@ -68,8 +68,8 @@ export class CompassApiSDK extends ClientSDK {
|
|
|
68
68
|
get earn() {
|
|
69
69
|
return (this._earn ?? (this._earn = new Earn(this._options)));
|
|
70
70
|
}
|
|
71
|
-
get
|
|
72
|
-
return (this.
|
|
71
|
+
get bridge() {
|
|
72
|
+
return (this._bridge ?? (this._bridge = new Bridge(this._options)));
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
//# sourceMappingURL=sdk.js.map
|
package/dist/esm/sdk/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../../src/sdk/sdk.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../../src/sdk/sdk.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAA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AAI,CAAC,OAAO,KAAZ,IAAI,CAAC,OAAO,GAAK,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IACtD,CAAC;IAGD,IAAI,OAAO;QACT,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAb,IAAI,CAAC,QAAQ,GAAK,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IACxD,CAAC;IAGD,IAAI,cAAc;QAChB,OAAO,CAAC,IAAI,CAAC,eAAe,KAApB,IAAI,CAAC,eAAe,GAAK,IAAI,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IACtE,CAAC;IAGD,IAAI,IAAI;QACN,OAAO,CAAC,IAAI,CAAC,KAAK,KAAV,IAAI,CAAC,KAAK,GAAK,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAClD,CAAC;IAGD,IAAI,MAAM;QACR,OAAO,CAAC,IAAI,CAAC,OAAO,KAAZ,IAAI,CAAC,OAAO,GAAK,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IACtD,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -26,10 +26,10 @@ import { APICall, APIPromise } from "../types/async.js";
|
|
|
26
26
|
import { Result } from "../types/fp.js";
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Initiate USDC bridging
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
|
-
* Build a transaction to burn USDC from
|
|
32
|
+
* Build a transaction to burn USDC from any Product Account on the source chain
|
|
33
33
|
* and initiate a cross-chain transfer via Circle's CCTP V2 (Cross-Chain Transfer Protocol).
|
|
34
34
|
*
|
|
35
35
|
* **Transfer modes:**
|
|
@@ -46,17 +46,17 @@ import { Result } from "../types/fp.js";
|
|
|
46
46
|
* 4. Wait for Circle's attestation service to attest the burn
|
|
47
47
|
* 5. Call the mint endpoint to receive USDC on the destination chain
|
|
48
48
|
*
|
|
49
|
+
* Step 5 is only required as a fail safe mechanism to mint USDC on a destination chain when bridging has not been confirmed up automatically.
|
|
50
|
+
*
|
|
49
51
|
* **Supported chains:**
|
|
50
52
|
* - Ethereum (domain 0)
|
|
51
53
|
* - Arbitrum (domain 3)
|
|
52
54
|
* - Base (domain 6)
|
|
53
55
|
*
|
|
54
|
-
* **Note:** The USDC must already be deposited in the
|
|
56
|
+
* **Note:** The USDC must already be deposited in the Product Account. If approval is needed
|
|
55
57
|
* for the TokenMessengerV2 contract, it will be included in the transaction automatically.
|
|
56
|
-
*
|
|
57
|
-
* **Gas estimate:** ~200,000 gas units (includes Safe execTransaction overhead)
|
|
58
58
|
*/
|
|
59
|
-
export function
|
|
59
|
+
export function bridgeCctpBurn(
|
|
60
60
|
client: CompassApiSDKCore,
|
|
61
61
|
request: components.DepositForBurnRequest,
|
|
62
62
|
options?: RequestOptions,
|
|
@@ -27,26 +27,25 @@ import { APICall, APIPromise } from "../types/async.js";
|
|
|
27
27
|
import { Result } from "../types/fp.js";
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* Confirm USDC bridging
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
|
-
*
|
|
33
|
+
* ***This endpoint is only needed to be called in rare cases when bridging was not confirmed automatically***
|
|
34
|
+
*
|
|
35
|
+
* Prepare a receiveMessage transaction to mint USDC to any Product Account on the
|
|
34
36
|
* destination chain.
|
|
35
37
|
*
|
|
36
38
|
* **How it works:**
|
|
37
39
|
*
|
|
38
40
|
* This endpoint uses the `bridge_id` from `/burn` to:
|
|
39
|
-
* 1. Look up the bridge session
|
|
40
|
-
* 2.
|
|
41
|
-
* 3.
|
|
42
|
-
* 4. Check if Circle's attestation is ready
|
|
43
|
-
* 5. Return the mint transaction wrapped in Safe execTransaction
|
|
41
|
+
* 1. Look up the bridge session
|
|
42
|
+
* 2. Check if Circle's attestation is ready
|
|
43
|
+
* 3. Return the mint transaction
|
|
44
44
|
*
|
|
45
45
|
* **Request parameters:**
|
|
46
46
|
*
|
|
47
47
|
* - `bridge_id`: The bridge ID returned from `/burn`
|
|
48
|
-
* - `
|
|
49
|
-
* - `gas_sponsorship`: If true, returns EIP-712 typed data for gas-sponsored execution
|
|
48
|
+
* - `burn_tx_hash`: The transaction hash of the burn transaction on the source chain
|
|
50
49
|
*
|
|
51
50
|
* **Response codes:**
|
|
52
51
|
*
|
|
@@ -56,6 +55,8 @@ import { Result } from "../types/fp.js";
|
|
|
56
55
|
*
|
|
57
56
|
* **After receiving 202:**
|
|
58
57
|
*
|
|
58
|
+
* The SSE stream and status endpoint are in progress. Keep an eye on the updates from our team.
|
|
59
|
+
*
|
|
59
60
|
* Either:
|
|
60
61
|
* - Connect to the SSE stream at `sse_url` and wait for `attestation_ready` event
|
|
61
62
|
* - Poll this endpoint periodically until you get 200
|
|
@@ -63,9 +64,9 @@ import { Result } from "../types/fp.js";
|
|
|
63
64
|
* **After receiving 200:**
|
|
64
65
|
*
|
|
65
66
|
* Sign and broadcast the returned transaction on the destination chain to mint USDC
|
|
66
|
-
* to your
|
|
67
|
+
* to your Product Account.
|
|
67
68
|
*/
|
|
68
|
-
export function
|
|
69
|
+
export function bridgeCctpMint(
|
|
69
70
|
client: CompassApiSDKCore,
|
|
70
71
|
request: components.MintPrepareRequest,
|
|
71
72
|
options?: RequestOptions,
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { bridgeCctpBurn } from "../funcs/bridgeCctpBurn.js";
|
|
6
|
+
import { bridgeCctpMint } from "../funcs/bridgeCctpMint.js";
|
|
7
7
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
8
8
|
import * as components from "../models/components/index.js";
|
|
9
9
|
import * as operations from "../models/operations/index.js";
|
|
10
10
|
import { unwrapAsync } from "../types/fp.js";
|
|
11
11
|
|
|
12
|
-
export class
|
|
12
|
+
export class Bridge extends ClientSDK {
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Initiate USDC bridging
|
|
15
15
|
*
|
|
16
16
|
* @remarks
|
|
17
|
-
* Build a transaction to burn USDC from
|
|
17
|
+
* Build a transaction to burn USDC from any Product Account on the source chain
|
|
18
18
|
* and initiate a cross-chain transfer via Circle's CCTP V2 (Cross-Chain Transfer Protocol).
|
|
19
19
|
*
|
|
20
20
|
* **Transfer modes:**
|
|
@@ -31,21 +31,21 @@ export class Cctp extends ClientSDK {
|
|
|
31
31
|
* 4. Wait for Circle's attestation service to attest the burn
|
|
32
32
|
* 5. Call the mint endpoint to receive USDC on the destination chain
|
|
33
33
|
*
|
|
34
|
+
* Step 5 is only required as a fail safe mechanism to mint USDC on a destination chain when bridging has not been confirmed up automatically.
|
|
35
|
+
*
|
|
34
36
|
* **Supported chains:**
|
|
35
37
|
* - Ethereum (domain 0)
|
|
36
38
|
* - Arbitrum (domain 3)
|
|
37
39
|
* - Base (domain 6)
|
|
38
40
|
*
|
|
39
|
-
* **Note:** The USDC must already be deposited in the
|
|
41
|
+
* **Note:** The USDC must already be deposited in the Product Account. If approval is needed
|
|
40
42
|
* for the TokenMessengerV2 contract, it will be included in the transaction automatically.
|
|
41
|
-
*
|
|
42
|
-
* **Gas estimate:** ~200,000 gas units (includes Safe execTransaction overhead)
|
|
43
43
|
*/
|
|
44
44
|
async cctpBurn(
|
|
45
45
|
request: components.DepositForBurnRequest,
|
|
46
46
|
options?: RequestOptions,
|
|
47
47
|
): Promise<components.DepositForBurnResponse> {
|
|
48
|
-
return unwrapAsync(
|
|
48
|
+
return unwrapAsync(bridgeCctpBurn(
|
|
49
49
|
this,
|
|
50
50
|
request,
|
|
51
51
|
options,
|
|
@@ -53,26 +53,25 @@ export class Cctp extends ClientSDK {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
56
|
+
* Confirm USDC bridging
|
|
57
57
|
*
|
|
58
58
|
* @remarks
|
|
59
|
-
*
|
|
59
|
+
* ***This endpoint is only needed to be called in rare cases when bridging was not confirmed automatically***
|
|
60
|
+
*
|
|
61
|
+
* Prepare a receiveMessage transaction to mint USDC to any Product Account on the
|
|
60
62
|
* destination chain.
|
|
61
63
|
*
|
|
62
64
|
* **How it works:**
|
|
63
65
|
*
|
|
64
66
|
* This endpoint uses the `bridge_id` from `/burn` to:
|
|
65
|
-
* 1. Look up the bridge session
|
|
66
|
-
* 2.
|
|
67
|
-
* 3.
|
|
68
|
-
* 4. Check if Circle's attestation is ready
|
|
69
|
-
* 5. Return the mint transaction wrapped in Safe execTransaction
|
|
67
|
+
* 1. Look up the bridge session
|
|
68
|
+
* 2. Check if Circle's attestation is ready
|
|
69
|
+
* 3. Return the mint transaction
|
|
70
70
|
*
|
|
71
71
|
* **Request parameters:**
|
|
72
72
|
*
|
|
73
73
|
* - `bridge_id`: The bridge ID returned from `/burn`
|
|
74
|
-
* - `
|
|
75
|
-
* - `gas_sponsorship`: If true, returns EIP-712 typed data for gas-sponsored execution
|
|
74
|
+
* - `burn_tx_hash`: The transaction hash of the burn transaction on the source chain
|
|
76
75
|
*
|
|
77
76
|
* **Response codes:**
|
|
78
77
|
*
|
|
@@ -82,6 +81,8 @@ export class Cctp extends ClientSDK {
|
|
|
82
81
|
*
|
|
83
82
|
* **After receiving 202:**
|
|
84
83
|
*
|
|
84
|
+
* The SSE stream and status endpoint are in progress. Keep an eye on the updates from our team.
|
|
85
|
+
*
|
|
85
86
|
* Either:
|
|
86
87
|
* - Connect to the SSE stream at `sse_url` and wait for `attestation_ready` event
|
|
87
88
|
* - Poll this endpoint periodically until you get 200
|
|
@@ -89,13 +90,13 @@ export class Cctp extends ClientSDK {
|
|
|
89
90
|
* **After receiving 200:**
|
|
90
91
|
*
|
|
91
92
|
* Sign and broadcast the returned transaction on the destination chain to mint USDC
|
|
92
|
-
* to your
|
|
93
|
+
* to your Product Account.
|
|
93
94
|
*/
|
|
94
95
|
async cctpMint(
|
|
95
96
|
request: components.MintPrepareRequest,
|
|
96
97
|
options?: RequestOptions,
|
|
97
98
|
): Promise<operations.V2CctpMintResponse> {
|
|
98
|
-
return unwrapAsync(
|
|
99
|
+
return unwrapAsync(bridgeCctpMint(
|
|
99
100
|
this,
|
|
100
101
|
request,
|
|
101
102
|
options,
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { ClientSDK } from "../lib/sdks.js";
|
|
6
6
|
import { AaveV3 } from "./aavev3.js";
|
|
7
7
|
import { AerodromeSlipstream } from "./aerodromeslipstream.js";
|
|
8
|
-
import {
|
|
8
|
+
import { Bridge } from "./bridge.js";
|
|
9
9
|
import { Earn } from "./earn.js";
|
|
10
10
|
import { Erc4626Vaults } from "./erc4626vaults.js";
|
|
11
11
|
import { Ethena } from "./ethena.js";
|
|
@@ -104,8 +104,8 @@ export class CompassApiSDK extends ClientSDK {
|
|
|
104
104
|
return (this._earn ??= new Earn(this._options));
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
private
|
|
108
|
-
get
|
|
109
|
-
return (this.
|
|
107
|
+
private _bridge?: Bridge;
|
|
108
|
+
get bridge(): Bridge {
|
|
109
|
+
return (this._bridge ??= new Bridge(this._options));
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cctpCCTPBurn.d.ts","sourceRoot":"","sources":["../../../src/funcs/cctpCCTPBurn.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAK/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,UAAU,CAAC,qBAAqB,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,sBAAsB,EAC/B,MAAM,CAAC,mBAAmB,GAC1B,kBAAkB,GAClB,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
|