@orb-labs/orby-core 0.0.15 → 0.0.16
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/CHANGELOG.md +5 -0
- package/dist/cjs/actions/operation.d.ts +2 -2
- package/dist/cjs/actions/operation.js +74 -4
- package/dist/cjs/entities/account.js +1 -1
- package/dist/cjs/interfaces/operation.d.ts +2 -2
- package/dist/cjs/types.d.ts +20 -0
- package/dist/esm/actions/operation.d.ts +2 -2
- package/dist/esm/actions/operation.js +75 -5
- package/dist/esm/actions/token.js +1 -1
- package/dist/esm/entities/account.js +1 -1
- package/dist/esm/interfaces/operation.d.ts +2 -2
- package/dist/esm/types.d.ts +20 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/actions/account_cluster.d.ts +0 -32
- package/dist/actions/account_cluster.js +0 -207
- package/dist/actions/admin.d.ts +0 -17
- package/dist/actions/admin.js +0 -39
- package/dist/actions/application.d.ts +0 -6
- package/dist/actions/application.js +0 -16
- package/dist/actions/blockchain.d.ts +0 -16
- package/dist/actions/blockchain.js +0 -35
- package/dist/actions/instance.d.ts +0 -15
- package/dist/actions/instance.js +0 -94
- package/dist/actions/operation.d.ts +0 -99
- package/dist/actions/operation.js +0 -341
- package/dist/actions/token.d.ts +0 -15
- package/dist/actions/token.js +0 -46
- package/dist/constants.d.ts +0 -14
- package/dist/constants.js +0 -133
- package/dist/entities/account.d.ts +0 -14
- package/dist/entities/account.js +0 -45
- package/dist/entities/financial/account_balance.d.ts +0 -12
- package/dist/entities/financial/account_balance.js +0 -31
- package/dist/entities/financial/asset.d.ts +0 -31
- package/dist/entities/financial/asset.js +0 -38
- package/dist/entities/financial/currency.d.ts +0 -41
- package/dist/entities/financial/currency.js +0 -49
- package/dist/entities/financial/currency_amount.d.ts +0 -34
- package/dist/entities/financial/currency_amount.js +0 -92
- package/dist/entities/financial/fungible_token.d.ts +0 -41
- package/dist/entities/financial/fungible_token.js +0 -64
- package/dist/entities/financial/fungible_token_amount.d.ts +0 -36
- package/dist/entities/financial/fungible_token_amount.js +0 -95
- package/dist/entities/financial/non_fungible_token.d.ts +0 -39
- package/dist/entities/financial/non_fungible_token.js +0 -61
- package/dist/entities/financial/semi_fungible_token.d.ts +0 -41
- package/dist/entities/financial/semi_fungible_token.js +0 -63
- package/dist/entities/library_request.d.ts +0 -8
- package/dist/entities/library_request.js +0 -30
- package/dist/entities/state.d.ts +0 -22
- package/dist/entities/state.js +0 -102
- package/dist/enums.d.ts +0 -116
- package/dist/enums.js +0 -135
- package/dist/index.d.ts +0 -29
- package/dist/index.js +0 -33
- package/dist/interfaces/account_cluster.d.ts +0 -30
- package/dist/interfaces/account_cluster.js +0 -1
- package/dist/interfaces/admin.d.ts +0 -14
- package/dist/interfaces/admin.js +0 -1
- package/dist/interfaces/application.d.ts +0 -3
- package/dist/interfaces/application.js +0 -1
- package/dist/interfaces/blockchain.d.ts +0 -13
- package/dist/interfaces/blockchain.js +0 -1
- package/dist/interfaces/instance.d.ts +0 -12
- package/dist/interfaces/instance.js +0 -1
- package/dist/interfaces/operation.d.ts +0 -97
- package/dist/interfaces/operation.js +0 -1
- package/dist/interfaces/orby.d.ts +0 -9
- package/dist/interfaces/orby.js +0 -1
- package/dist/interfaces/token.d.ts +0 -12
- package/dist/interfaces/token.js +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/types.d.ts +0 -152
- package/dist/types.js +0 -1
- package/dist/utils/action_helpers.d.ts +0 -22
- package/dist/utils/action_helpers.js +0 -250
- package/dist/utils/utils.d.ts +0 -10
- package/dist/utils/utils.js +0 -70
- package/dist/utils/validateAndParseAddress.d.ts +0 -10
- package/dist/utils/validateAndParseAddress.js +0 -25
package/CHANGELOG.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { OnchainOperation, OperationSet, OperationStatus, SignedOperation } from "../types.js";
|
1
|
+
import { AccountCluster, OnchainOperation, OperationSet, OperationStatus, SignedOperation, UserOperation } from "../types.js";
|
2
2
|
import { CurrencyAmount } from "../entities/financial/currency_amount.js";
|
3
3
|
import { LIBRARY_TYPE, OperationStatusType, QuoteType } from "../enums.js";
|
4
4
|
import { LibraryRequest } from "../entities/library_request.js";
|
@@ -90,7 +90,7 @@ export declare class OperationActions extends LibraryRequest {
|
|
90
90
|
subscribeToOperationStatuses(ids?: string[], onOperationStatusesUpdateCallback?: (statusSummary: OperationStatusType, primaryOperationStatus?: OperationStatus, allOperationStatuses?: OperationStatus[]) => void, timout?: number): {
|
91
91
|
intervalId: NodeJS.Timeout | null;
|
92
92
|
};
|
93
|
-
sendOperationSet(
|
93
|
+
sendOperationSet(accountCluster: AccountCluster, operationSet: OperationSet, signTransaction: (operation: OnchainOperation) => Promise<string | undefined>, signUserOperation: (operations: OnchainOperation[], accountAddress: string, chainId: bigint, txRpcUrl: string) => Promise<UserOperation | undefined>, signTypedData: (operation: OnchainOperation) => Promise<string | undefined>): Promise<{
|
94
94
|
success: boolean;
|
95
95
|
operationSetId?: string;
|
96
96
|
primaryOperationStatus?: OperationStatus;
|
@@ -6,6 +6,11 @@ const currency_amount_js_1 = require("../entities/financial/currency_amount.js")
|
|
6
6
|
const enums_js_1 = require("../enums.js");
|
7
7
|
const library_request_js_1 = require("../entities/library_request.js");
|
8
8
|
const utils_js_1 = require("../utils/utils.js");
|
9
|
+
const account_js_1 = require("../entities/account.js");
|
10
|
+
// from here: https://stackoverflow.com/questions/65152373/typescript-serialize-bigint-in-json
|
11
|
+
BigInt.prototype.toJSON = function () {
|
12
|
+
return this.toString();
|
13
|
+
};
|
9
14
|
class OperationActions extends library_request_js_1.LibraryRequest {
|
10
15
|
constructor(library, client, provider) {
|
11
16
|
super(library, client, provider);
|
@@ -305,7 +310,7 @@ class OperationActions extends library_request_js_1.LibraryRequest {
|
|
305
310
|
}
|
306
311
|
return { intervalId };
|
307
312
|
}
|
308
|
-
async sendOperationSet(
|
313
|
+
async sendOperationSet(accountCluster, operationSet, signTransaction, signUserOperation, signTypedData) {
|
309
314
|
const signedOperations = [];
|
310
315
|
const operations = operationSet.intents
|
311
316
|
?.map((intent) => intent.intentOperations)
|
@@ -322,15 +327,80 @@ class OperationActions extends library_request_js_1.LibraryRequest {
|
|
322
327
|
if (!hasPrimaryOperation) {
|
323
328
|
return { success: false };
|
324
329
|
}
|
330
|
+
const accountsMap = accountCluster.accounts.reduce((acc, account) => {
|
331
|
+
acc.set(account.key, account);
|
332
|
+
return acc;
|
333
|
+
}, new Map());
|
334
|
+
const smartAccountTransactions = operations.reduce((acc, operation) => {
|
335
|
+
const accountKey = account_js_1.Account.key(operation.from, operation.chainId);
|
336
|
+
const account = accountsMap.get(accountKey);
|
337
|
+
if (account?.accountType == enums_js_1.AccountType.SCA &&
|
338
|
+
operation.format == enums_js_1.OperationDataFormat.TRANSACTION) {
|
339
|
+
if (!acc.has(accountKey)) {
|
340
|
+
acc.set(accountKey, []);
|
341
|
+
}
|
342
|
+
acc.get(accountKey).push(operation);
|
343
|
+
}
|
344
|
+
return acc;
|
345
|
+
}, new Map());
|
325
346
|
// Loop through all the operations and sign them
|
326
347
|
for (let i = 0; i < operations.length; i++) {
|
327
|
-
const
|
348
|
+
const operation = operations[i];
|
349
|
+
let signature;
|
350
|
+
if (operation.format == enums_js_1.OperationDataFormat.TRANSACTION) {
|
351
|
+
const accountKey = account_js_1.Account.key(operation.from, operation.chainId);
|
352
|
+
const account = accountsMap.get(accountKey);
|
353
|
+
// skip signing the transaction if the account is an SCA
|
354
|
+
if (account?.accountType == enums_js_1.AccountType.SCA) {
|
355
|
+
continue;
|
356
|
+
}
|
357
|
+
signature = await signTransaction(operation);
|
358
|
+
}
|
359
|
+
else if (operation.format == enums_js_1.OperationDataFormat.TYPED_DATA) {
|
360
|
+
signature = await signTypedData(operation);
|
361
|
+
}
|
328
362
|
if (!signature) {
|
329
363
|
return { success: false };
|
330
364
|
}
|
331
|
-
signedOperations.push(
|
365
|
+
signedOperations.push({
|
366
|
+
type: operation.type,
|
367
|
+
signature: signature,
|
368
|
+
data: operation.data,
|
369
|
+
from: operation.from,
|
370
|
+
chainId: (0, utils_js_1.getOrbyChainId)(operation.chainId),
|
371
|
+
});
|
372
|
+
}
|
373
|
+
// batch sign all the smart contract transactions
|
374
|
+
const accountKeys = Array.from(smartAccountTransactions.keys());
|
375
|
+
for (const accountKey of accountKeys) {
|
376
|
+
const transactions = smartAccountTransactions.get(accountKey);
|
377
|
+
transactions.sort((operationA, _) => {
|
378
|
+
if (operationA.type == enums_js_1.OperationType.APPROVE_ERC20_TOKEN) {
|
379
|
+
return -1;
|
380
|
+
}
|
381
|
+
return 0;
|
382
|
+
});
|
383
|
+
const userOperation = await signUserOperation(transactions, transactions[0].from, transactions[0].chainId, transactions[0].txRpcUrl);
|
384
|
+
if (!userOperation) {
|
385
|
+
return { success: false };
|
386
|
+
}
|
387
|
+
const types = transactions.map((operation) => operation.type);
|
388
|
+
let type = types[0];
|
389
|
+
if (types.includes(enums_js_1.OperationType.FINAL_TRANSACTION)) {
|
390
|
+
type = enums_js_1.OperationType.FINAL_TRANSACTION;
|
391
|
+
}
|
392
|
+
else if (types.includes(enums_js_1.OperationType.SUBMIT_INTENT)) {
|
393
|
+
type = enums_js_1.OperationType.SUBMIT_INTENT;
|
394
|
+
}
|
395
|
+
signedOperations.push({
|
396
|
+
type,
|
397
|
+
signature: userOperation.signature,
|
398
|
+
data: JSON.stringify(userOperation),
|
399
|
+
from: transactions[0].from,
|
400
|
+
chainId: (0, utils_js_1.getOrbyChainId)(transactions[0].chainId),
|
401
|
+
});
|
332
402
|
}
|
333
|
-
const { operationSetId, operationResponses } = await this.sendSignedOperations(accountClusterId, signedOperations);
|
403
|
+
const { operationSetId, operationResponses } = await this.sendSignedOperations(accountCluster.accountClusterId, signedOperations);
|
334
404
|
return {
|
335
405
|
operationSetId,
|
336
406
|
operationResponses,
|
@@ -8,7 +8,7 @@ class Account {
|
|
8
8
|
const chainId = account?.chainId
|
9
9
|
? (0, utils_js_1.getChainIdFromOrbyChainId)(account.chainId)
|
10
10
|
: undefined;
|
11
|
-
const formattedAccountType = account?.accountType
|
11
|
+
const formattedAccountType = account?.accountType;
|
12
12
|
if (!chainId && formattedAccountType == enums_js_1.AccountType.SCA) {
|
13
13
|
return undefined;
|
14
14
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { OnchainOperation, OperationSet, OperationStatus, SignedOperation } from "../types.js";
|
1
|
+
import { AccountCluster, OnchainOperation, OperationSet, OperationStatus, SignedOperation, UserOperation } from "../types.js";
|
2
2
|
import { CurrencyAmount } from "../entities/financial/currency_amount.js";
|
3
3
|
import { OperationStatusType, QuoteType } from "../enums.js";
|
4
4
|
export interface IOperationActions {
|
@@ -88,7 +88,7 @@ export interface IOperationActions {
|
|
88
88
|
subscribeToOperationStatuses(ids?: string[], onOperationStatusesUpdateCallback?: (statusSummary: OperationStatusType, primaryOperationStatus?: OperationStatus, allOperationStatuses?: OperationStatus[]) => void, timout?: number): {
|
89
89
|
intervalId: NodeJS.Timeout | null;
|
90
90
|
};
|
91
|
-
sendOperationSet(
|
91
|
+
sendOperationSet(accountCluster: AccountCluster, operationSet: OperationSet, signTransaction: (operation: OnchainOperation) => Promise<string | undefined>, signUserOperation: (operations: OnchainOperation[], accountAddress: string, chainId: bigint, txRpcUrl: string) => Promise<UserOperation | undefined>, signTypedData: (operation: OnchainOperation) => Promise<string | undefined>): Promise<{
|
92
92
|
success: boolean;
|
93
93
|
operationSetId?: string;
|
94
94
|
primaryOperationStatus?: OperationStatus;
|
package/dist/cjs/types.d.ts
CHANGED
@@ -32,6 +32,24 @@ export type Intent = {
|
|
32
32
|
intentOperations?: OnchainOperation[];
|
33
33
|
outputState?: State;
|
34
34
|
};
|
35
|
+
export type UserOperation = {
|
36
|
+
sender: string;
|
37
|
+
nonce: string;
|
38
|
+
factory: string;
|
39
|
+
factoryData: string;
|
40
|
+
callData: string;
|
41
|
+
callGasLimit: string;
|
42
|
+
verificationGasLimit: string;
|
43
|
+
preVerificationGas: string;
|
44
|
+
maxFeePerGas: string;
|
45
|
+
maxPriorityFeePerGas: string;
|
46
|
+
paymasterVerificationGasLimit: string;
|
47
|
+
paymasterPostOpGasLimit: string;
|
48
|
+
signature: string;
|
49
|
+
paymaster: string;
|
50
|
+
paymasterData: string;
|
51
|
+
entrypoint: string;
|
52
|
+
};
|
35
53
|
export interface OnchainOperation {
|
36
54
|
chainId: bigint;
|
37
55
|
data: string;
|
@@ -58,6 +76,8 @@ export type SignedOperation = {
|
|
58
76
|
signature: string;
|
59
77
|
category?: Category;
|
60
78
|
data?: string;
|
79
|
+
from?: string;
|
80
|
+
chainId?: string;
|
61
81
|
};
|
62
82
|
export type OperationStatus = {
|
63
83
|
blockHash?: string;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { OnchainOperation, OperationSet, OperationStatus, SignedOperation } from "../types.js";
|
1
|
+
import { AccountCluster, OnchainOperation, OperationSet, OperationStatus, SignedOperation, UserOperation } from "../types.js";
|
2
2
|
import { CurrencyAmount } from "../entities/financial/currency_amount.js";
|
3
3
|
import { LIBRARY_TYPE, OperationStatusType, QuoteType } from "../enums.js";
|
4
4
|
import { LibraryRequest } from "../entities/library_request.js";
|
@@ -90,7 +90,7 @@ export declare class OperationActions extends LibraryRequest {
|
|
90
90
|
subscribeToOperationStatuses(ids?: string[], onOperationStatusesUpdateCallback?: (statusSummary: OperationStatusType, primaryOperationStatus?: OperationStatus, allOperationStatuses?: OperationStatus[]) => void, timout?: number): {
|
91
91
|
intervalId: NodeJS.Timeout | null;
|
92
92
|
};
|
93
|
-
sendOperationSet(
|
93
|
+
sendOperationSet(accountCluster: AccountCluster, operationSet: OperationSet, signTransaction: (operation: OnchainOperation) => Promise<string | undefined>, signUserOperation: (operations: OnchainOperation[], accountAddress: string, chainId: bigint, txRpcUrl: string) => Promise<UserOperation | undefined>, signTypedData: (operation: OnchainOperation) => Promise<string | undefined>): Promise<{
|
94
94
|
success: boolean;
|
95
95
|
operationSetId?: string;
|
96
96
|
primaryOperationStatus?: OperationStatus;
|
@@ -1,8 +1,13 @@
|
|
1
1
|
import { extractOperationSet, extractOperationStatuses, } from "../utils/action_helpers.js";
|
2
2
|
import { CurrencyAmount } from "../entities/financial/currency_amount.js";
|
3
|
-
import { OperationStatusType, OperationType, } from "../enums.js";
|
3
|
+
import { AccountType, OperationDataFormat, OperationStatusType, OperationType, } from "../enums.js";
|
4
4
|
import { LibraryRequest } from "../entities/library_request.js";
|
5
5
|
import { getOrbyChainId } from "../utils/utils.js";
|
6
|
+
import { Account } from "../entities/account.js";
|
7
|
+
// from here: https://stackoverflow.com/questions/65152373/typescript-serialize-bigint-in-json
|
8
|
+
BigInt.prototype.toJSON = function () {
|
9
|
+
return this.toString();
|
10
|
+
};
|
6
11
|
export class OperationActions extends LibraryRequest {
|
7
12
|
constructor(library, client, provider) {
|
8
13
|
super(library, client, provider);
|
@@ -302,7 +307,7 @@ export class OperationActions extends LibraryRequest {
|
|
302
307
|
}
|
303
308
|
return { intervalId };
|
304
309
|
}
|
305
|
-
async sendOperationSet(
|
310
|
+
async sendOperationSet(accountCluster, operationSet, signTransaction, signUserOperation, signTypedData) {
|
306
311
|
const signedOperations = [];
|
307
312
|
const operations = operationSet.intents
|
308
313
|
?.map((intent) => intent.intentOperations)
|
@@ -319,15 +324,80 @@ export class OperationActions extends LibraryRequest {
|
|
319
324
|
if (!hasPrimaryOperation) {
|
320
325
|
return { success: false };
|
321
326
|
}
|
327
|
+
const accountsMap = accountCluster.accounts.reduce((acc, account) => {
|
328
|
+
acc.set(account.key, account);
|
329
|
+
return acc;
|
330
|
+
}, new Map());
|
331
|
+
const smartAccountTransactions = operations.reduce((acc, operation) => {
|
332
|
+
const accountKey = Account.key(operation.from, operation.chainId);
|
333
|
+
const account = accountsMap.get(accountKey);
|
334
|
+
if (account?.accountType == AccountType.SCA &&
|
335
|
+
operation.format == OperationDataFormat.TRANSACTION) {
|
336
|
+
if (!acc.has(accountKey)) {
|
337
|
+
acc.set(accountKey, []);
|
338
|
+
}
|
339
|
+
acc.get(accountKey).push(operation);
|
340
|
+
}
|
341
|
+
return acc;
|
342
|
+
}, new Map());
|
322
343
|
// Loop through all the operations and sign them
|
323
344
|
for (let i = 0; i < operations.length; i++) {
|
324
|
-
const
|
345
|
+
const operation = operations[i];
|
346
|
+
let signature;
|
347
|
+
if (operation.format == OperationDataFormat.TRANSACTION) {
|
348
|
+
const accountKey = Account.key(operation.from, operation.chainId);
|
349
|
+
const account = accountsMap.get(accountKey);
|
350
|
+
// skip signing the transaction if the account is an SCA
|
351
|
+
if (account?.accountType == AccountType.SCA) {
|
352
|
+
continue;
|
353
|
+
}
|
354
|
+
signature = await signTransaction(operation);
|
355
|
+
}
|
356
|
+
else if (operation.format == OperationDataFormat.TYPED_DATA) {
|
357
|
+
signature = await signTypedData(operation);
|
358
|
+
}
|
325
359
|
if (!signature) {
|
326
360
|
return { success: false };
|
327
361
|
}
|
328
|
-
signedOperations.push(
|
362
|
+
signedOperations.push({
|
363
|
+
type: operation.type,
|
364
|
+
signature: signature,
|
365
|
+
data: operation.data,
|
366
|
+
from: operation.from,
|
367
|
+
chainId: getOrbyChainId(operation.chainId),
|
368
|
+
});
|
369
|
+
}
|
370
|
+
// batch sign all the smart contract transactions
|
371
|
+
const accountKeys = Array.from(smartAccountTransactions.keys());
|
372
|
+
for (const accountKey of accountKeys) {
|
373
|
+
const transactions = smartAccountTransactions.get(accountKey);
|
374
|
+
transactions.sort((operationA, _) => {
|
375
|
+
if (operationA.type == OperationType.APPROVE_ERC20_TOKEN) {
|
376
|
+
return -1;
|
377
|
+
}
|
378
|
+
return 0;
|
379
|
+
});
|
380
|
+
const userOperation = await signUserOperation(transactions, transactions[0].from, transactions[0].chainId, transactions[0].txRpcUrl);
|
381
|
+
if (!userOperation) {
|
382
|
+
return { success: false };
|
383
|
+
}
|
384
|
+
const types = transactions.map((operation) => operation.type);
|
385
|
+
let type = types[0];
|
386
|
+
if (types.includes(OperationType.FINAL_TRANSACTION)) {
|
387
|
+
type = OperationType.FINAL_TRANSACTION;
|
388
|
+
}
|
389
|
+
else if (types.includes(OperationType.SUBMIT_INTENT)) {
|
390
|
+
type = OperationType.SUBMIT_INTENT;
|
391
|
+
}
|
392
|
+
signedOperations.push({
|
393
|
+
type,
|
394
|
+
signature: userOperation.signature,
|
395
|
+
data: JSON.stringify(userOperation),
|
396
|
+
from: transactions[0].from,
|
397
|
+
chainId: getOrbyChainId(transactions[0].chainId),
|
398
|
+
});
|
329
399
|
}
|
330
|
-
const { operationSetId, operationResponses } = await this.sendSignedOperations(accountClusterId, signedOperations);
|
400
|
+
const { operationSetId, operationResponses } = await this.sendSignedOperations(accountCluster.accountClusterId, signedOperations);
|
331
401
|
return {
|
332
402
|
operationSetId,
|
333
403
|
operationResponses,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { extractStandardizedTokens
|
1
|
+
import { extractStandardizedTokens } from "../utils/action_helpers.js";
|
2
2
|
import { LibraryRequest } from "../entities/library_request.js";
|
3
3
|
import { getOrbyChainId } from "../utils/utils.js";
|
4
4
|
export class TokenActions extends LibraryRequest {
|
@@ -5,7 +5,7 @@ export class Account {
|
|
5
5
|
const chainId = account?.chainId
|
6
6
|
? getChainIdFromOrbyChainId(account.chainId)
|
7
7
|
: undefined;
|
8
|
-
const formattedAccountType = account?.accountType
|
8
|
+
const formattedAccountType = account?.accountType;
|
9
9
|
if (!chainId && formattedAccountType == AccountType.SCA) {
|
10
10
|
return undefined;
|
11
11
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { OnchainOperation, OperationSet, OperationStatus, SignedOperation } from "../types.js";
|
1
|
+
import { AccountCluster, OnchainOperation, OperationSet, OperationStatus, SignedOperation, UserOperation } from "../types.js";
|
2
2
|
import { CurrencyAmount } from "../entities/financial/currency_amount.js";
|
3
3
|
import { OperationStatusType, QuoteType } from "../enums.js";
|
4
4
|
export interface IOperationActions {
|
@@ -88,7 +88,7 @@ export interface IOperationActions {
|
|
88
88
|
subscribeToOperationStatuses(ids?: string[], onOperationStatusesUpdateCallback?: (statusSummary: OperationStatusType, primaryOperationStatus?: OperationStatus, allOperationStatuses?: OperationStatus[]) => void, timout?: number): {
|
89
89
|
intervalId: NodeJS.Timeout | null;
|
90
90
|
};
|
91
|
-
sendOperationSet(
|
91
|
+
sendOperationSet(accountCluster: AccountCluster, operationSet: OperationSet, signTransaction: (operation: OnchainOperation) => Promise<string | undefined>, signUserOperation: (operations: OnchainOperation[], accountAddress: string, chainId: bigint, txRpcUrl: string) => Promise<UserOperation | undefined>, signTypedData: (operation: OnchainOperation) => Promise<string | undefined>): Promise<{
|
92
92
|
success: boolean;
|
93
93
|
operationSetId?: string;
|
94
94
|
primaryOperationStatus?: OperationStatus;
|
package/dist/esm/types.d.ts
CHANGED
@@ -32,6 +32,24 @@ export type Intent = {
|
|
32
32
|
intentOperations?: OnchainOperation[];
|
33
33
|
outputState?: State;
|
34
34
|
};
|
35
|
+
export type UserOperation = {
|
36
|
+
sender: string;
|
37
|
+
nonce: string;
|
38
|
+
factory: string;
|
39
|
+
factoryData: string;
|
40
|
+
callData: string;
|
41
|
+
callGasLimit: string;
|
42
|
+
verificationGasLimit: string;
|
43
|
+
preVerificationGas: string;
|
44
|
+
maxFeePerGas: string;
|
45
|
+
maxPriorityFeePerGas: string;
|
46
|
+
paymasterVerificationGasLimit: string;
|
47
|
+
paymasterPostOpGasLimit: string;
|
48
|
+
signature: string;
|
49
|
+
paymaster: string;
|
50
|
+
paymasterData: string;
|
51
|
+
entrypoint: string;
|
52
|
+
};
|
35
53
|
export interface OnchainOperation {
|
36
54
|
chainId: bigint;
|
37
55
|
data: string;
|
@@ -58,6 +76,8 @@ export type SignedOperation = {
|
|
58
76
|
signature: string;
|
59
77
|
category?: Category;
|
60
78
|
data?: string;
|
79
|
+
from?: string;
|
80
|
+
chainId?: string;
|
61
81
|
};
|
62
82
|
export type OperationStatus = {
|
63
83
|
blockHash?: string;
|