@lifi/sdk-provider-sui 4.0.0-beta.2 → 4.0.0-beta.4
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/esm/core/SuiStepExecutor.d.ts +3 -3
- package/dist/esm/core/SuiStepExecutor.d.ts.map +1 -1
- package/dist/esm/core/SuiStepExecutor.js +28 -29
- package/dist/esm/core/SuiStepExecutor.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/package.json +3 -3
- package/src/version.ts +1 -1
- package/dist/esm/_virtual/_@oxc-project_runtime@0.115.0/helpers/defineProperty.js +0 -12
- package/dist/esm/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPrimitive.js +0 -14
- package/dist/esm/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPropertyKey.js +0 -9
- package/dist/esm/_virtual/_@oxc-project_runtime@0.115.0/helpers/typeof.js +0 -11
|
@@ -7,9 +7,9 @@ declare class SuiStepExecutor extends BaseStepExecutor {
|
|
|
7
7
|
private signer;
|
|
8
8
|
constructor(options: SuiStepExecutorOptions);
|
|
9
9
|
checkWallet: (step: LiFiStepExtended) => void;
|
|
10
|
-
parseErrors: (error: Error, step?: LiFiStepExtended, action?: ExecutionAction) => Promise<SDKError>;
|
|
11
|
-
createContext: (baseContext: StepExecutorBaseContext) => Promise<SuiStepExecutorContext>;
|
|
12
|
-
createPipeline: (context: SuiStepExecutorContext) => TaskPipeline;
|
|
10
|
+
override parseErrors: (error: Error, step?: LiFiStepExtended, action?: ExecutionAction) => Promise<SDKError>;
|
|
11
|
+
override createContext: (baseContext: StepExecutorBaseContext) => Promise<SuiStepExecutorContext>;
|
|
12
|
+
override createPipeline: (context: SuiStepExecutorContext) => TaskPipeline;
|
|
13
13
|
}
|
|
14
14
|
//#endregion
|
|
15
15
|
export { SuiStepExecutor };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuiStepExecutor.d.ts","names":[],"sources":["../../../src/core/SuiStepExecutor.ts"],"mappings":";;;;cAuBa,eAAA,SAAwB,gBAAA;EAAA,QAC3B,MAAA;EAAA,QACA,MAAA;EAER,WAAA,CAAY,OAAA,EAAS,sBAAA;EAMrB,WAAA,GAAe,IAAA,EAAM,gBAAA;
|
|
1
|
+
{"version":3,"file":"SuiStepExecutor.d.ts","names":[],"sources":["../../../src/core/SuiStepExecutor.ts"],"mappings":";;;;cAuBa,eAAA,SAAwB,gBAAA;EAAA,QAC3B,MAAA;EAAA,QACA,MAAA;EAER,WAAA,CAAY,OAAA,EAAS,sBAAA;EAMrB,WAAA,GAAe,IAAA,EAAM,gBAAA;EAAA,SAWZ,WAAA,GACP,KAAA,EAAO,KAAA,EACP,IAAA,GAAO,gBAAA,EACP,MAAA,GAAS,eAAA,KACR,OAAA,CAAQ,QAAA;EAAA,SAEF,aAAA,GACP,WAAA,EAAa,uBAAA,KACZ,OAAA,CAAQ,sBAAA;EAAA,SASF,cAAA,GAAkB,OAAA,EAAS,sBAAA,KAAyB,YAAA;AAAA"}
|
|
@@ -1,43 +1,42 @@
|
|
|
1
1
|
import { parseSuiErrors } from "../errors/parseSuiErrors.js";
|
|
2
2
|
import { SuiSignAndExecuteTask } from "./tasks/SuiSignAndExecuteTask.js";
|
|
3
3
|
import { SuiWaitForTransactionTask } from "./tasks/SuiWaitForTransactionTask.js";
|
|
4
|
-
import { _defineProperty } from "../_virtual/_@oxc-project_runtime@0.115.0/helpers/defineProperty.js";
|
|
5
4
|
import { BaseStepExecutor, CheckBalanceTask, LiFiErrorCode, PrepareTransactionTask, TaskPipeline, TransactionError, WaitForTransactionStatusTask } from "@lifi/sdk";
|
|
6
5
|
//#region src/core/SuiStepExecutor.ts
|
|
7
6
|
var SuiStepExecutor = class extends BaseStepExecutor {
|
|
7
|
+
client;
|
|
8
|
+
signer;
|
|
8
9
|
constructor(options) {
|
|
9
10
|
super(options);
|
|
10
|
-
_defineProperty(this, "client", void 0);
|
|
11
|
-
_defineProperty(this, "signer", void 0);
|
|
12
|
-
_defineProperty(this, "checkWallet", (step) => {
|
|
13
|
-
if (this.signer.toSuiAddress() !== step.action.fromAddress) throw new TransactionError(LiFiErrorCode.WalletChangedDuringExecution, "The wallet address that requested the quote does not match the wallet address attempting to sign the transaction.");
|
|
14
|
-
});
|
|
15
|
-
_defineProperty(this, "parseErrors", (error, step, action) => parseSuiErrors(error, step, action));
|
|
16
|
-
_defineProperty(this, "createContext", async (baseContext) => {
|
|
17
|
-
return {
|
|
18
|
-
...baseContext,
|
|
19
|
-
suiClient: this.client,
|
|
20
|
-
signer: this.signer,
|
|
21
|
-
checkWallet: this.checkWallet
|
|
22
|
-
};
|
|
23
|
-
});
|
|
24
|
-
_defineProperty(this, "createPipeline", (context) => {
|
|
25
|
-
const { step, isBridgeExecution } = context;
|
|
26
|
-
const tasks = [
|
|
27
|
-
new CheckBalanceTask(),
|
|
28
|
-
new PrepareTransactionTask(),
|
|
29
|
-
new SuiSignAndExecuteTask(),
|
|
30
|
-
new SuiWaitForTransactionTask(),
|
|
31
|
-
new WaitForTransactionStatusTask(isBridgeExecution ? "RECEIVING_CHAIN" : "SWAP")
|
|
32
|
-
];
|
|
33
|
-
const swapOrBridgeAction = this.statusManager.findAction(step, isBridgeExecution ? "CROSS_CHAIN" : "SWAP");
|
|
34
|
-
const taskName = swapOrBridgeAction?.txHash && swapOrBridgeAction?.status === "DONE" ? WaitForTransactionStatusTask.name : CheckBalanceTask.name;
|
|
35
|
-
const firstTaskIndex = tasks.findIndex((task) => task.constructor.name === taskName);
|
|
36
|
-
return new TaskPipeline(tasks.slice(firstTaskIndex));
|
|
37
|
-
});
|
|
38
11
|
this.client = options.client;
|
|
39
12
|
this.signer = options.signer;
|
|
40
13
|
}
|
|
14
|
+
checkWallet = (step) => {
|
|
15
|
+
if (this.signer.toSuiAddress() !== step.action.fromAddress) throw new TransactionError(LiFiErrorCode.WalletChangedDuringExecution, "The wallet address that requested the quote does not match the wallet address attempting to sign the transaction.");
|
|
16
|
+
};
|
|
17
|
+
parseErrors = (error, step, action) => parseSuiErrors(error, step, action);
|
|
18
|
+
createContext = async (baseContext) => {
|
|
19
|
+
return {
|
|
20
|
+
...baseContext,
|
|
21
|
+
suiClient: this.client,
|
|
22
|
+
signer: this.signer,
|
|
23
|
+
checkWallet: this.checkWallet
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
createPipeline = (context) => {
|
|
27
|
+
const { step, isBridgeExecution } = context;
|
|
28
|
+
const tasks = [
|
|
29
|
+
new CheckBalanceTask(),
|
|
30
|
+
new PrepareTransactionTask(),
|
|
31
|
+
new SuiSignAndExecuteTask(),
|
|
32
|
+
new SuiWaitForTransactionTask(),
|
|
33
|
+
new WaitForTransactionStatusTask(isBridgeExecution ? "RECEIVING_CHAIN" : "SWAP")
|
|
34
|
+
];
|
|
35
|
+
const swapOrBridgeAction = this.statusManager.findAction(step, isBridgeExecution ? "CROSS_CHAIN" : "SWAP");
|
|
36
|
+
const taskName = swapOrBridgeAction?.txHash && swapOrBridgeAction?.status === "DONE" ? WaitForTransactionStatusTask.name : CheckBalanceTask.name;
|
|
37
|
+
const firstTaskIndex = tasks.findIndex((task) => task.constructor.name === taskName);
|
|
38
|
+
return new TaskPipeline(tasks.slice(firstTaskIndex));
|
|
39
|
+
};
|
|
41
40
|
};
|
|
42
41
|
//#endregion
|
|
43
42
|
export { SuiStepExecutor };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuiStepExecutor.js","names":[],"sources":["../../../src/core/SuiStepExecutor.ts"],"sourcesContent":["import {\n BaseStepExecutor,\n CheckBalanceTask,\n type ExecutionAction,\n LiFiErrorCode,\n type LiFiStepExtended,\n PrepareTransactionTask,\n type SDKError,\n type StepExecutorBaseContext,\n TaskPipeline,\n TransactionError,\n WaitForTransactionStatusTask,\n} from '@lifi/sdk'\nimport type { ClientWithCoreApi } from '@mysten/sui/client'\nimport type { Signer } from '@mysten/sui/cryptography'\nimport { parseSuiErrors } from '../errors/parseSuiErrors.js'\nimport type {\n SuiStepExecutorContext,\n SuiStepExecutorOptions,\n} from '../types.js'\nimport { SuiSignAndExecuteTask } from './tasks/SuiSignAndExecuteTask.js'\nimport { SuiWaitForTransactionTask } from './tasks/SuiWaitForTransactionTask.js'\n\nexport class SuiStepExecutor extends BaseStepExecutor {\n private client: ClientWithCoreApi\n private signer: Signer\n\n constructor(options: SuiStepExecutorOptions) {\n super(options)\n this.client = options.client\n this.signer = options.signer\n }\n\n checkWallet = (step: LiFiStepExtended): void => {\n // Prevent execution of the quote by wallet different from the one which requested the quote\n const address = this.signer.toSuiAddress()\n if (address !== step.action.fromAddress) {\n throw new TransactionError(\n LiFiErrorCode.WalletChangedDuringExecution,\n 'The wallet address that requested the quote does not match the wallet address attempting to sign the transaction.'\n )\n }\n }\n\n override parseErrors = (\n error: Error,\n step?: LiFiStepExtended,\n action?: ExecutionAction\n ): Promise<SDKError> => parseSuiErrors(error, step, action)\n\n override createContext = async (\n baseContext: StepExecutorBaseContext\n ): Promise<SuiStepExecutorContext> => {\n return {\n ...baseContext,\n suiClient: this.client,\n signer: this.signer,\n checkWallet: this.checkWallet,\n }\n }\n\n override createPipeline = (context: SuiStepExecutorContext): TaskPipeline => {\n const { step, isBridgeExecution } = context\n\n const tasks = [\n new CheckBalanceTask(),\n new PrepareTransactionTask(),\n new SuiSignAndExecuteTask(),\n new SuiWaitForTransactionTask(),\n new WaitForTransactionStatusTask(\n isBridgeExecution ? 'RECEIVING_CHAIN' : 'SWAP'\n ),\n ]\n\n const swapOrBridgeAction = this.statusManager.findAction(\n step,\n isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n )\n\n const taskName =\n swapOrBridgeAction?.txHash && swapOrBridgeAction?.status === 'DONE'\n ? WaitForTransactionStatusTask.name\n : CheckBalanceTask.name\n\n const firstTaskIndex = tasks.findIndex(\n (task) => task.constructor.name === taskName\n )\n\n const tasksToRun = tasks.slice(firstTaskIndex)\n\n return new TaskPipeline(tasksToRun)\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SuiStepExecutor.js","names":[],"sources":["../../../src/core/SuiStepExecutor.ts"],"sourcesContent":["import {\n BaseStepExecutor,\n CheckBalanceTask,\n type ExecutionAction,\n LiFiErrorCode,\n type LiFiStepExtended,\n PrepareTransactionTask,\n type SDKError,\n type StepExecutorBaseContext,\n TaskPipeline,\n TransactionError,\n WaitForTransactionStatusTask,\n} from '@lifi/sdk'\nimport type { ClientWithCoreApi } from '@mysten/sui/client'\nimport type { Signer } from '@mysten/sui/cryptography'\nimport { parseSuiErrors } from '../errors/parseSuiErrors.js'\nimport type {\n SuiStepExecutorContext,\n SuiStepExecutorOptions,\n} from '../types.js'\nimport { SuiSignAndExecuteTask } from './tasks/SuiSignAndExecuteTask.js'\nimport { SuiWaitForTransactionTask } from './tasks/SuiWaitForTransactionTask.js'\n\nexport class SuiStepExecutor extends BaseStepExecutor {\n private client: ClientWithCoreApi\n private signer: Signer\n\n constructor(options: SuiStepExecutorOptions) {\n super(options)\n this.client = options.client\n this.signer = options.signer\n }\n\n checkWallet = (step: LiFiStepExtended): void => {\n // Prevent execution of the quote by wallet different from the one which requested the quote\n const address = this.signer.toSuiAddress()\n if (address !== step.action.fromAddress) {\n throw new TransactionError(\n LiFiErrorCode.WalletChangedDuringExecution,\n 'The wallet address that requested the quote does not match the wallet address attempting to sign the transaction.'\n )\n }\n }\n\n override parseErrors = (\n error: Error,\n step?: LiFiStepExtended,\n action?: ExecutionAction\n ): Promise<SDKError> => parseSuiErrors(error, step, action)\n\n override createContext = async (\n baseContext: StepExecutorBaseContext\n ): Promise<SuiStepExecutorContext> => {\n return {\n ...baseContext,\n suiClient: this.client,\n signer: this.signer,\n checkWallet: this.checkWallet,\n }\n }\n\n override createPipeline = (context: SuiStepExecutorContext): TaskPipeline => {\n const { step, isBridgeExecution } = context\n\n const tasks = [\n new CheckBalanceTask(),\n new PrepareTransactionTask(),\n new SuiSignAndExecuteTask(),\n new SuiWaitForTransactionTask(),\n new WaitForTransactionStatusTask(\n isBridgeExecution ? 'RECEIVING_CHAIN' : 'SWAP'\n ),\n ]\n\n const swapOrBridgeAction = this.statusManager.findAction(\n step,\n isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n )\n\n const taskName =\n swapOrBridgeAction?.txHash && swapOrBridgeAction?.status === 'DONE'\n ? WaitForTransactionStatusTask.name\n : CheckBalanceTask.name\n\n const firstTaskIndex = tasks.findIndex(\n (task) => task.constructor.name === taskName\n )\n\n const tasksToRun = tasks.slice(firstTaskIndex)\n\n return new TaskPipeline(tasksToRun)\n }\n}\n"],"mappings":";;;;;AAuBA,IAAa,kBAAb,cAAqC,iBAAiB;CACpD;CACA;CAEA,YAAY,SAAiC;AAC3C,QAAM,QAAQ;AACd,OAAK,SAAS,QAAQ;AACtB,OAAK,SAAS,QAAQ;;CAGxB,eAAe,SAAiC;AAG9C,MADgB,KAAK,OAAO,cAAc,KAC1B,KAAK,OAAO,YAC1B,OAAM,IAAI,iBACR,cAAc,8BACd,oHACD;;CAIL,eACE,OACA,MACA,WACsB,eAAe,OAAO,MAAM,OAAO;CAE3D,gBAAyB,OACvB,gBACoC;AACpC,SAAO;GACL,GAAG;GACH,WAAW,KAAK;GAChB,QAAQ,KAAK;GACb,aAAa,KAAK;GACnB;;CAGH,kBAA2B,YAAkD;EAC3E,MAAM,EAAE,MAAM,sBAAsB;EAEpC,MAAM,QAAQ;GACZ,IAAI,kBAAkB;GACtB,IAAI,wBAAwB;GAC5B,IAAI,uBAAuB;GAC3B,IAAI,2BAA2B;GAC/B,IAAI,6BACF,oBAAoB,oBAAoB,OACzC;GACF;EAED,MAAM,qBAAqB,KAAK,cAAc,WAC5C,MACA,oBAAoB,gBAAgB,OACrC;EAED,MAAM,WACJ,oBAAoB,UAAU,oBAAoB,WAAW,SACzD,6BAA6B,OAC7B,iBAAiB;EAEvB,MAAM,iBAAiB,MAAM,WAC1B,SAAS,KAAK,YAAY,SAAS,SACrC;AAID,SAAO,IAAI,aAFQ,MAAM,MAAM,eAAe,CAEX"}
|
package/dist/esm/version.d.ts
CHANGED
package/dist/esm/version.js
CHANGED
package/dist/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","names":[],"sources":["../../src/version.ts"],"sourcesContent":["export const name = '@lifi/sdk-provider-sui'\nexport const version = '4.0.0-beta.
|
|
1
|
+
{"version":3,"file":"version.js","names":[],"sources":["../../src/version.ts"],"sourcesContent":["export const name = '@lifi/sdk-provider-sui'\nexport const version = '4.0.0-beta.4'\n"],"mappings":";AAAA,MAAa,OAAO;AACpB,MAAa,UAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/sdk-provider-sui",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.4",
|
|
4
4
|
"description": "LI.FI Sui SDK Provider for Any-to-Any Cross-Chain-Swap",
|
|
5
5
|
"homepage": "https://github.com/lifinance/sdk",
|
|
6
6
|
"bugs": {
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"./package.json": "./package.json"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@mysten/sui": "^2.
|
|
32
|
-
"@lifi/sdk": "4.0.0-beta.
|
|
31
|
+
"@mysten/sui": "^2.11.0",
|
|
32
|
+
"@lifi/sdk": "4.0.0-beta.4"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/sdk-provider-sui'
|
|
2
|
-
export const version = '4.0.0-beta.
|
|
2
|
+
export const version = '4.0.0-beta.4'
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { toPropertyKey } from "./toPropertyKey.js";
|
|
2
|
-
//#region \0@oxc-project+runtime@0.115.0/helpers/defineProperty.js
|
|
3
|
-
function _defineProperty(e, r, t) {
|
|
4
|
-
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
5
|
-
value: t,
|
|
6
|
-
enumerable: !0,
|
|
7
|
-
configurable: !0,
|
|
8
|
-
writable: !0
|
|
9
|
-
}) : e[r] = t, e;
|
|
10
|
-
}
|
|
11
|
-
//#endregion
|
|
12
|
-
export { _defineProperty };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { _typeof } from "./typeof.js";
|
|
2
|
-
//#region \0@oxc-project+runtime@0.115.0/helpers/toPrimitive.js
|
|
3
|
-
function toPrimitive(t, r) {
|
|
4
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
5
|
-
var e = t[Symbol.toPrimitive];
|
|
6
|
-
if (void 0 !== e) {
|
|
7
|
-
var i = e.call(t, r || "default");
|
|
8
|
-
if ("object" != _typeof(i)) return i;
|
|
9
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
10
|
-
}
|
|
11
|
-
return ("string" === r ? String : Number)(t);
|
|
12
|
-
}
|
|
13
|
-
//#endregion
|
|
14
|
-
export { toPrimitive };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { _typeof } from "./typeof.js";
|
|
2
|
-
import { toPrimitive } from "./toPrimitive.js";
|
|
3
|
-
//#region \0@oxc-project+runtime@0.115.0/helpers/toPropertyKey.js
|
|
4
|
-
function toPropertyKey(t) {
|
|
5
|
-
var i = toPrimitive(t, "string");
|
|
6
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
export { toPropertyKey };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//#region \0@oxc-project+runtime@0.115.0/helpers/typeof.js
|
|
2
|
-
function _typeof(o) {
|
|
3
|
-
"@babel/helpers - typeof";
|
|
4
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
5
|
-
return typeof o;
|
|
6
|
-
} : function(o) {
|
|
7
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
8
|
-
}, _typeof(o);
|
|
9
|
-
}
|
|
10
|
-
//#endregion
|
|
11
|
-
export { _typeof };
|