@relayprotocol/relay-sdk 5.2.1 → 5.2.3

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.
@@ -4,7 +4,9 @@ exports.routes = void 0;
4
4
  exports.routes = [
5
5
  "/app-fees/{wallet}/balances",
6
6
  "/app-fees/{wallet}/claim",
7
+ "/app-fees/{wallet}/claims",
7
8
  "/chains",
9
+ "/chains/liquidity",
8
10
  "/chains/health",
9
11
  "/config",
10
12
  "/config/v2",
@@ -31,6 +33,7 @@ exports.routes = [
31
33
  "/requests/metadata",
32
34
  "/transactions/index",
33
35
  "/transactions/single",
36
+ "/transactions/deposit-address/reindex",
34
37
  "/swap-sources",
35
38
  "/loadforge.txt",
36
39
  "/conduit/install",
@@ -38,11 +41,17 @@ exports.routes = [
38
41
  "/currencies/v1",
39
42
  "/currencies/v2",
40
43
  "/currencies/token/price",
44
+ "/currencies/token/price/v2",
41
45
  "/currencies/trending",
42
46
  "/chains/{chainId}/currencies/{address}",
43
47
  "/chains/{chainId}/currencies/{address}/chart",
44
48
  "/provision/chain",
45
49
  "/sanctioned/{address}",
46
- "/wallets/screen"
50
+ "/wallets/screen",
51
+ "/wallets/screen/override",
52
+ "/wallets/screen/info",
53
+ "/withdrawals/attest-deposit",
54
+ "/withdrawals/request",
55
+ "/withdrawals/status"
47
56
  ];
48
57
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/routes/index.ts"],"names":[],"mappings":";;;AAAa,QAAA,MAAM,GAAG;IACpB,6BAA6B;IAC7B,0BAA0B;IAC1B,SAAS;IACT,gBAAgB;IAChB,SAAS;IACT,YAAY;IACZ,iBAAiB;IACjB,oBAAoB;IACpB,eAAe;IACf,kBAAkB;IAClB,eAAe;IACf,2BAA2B;IAC3B,kBAAkB;IAClB,QAAQ;IACR,WAAW;IACX,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,iBAAiB;IACjB,oBAAoB;IACpB,oBAAoB;IACpB,iCAAiC;IACjC,oCAAoC;IACpC,WAAW;IACX,cAAc;IACd,oBAAoB;IACpB,qBAAqB;IACrB,sBAAsB;IACtB,eAAe;IACf,gBAAgB;IAChB,kBAAkB;IAClB,eAAe;IACf,gBAAgB;IAChB,gBAAgB;IAChB,yBAAyB;IACzB,sBAAsB;IACtB,wCAAwC;IACxC,8CAA8C;IAC9C,kBAAkB;IAClB,uBAAuB;IACvB,iBAAiB;CAClB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/routes/index.ts"],"names":[],"mappings":";;;AAAa,QAAA,MAAM,GAAG;IACpB,6BAA6B;IAC7B,0BAA0B;IAC1B,2BAA2B;IAC3B,SAAS;IACT,mBAAmB;IACnB,gBAAgB;IAChB,SAAS;IACT,YAAY;IACZ,iBAAiB;IACjB,oBAAoB;IACpB,eAAe;IACf,kBAAkB;IAClB,eAAe;IACf,2BAA2B;IAC3B,kBAAkB;IAClB,QAAQ;IACR,WAAW;IACX,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,iBAAiB;IACjB,oBAAoB;IACpB,oBAAoB;IACpB,iCAAiC;IACjC,oCAAoC;IACpC,WAAW;IACX,cAAc;IACd,oBAAoB;IACpB,qBAAqB;IACrB,sBAAsB;IACtB,uCAAuC;IACvC,eAAe;IACf,gBAAgB;IAChB,kBAAkB;IAClB,eAAe;IACf,gBAAgB;IAChB,gBAAgB;IAChB,yBAAyB;IACzB,4BAA4B;IAC5B,sBAAsB;IACtB,wCAAwC;IACxC,8CAA8C;IAC9C,kBAAkB;IAClB,uBAAuB;IACvB,iBAAiB;IACjB,0BAA0B;IAC1B,sBAAsB;IACtB,6BAA6B;IAC7B,sBAAsB;IACtB,qBAAqB;CACtB,CAAC"}
@@ -2,32 +2,38 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.prepareBatchTransaction = exports.canBatchTransactions = void 0;
4
4
  function canBatchTransactions(steps) {
5
- const firstStep = steps[0];
6
- const secondStep = steps[1];
7
- const hasIncompleteApproval = firstStep?.items?.some((item) => item.status === 'incomplete');
8
- const hasIncompleteDeposit = secondStep?.items?.some((item) => item.status === 'incomplete');
9
- return (firstStep?.id === 'approve' &&
10
- (secondStep?.id === 'deposit' || secondStep?.id === 'swap') &&
11
- hasIncompleteApproval &&
12
- hasIncompleteDeposit);
5
+ if (!steps || steps.length < 2)
6
+ return false;
7
+ const terminalStep = steps[steps.length - 1];
8
+ const prefixSteps = steps.slice(0, -1);
9
+ const terminalIsSwapOrDeposit = terminalStep?.id === 'swap' || terminalStep?.id === 'deposit';
10
+ if (!terminalIsSwapOrDeposit)
11
+ return false;
12
+ const prefixAllApprovals = prefixSteps.every((step) => step?.id === 'approve');
13
+ if (!prefixAllApprovals)
14
+ return false;
15
+ const allStepsHaveIncomplete = steps.every((step) => step?.items?.some((item) => item.status === 'incomplete'));
16
+ return allStepsHaveIncomplete;
13
17
  }
14
18
  exports.canBatchTransactions = canBatchTransactions;
15
19
  function prepareBatchTransaction(steps) {
16
- const secondStepId = steps[1]?.id;
20
+ const terminalStep = steps[steps.length - 1];
21
+ const terminalId = terminalStep?.id;
22
+ const allItems = steps.flatMap((step) => step.items || []);
23
+ const batchedItems = allItems.map((item, index) => {
24
+ if (index === 0)
25
+ return item;
26
+ item.status = 'complete';
27
+ item.progressState = 'complete';
28
+ return item;
29
+ });
17
30
  const batchedStep = {
18
- id: `approve-and-${secondStepId}`,
31
+ id: `approve-and-${terminalId}`,
19
32
  action: 'Confirm transaction in your wallet',
20
- description: `Batching approval and ${secondStepId} transactions`,
33
+ description: `Batching approval and ${terminalId} transactions`,
21
34
  kind: 'transaction',
22
- items: [
23
- ...(steps[0].items || []),
24
- ...(steps[1].items || []).map((item) => {
25
- item.status = 'complete';
26
- item.progressState = 'complete';
27
- return item;
28
- })
29
- ],
30
- requestId: steps[1].requestId ?? steps[0].requestId
35
+ items: batchedItems,
36
+ requestId: terminalStep?.requestId ?? steps[0]?.requestId
31
37
  };
32
38
  return batchedStep;
33
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"prepareBatchTransaction.js","sourceRoot":"","sources":["../../../src/utils/prepareBatchTransaction.ts"],"names":[],"mappings":";;;AAEA,SAAgB,oBAAoB,CAAC,KAAuB;IAC1D,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;IAC1B,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;IAE3B,MAAM,qBAAqB,GAAG,SAAS,EAAE,KAAK,EAAE,IAAI,CAClD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,YAAY,CACvC,CAAA;IACD,MAAM,oBAAoB,GAAG,UAAU,EAAE,KAAK,EAAE,IAAI,CAClD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,YAAY,CACvC,CAAA;IAED,OAAO,CACL,SAAS,EAAE,EAAE,KAAK,SAAS;QAC3B,CAAC,UAAU,EAAE,EAAE,KAAK,SAAS,IAAI,UAAU,EAAE,EAAE,KAAK,MAAM,CAAC;QAC3D,qBAAqB;QACrB,oBAAoB,CACrB,CAAA;AACH,CAAC;AAjBD,oDAiBC;AAED,SAAgB,uBAAuB,CAAC,KAAuB;IAC7D,MAAM,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAA;IAEjC,MAAM,WAAW,GAAG;QAClB,EAAE,EAAE,eAAe,YAAY,EAAS;QACxC,MAAM,EAAE,oCAAoC;QAC5C,WAAW,EAAE,yBAAyB,YAAY,eAAe;QACjE,IAAI,EAAE,aAAsB;QAC5B,KAAK,EAAE;YACL,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YACzB,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAA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B,CAAC;AAnBD,oDAmBC;AAYD,SAAgB,uBAAuB,CAAC,KAAuB;IAC7D,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IAC5C,MAAM,UAAU,GAAG,YAAY,EAAE,EAAE,CAAA;IAEnC,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAA;IAE1D,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QAChD,IAAI,KAAK,KAAK,CAAC;YAAE,OAAO,IAAI,CAAA;QAE5B,IAAI,CAAC,MAAM,GAAG,UAAU,CAAA;QACxB,IAAI,CAAC,aAAa,GAAG,UAAU,CAAA;QAC/B,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CAAA;IAEF,MAAM,WAAW,GAAG;QAClB,EAAE,EAAE,eAAe,UAAU,EAAS;QACtC,MAAM,EAAE,oCAAoC;QAC5C,WAAW,EAAE,yBAAyB,UAAU,eAAe;QAC/D,IAAI,EAAE,aAAsB;QAC5B,KAAK,EAAE,YAAY;QACnB,SAAS,EAAE,YAAY,EAAE,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,SAAS;KAC1D,CAAA;IAED,OAAO,WAAW,CAAA;AACpB,CAAC;AAxBD,0DAwBC"}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = '5.2.1';
4
+ exports.SDK_VERSION = '5.2.3';
5
5
  //# sourceMappingURL=version.js.map