@layerzerolabs/lz-core 2.1.24 → 2.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/CHANGELOG.md +30 -0
- package/dist/index.cjs +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +12 -9
- package/dist/index.d.ts +12 -9
- package/dist/index.mjs +4 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @layerzerolabs/lz-core
|
|
2
2
|
|
|
3
|
+
## 2.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b04320e: empty version
|
|
8
|
+
|
|
9
|
+
## 2.2.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- fb15753: new endpoints. 4 testnets xlayer, form, ll1, mantasep, 2 mainnet Merlin, Degen
|
|
14
|
+
|
|
15
|
+
## 2.2.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- aa51c78: updated sandbox chain keys for frontend
|
|
20
|
+
|
|
21
|
+
## 2.1.27
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 099e19b: internalize common functions and add public onlyOwner passthroughs
|
|
26
|
+
|
|
27
|
+
## 2.1.25
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- 57fe209: wire ulnv2 during snapshot build
|
|
32
|
+
|
|
3
33
|
## 2.1.24
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -66,16 +66,17 @@ var TransactionPending = class _TransactionPending {
|
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
// src/signer.ts
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
function isConnectable(obj) {
|
|
70
|
+
return typeof obj.connect === "function" && obj.connect.length === 1;
|
|
71
|
+
}
|
|
71
72
|
|
|
72
73
|
exports.Block = Block;
|
|
73
74
|
exports.BlockWithTransactions = BlockWithTransactions;
|
|
74
75
|
exports.SignedTransaction = SignedTransaction;
|
|
75
|
-
exports.Signer = Signer;
|
|
76
76
|
exports.TransactionPending = TransactionPending;
|
|
77
77
|
exports.TransactionReceipt = TransactionReceipt;
|
|
78
78
|
exports.TransactionRequest = TransactionRequest;
|
|
79
79
|
exports.TransactionResponse = TransactionResponse;
|
|
80
|
+
exports.isConnectable = isConnectable;
|
|
80
81
|
//# sourceMappingURL=out.js.map
|
|
81
82
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/transaction.ts","../src/signer.ts"],"names":[],"mappings":";AAmBO,IAAM,QAAN,MAAM,OAAM;AAAA,EAEP,YAAmB,OAAgB;AAAhB;AAD3B,SAAS,OAAO;AAAA,EAC4B;AAAA,EAC5C,OAAO,KAAQ,KAA2B;AACtC,WAAO,IAAI,OAAM,GAAG;AAAA,EACxB;AACJ;AAKO,IAAM,wBAAN,MAAM,uBAAsB;AAAA,EAEvB,YAAmB,OAAgB;AAAhB;AAD3B,SAAS,OAAO;AAAA,EAC4B;AAAA,EAC5C,OAAO,KAAQ,KAA2C;AACtD,WAAO,IAAI,uBAAsB,GAAG;AAAA,EACxC;AACJ;AAyBO,IAAM,qBAAN,MAAM,oBAAmB;AAAA,EAEpB,YAAmB,SAAkB;AAAlB;AAD3B,SAAS,OAAO;AAAA,EAC8B;AAAA,EAC9C,OAAO,KAAQ,KAAmE;AAC9E,WAAO,IAAI,oBAAmB,GAAG;AAAA,EACrC;AACJ;AAKO,IAAM,sBAAN,MAAM,qBAAoB;AAAA,EAErB,YAAmB,UAAmB;AAAnB;AAD3B,SAAS,OAAO;AAAA,EAC+B;AAAA,EAC/C,OAAO,KAAQ,KAAoE;AAC/E,WAAO,IAAI,q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M,qBAAoB;AAAA,EAErB,YAAmB,UAAmB;AAAnB;AAD3B,SAAS,OAAO;AAAA,EAC+B;AAAA,EAC/C,OAAO,KAAQ,KAAoE;AAC/E,WAAO,IAAI,qBAAoB,GAAG;AAAA,EACtC;AACJ;AAKO,IAAM,qBAAN,MAAM,oBAAmB;AAAA,EAEpB,YAAmB,SAAkB;AAAlB;AAD3B,SAAS,OAAO;AAAA,EAC8B;AAAA,EAC9C,OAAO,KAAQ,KAAmE;AAC9E,WAAO,IAAI,oBAAmB,GAAG;AAAA,EACrC;AACJ;AAKO,IAAM,oBAAN,MAAM,mBAAkB;AAAA,EAEnB,YAAmB,QAAiB;AAAjB;AAD3B,SAAS,OAAO;AAAA,EAC6B;AAAA,EAC7C,OAAO,KAAQ,KAAkE;AAC7E,WAAO,IAAI,mBAAkB,GAAG;AAAA,EACpC;AACJ;AAKO,IAAM,qBAAN,MAAM,oBAAmB;AAAA,EAEpB,YAAmB,SAAkB;AAAlB;AAD3B,SAAS,OAAO;AAAA,EAC8B;AAAA,EAC9C,OAAO,KAAQ,KAAmE;AAC9E,WAAO,IAAI,oBAAmB,GAAG;AAAA,EACrC;AACJ;;;AC7DO,SAAS,cAAiB,KAAiC;AAC9D,SAAO,OAAO,IAAI,YAAY,cAAc,IAAI,QAAQ,WAAW;AACvE","sourcesContent":["import { NonPromise } from './promise'\n\n/**\n * By declare a unique field `type` in each class, it ensure that the instance of one class can not\n * be assigned to a variable of another class. Furthermore, it also help to distinguish the type of\n * the instance at runtime.\n * By private the constructor, it ensure that the instance of the class can only be created by the\n * static method `from`, and which can enforce the type of the input parameter should not be a promise.\n * Finally, it will be helpful for the compiler to infer the type of the instance and avoid the mistake.\n */\n\n/**\n * TransactionHash represents a transaction hash.\n */\nexport type TransactionHash = string | number\n\n/**\n * Block represents a block.\n */\nexport class Block {\n readonly type = 'Block'\n private constructor(public block: unknown) {}\n static from<T>(raw: NonPromise<T>): Block {\n return new Block(raw)\n }\n}\n\n/**\n * BlockWithTransactions represents a block with transactions.\n */\nexport class BlockWithTransactions {\n readonly type = 'BlockWithTransactions'\n private constructor(public block: unknown) {}\n static from<T>(raw: NonPromise<T>): BlockWithTransactions {\n return new BlockWithTransactions(raw)\n }\n}\n\n/**\n * BlockTag represents a block tag.\n */\nexport type BlockTag = string | number\n\n/**\n * Finality represents the finality of a block.\n */\nexport type Finality = 'confirmed' | 'finalized'\n\n/**\n * A union type to represent all the possible types of a transaction.\n */\ntype TransactionTypes =\n | TransactionRequest\n | TransactionResponse\n | TransactionReceipt\n | SignedTransaction\n | TransactionPending\n\n/**\n * TransactionRequest represents the request of a transaction.\n */\nexport class TransactionRequest {\n readonly type = 'TransactionRequest'\n private constructor(public request: unknown) {}\n static from<T>(raw: Exclude<NonPromise<T>, TransactionTypes>): TransactionRequest {\n return new TransactionRequest(raw)\n }\n}\n\n/**\n * TransactionResponse represents the response of a transaction.\n */\nexport class TransactionResponse {\n readonly type = 'TransactionResponse'\n private constructor(public response: unknown) {}\n static from<T>(raw: Exclude<NonPromise<T>, TransactionTypes>): TransactionResponse {\n return new TransactionResponse(raw)\n }\n}\n\n/**\n * TransactionReceipt represents the receipt of a transaction.\n */\nexport class TransactionReceipt {\n readonly type = 'TransactionReceipt'\n private constructor(public receipt: unknown) {}\n static from<T>(raw: Exclude<NonPromise<T>, TransactionTypes>): TransactionReceipt {\n return new TransactionReceipt(raw)\n }\n}\n\n/**\n * SignedTransaction represents a signed transaction.\n */\nexport class SignedTransaction {\n readonly type = 'SignedTransaction'\n private constructor(public signed: unknown) {}\n static from<T>(raw: Exclude<NonPromise<T>, TransactionTypes>): SignedTransaction {\n return new SignedTransaction(raw)\n }\n}\n\n/**\n * TransactionPending represents a pending transaction.\n */\nexport class TransactionPending {\n readonly type = 'TransactionPending'\n private constructor(public pending: unknown) {}\n static from<T>(raw: Exclude<NonPromise<T>, TransactionTypes>): TransactionPending {\n return new TransactionPending(raw)\n }\n}\n","import { Provider } from './provider'\nimport { SignedTransaction, TransactionPending, TransactionReceipt, TransactionRequest } from './transaction'\n\nexport interface Signer {\n /**\n * Connect to a provider\n * @param provider\n */\n connect(provider: Provider): Signer\n\n /**\n * Sign a transaction\n * @param transaction\n */\n signTransaction(transaction: TransactionRequest): Promise<SignedTransaction>\n\n /**\n * Send a transaction\n * @param transaction\n * @param sendOptions\n */\n sendTransaction(transaction: SignedTransaction, sendOptions?: any): Promise<TransactionPending>\n\n /**\n * Send a transaction and wait for confirmation\n * @param transaction\n * @param opts\n */\n sendAndConfirm(transaction: SignedTransaction, opts?: any): Promise<TransactionReceipt>\n\n /**\n * Sign a buffer (e.g. a message hash)\n */\n signBuffer(buffer: Uint8Array): Promise<Uint8Array>\n\n /**\n * returns the address of the signer\n */\n getAddress(): Promise<string>\n\n /**\n * Native signer object\n */\n native: unknown\n}\n\nexport interface Connectable<T> {\n connect<U>(provider: U): T\n}\n\nexport function isConnectable<T>(obj: any): obj is Connectable<T> {\n return typeof obj.connect === 'function' && obj.connect.length === 1\n}\n"]}
|
package/dist/index.d.mts
CHANGED
|
@@ -149,44 +149,47 @@ interface Provider {
|
|
|
149
149
|
*/
|
|
150
150
|
sendAndConfirm(transaction: SignedTransaction, opts?: any): Promise<TransactionReceipt>;
|
|
151
151
|
readonly native: unknown;
|
|
152
|
-
connectedTo<T>(item: T): T;
|
|
153
152
|
}
|
|
154
153
|
|
|
155
|
-
|
|
154
|
+
interface Signer {
|
|
156
155
|
/**
|
|
157
156
|
* Connect to a provider
|
|
158
157
|
* @param provider
|
|
159
158
|
*/
|
|
160
|
-
|
|
159
|
+
connect(provider: Provider): Signer;
|
|
161
160
|
/**
|
|
162
161
|
* Sign a transaction
|
|
163
162
|
* @param transaction
|
|
164
163
|
*/
|
|
165
|
-
|
|
164
|
+
signTransaction(transaction: TransactionRequest): Promise<SignedTransaction>;
|
|
166
165
|
/**
|
|
167
166
|
* Send a transaction
|
|
168
167
|
* @param transaction
|
|
169
168
|
* @param sendOptions
|
|
170
169
|
*/
|
|
171
|
-
|
|
170
|
+
sendTransaction(transaction: SignedTransaction, sendOptions?: any): Promise<TransactionPending>;
|
|
172
171
|
/**
|
|
173
172
|
* Send a transaction and wait for confirmation
|
|
174
173
|
* @param transaction
|
|
175
174
|
* @param opts
|
|
176
175
|
*/
|
|
177
|
-
|
|
176
|
+
sendAndConfirm(transaction: SignedTransaction, opts?: any): Promise<TransactionReceipt>;
|
|
178
177
|
/**
|
|
179
178
|
* Sign a buffer (e.g. a message hash)
|
|
180
179
|
*/
|
|
181
|
-
|
|
180
|
+
signBuffer(buffer: Uint8Array): Promise<Uint8Array>;
|
|
182
181
|
/**
|
|
183
182
|
* returns the address of the signer
|
|
184
183
|
*/
|
|
185
|
-
|
|
184
|
+
getAddress(): Promise<string>;
|
|
186
185
|
/**
|
|
187
186
|
* Native signer object
|
|
188
187
|
*/
|
|
189
188
|
native: unknown;
|
|
190
189
|
}
|
|
190
|
+
interface Connectable<T> {
|
|
191
|
+
connect<U>(provider: U): T;
|
|
192
|
+
}
|
|
193
|
+
declare function isConnectable<T>(obj: any): obj is Connectable<T>;
|
|
191
194
|
|
|
192
|
-
export { Block, type BlockTag, BlockWithTransactions, type Finality, type Provider, SignedTransaction, Signer, type TransactionHash, TransactionPending, TransactionReceipt, TransactionRequest, TransactionResponse };
|
|
195
|
+
export { Block, type BlockTag, BlockWithTransactions, type Connectable, type Finality, type Provider, SignedTransaction, type Signer, type TransactionHash, TransactionPending, TransactionReceipt, TransactionRequest, TransactionResponse, isConnectable };
|
package/dist/index.d.ts
CHANGED
|
@@ -149,44 +149,47 @@ interface Provider {
|
|
|
149
149
|
*/
|
|
150
150
|
sendAndConfirm(transaction: SignedTransaction, opts?: any): Promise<TransactionReceipt>;
|
|
151
151
|
readonly native: unknown;
|
|
152
|
-
connectedTo<T>(item: T): T;
|
|
153
152
|
}
|
|
154
153
|
|
|
155
|
-
|
|
154
|
+
interface Signer {
|
|
156
155
|
/**
|
|
157
156
|
* Connect to a provider
|
|
158
157
|
* @param provider
|
|
159
158
|
*/
|
|
160
|
-
|
|
159
|
+
connect(provider: Provider): Signer;
|
|
161
160
|
/**
|
|
162
161
|
* Sign a transaction
|
|
163
162
|
* @param transaction
|
|
164
163
|
*/
|
|
165
|
-
|
|
164
|
+
signTransaction(transaction: TransactionRequest): Promise<SignedTransaction>;
|
|
166
165
|
/**
|
|
167
166
|
* Send a transaction
|
|
168
167
|
* @param transaction
|
|
169
168
|
* @param sendOptions
|
|
170
169
|
*/
|
|
171
|
-
|
|
170
|
+
sendTransaction(transaction: SignedTransaction, sendOptions?: any): Promise<TransactionPending>;
|
|
172
171
|
/**
|
|
173
172
|
* Send a transaction and wait for confirmation
|
|
174
173
|
* @param transaction
|
|
175
174
|
* @param opts
|
|
176
175
|
*/
|
|
177
|
-
|
|
176
|
+
sendAndConfirm(transaction: SignedTransaction, opts?: any): Promise<TransactionReceipt>;
|
|
178
177
|
/**
|
|
179
178
|
* Sign a buffer (e.g. a message hash)
|
|
180
179
|
*/
|
|
181
|
-
|
|
180
|
+
signBuffer(buffer: Uint8Array): Promise<Uint8Array>;
|
|
182
181
|
/**
|
|
183
182
|
* returns the address of the signer
|
|
184
183
|
*/
|
|
185
|
-
|
|
184
|
+
getAddress(): Promise<string>;
|
|
186
185
|
/**
|
|
187
186
|
* Native signer object
|
|
188
187
|
*/
|
|
189
188
|
native: unknown;
|
|
190
189
|
}
|
|
190
|
+
interface Connectable<T> {
|
|
191
|
+
connect<U>(provider: U): T;
|
|
192
|
+
}
|
|
193
|
+
declare function isConnectable<T>(obj: any): obj is Connectable<T>;
|
|
191
194
|
|
|
192
|
-
export { Block, type BlockTag, BlockWithTransactions, type Finality, type Provider, SignedTransaction, Signer, type TransactionHash, TransactionPending, TransactionReceipt, TransactionRequest, TransactionResponse };
|
|
195
|
+
export { Block, type BlockTag, BlockWithTransactions, type Connectable, type Finality, type Provider, SignedTransaction, type Signer, type TransactionHash, TransactionPending, TransactionReceipt, TransactionRequest, TransactionResponse, isConnectable };
|
package/dist/index.mjs
CHANGED
|
@@ -64,9 +64,10 @@ var TransactionPending = class _TransactionPending {
|
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
// src/signer.ts
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
function isConnectable(obj) {
|
|
68
|
+
return typeof obj.connect === "function" && obj.connect.length === 1;
|
|
69
|
+
}
|
|
69
70
|
|
|
70
|
-
export { Block, BlockWithTransactions, SignedTransaction,
|
|
71
|
+
export { Block, BlockWithTransactions, SignedTransaction, TransactionPending, TransactionReceipt, TransactionRequest, TransactionResponse, isConnectable };
|
|
71
72
|
//# sourceMappingURL=out.js.map
|
|
72
73
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/transaction.ts","../src/signer.ts"],"names":[],"mappings":";AAmBO,IAAM,QAAN,MAAM,OAAM;AAAA,EAEP,YAAmB,OAAgB;AAAhB;AAD3B,SAAS,OAAO;AAAA,EAC4B;AAAA,EAC5C,OAAO,KAAQ,KAA2B;AACtC,WAAO,IAAI,OAAM,GAAG;AAAA,EACxB;AACJ;AAKO,IAAM,wBAAN,MAAM,uBAAsB;AAAA,EAEvB,YAAmB,OAAgB;AAAhB;AAD3B,SAAS,OAAO;AAAA,EAC4B;AAAA,EAC5C,OAAO,KAAQ,KAA2C;AACtD,WAAO,IAAI,uBAAsB,GAAG;AAAA,EACxC;AACJ;AAyBO,IAAM,qBAAN,MAAM,oBAAmB;AAAA,EAEpB,YAAmB,SAAkB;AAAlB;AAD3B,SAAS,OAAO;AAAA,EAC8B;AAAA,EAC9C,OAAO,KAAQ,KAAmE;AAC9E,WAAO,IAAI,oBAAmB,GAAG;AAAA,EACrC;AACJ;AAKO,IAAM,sBAAN,MAAM,qBAAoB;AAAA,EAErB,YAAmB,UAAmB;AAAnB;AAD3B,SAAS,OAAO;AAAA,EAC+B;AAAA,EAC/C,OAAO,KAAQ,KAAoE;AAC/E,WAAO,IAAI,qBAAoB,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oB;AAAA,EAErB,YAAmB,UAAmB;AAAnB;AAD3B,SAAS,OAAO;AAAA,EAC+B;AAAA,EAC/C,OAAO,KAAQ,KAAoE;AAC/E,WAAO,IAAI,qBAAoB,GAAG;AAAA,EACtC;AACJ;AAKO,IAAM,qBAAN,MAAM,oBAAmB;AAAA,EAEpB,YAAmB,SAAkB;AAAlB;AAD3B,SAAS,OAAO;AAAA,EAC8B;AAAA,EAC9C,OAAO,KAAQ,KAAmE;AAC9E,WAAO,IAAI,oBAAmB,GAAG;AAAA,EACrC;AACJ;AAKO,IAAM,oBAAN,MAAM,mBAAkB;AAAA,EAEnB,YAAmB,QAAiB;AAAjB;AAD3B,SAAS,OAAO;AAAA,EAC6B;AAAA,EAC7C,OAAO,KAAQ,KAAkE;AAC7E,WAAO,IAAI,mBAAkB,GAAG;AAAA,EACpC;AACJ;AAKO,IAAM,qBAAN,MAAM,oBAAmB;AAAA,EAEpB,YAAmB,SAAkB;AAAlB;AAD3B,SAAS,OAAO;AAAA,EAC8B;AAAA,EAC9C,OAAO,KAAQ,KAAmE;AAC9E,WAAO,IAAI,oBAAmB,GAAG;AAAA,EACrC;AACJ;;;AC7DO,SAAS,cAAiB,KAAiC;AAC9D,SAAO,OAAO,IAAI,YAAY,cAAc,IAAI,QAAQ,WAAW;AACvE","sourcesContent":["import { NonPromise } from './promise'\n\n/**\n * By declare a unique field `type` in each class, it ensure that the instance of one class can not\n * be assigned to a variable of another class. Furthermore, it also help to distinguish the type of\n * the instance at runtime.\n * By private the constructor, it ensure that the instance of the class can only be created by the\n * static method `from`, and which can enforce the type of the input parameter should not be a promise.\n * Finally, it will be helpful for the compiler to infer the type of the instance and avoid the mistake.\n */\n\n/**\n * TransactionHash represents a transaction hash.\n */\nexport type TransactionHash = string | number\n\n/**\n * Block represents a block.\n */\nexport class Block {\n readonly type = 'Block'\n private constructor(public block: unknown) {}\n static from<T>(raw: NonPromise<T>): Block {\n return new Block(raw)\n }\n}\n\n/**\n * BlockWithTransactions represents a block with transactions.\n */\nexport class BlockWithTransactions {\n readonly type = 'BlockWithTransactions'\n private constructor(public block: unknown) {}\n static from<T>(raw: NonPromise<T>): BlockWithTransactions {\n return new BlockWithTransactions(raw)\n }\n}\n\n/**\n * BlockTag represents a block tag.\n */\nexport type BlockTag = string | number\n\n/**\n * Finality represents the finality of a block.\n */\nexport type Finality = 'confirmed' | 'finalized'\n\n/**\n * A union type to represent all the possible types of a transaction.\n */\ntype TransactionTypes =\n | TransactionRequest\n | TransactionResponse\n | TransactionReceipt\n | SignedTransaction\n | TransactionPending\n\n/**\n * TransactionRequest represents the request of a transaction.\n */\nexport class TransactionRequest {\n readonly type = 'TransactionRequest'\n private constructor(public request: unknown) {}\n static from<T>(raw: Exclude<NonPromise<T>, TransactionTypes>): TransactionRequest {\n return new TransactionRequest(raw)\n }\n}\n\n/**\n * TransactionResponse represents the response of a transaction.\n */\nexport class TransactionResponse {\n readonly type = 'TransactionResponse'\n private constructor(public response: unknown) {}\n static from<T>(raw: Exclude<NonPromise<T>, TransactionTypes>): TransactionResponse {\n return new TransactionResponse(raw)\n }\n}\n\n/**\n * TransactionReceipt represents the receipt of a transaction.\n */\nexport class TransactionReceipt {\n readonly type = 'TransactionReceipt'\n private constructor(public receipt: unknown) {}\n static from<T>(raw: Exclude<NonPromise<T>, TransactionTypes>): TransactionReceipt {\n return new TransactionReceipt(raw)\n }\n}\n\n/**\n * SignedTransaction represents a signed transaction.\n */\nexport class SignedTransaction {\n readonly type = 'SignedTransaction'\n private constructor(public signed: unknown) {}\n static from<T>(raw: Exclude<NonPromise<T>, TransactionTypes>): SignedTransaction {\n return new SignedTransaction(raw)\n }\n}\n\n/**\n * TransactionPending represents a pending transaction.\n */\nexport class TransactionPending {\n readonly type = 'TransactionPending'\n private constructor(public pending: unknown) {}\n static from<T>(raw: Exclude<NonPromise<T>, TransactionTypes>): TransactionPending {\n return new TransactionPending(raw)\n }\n}\n","import { Provider } from './provider'\nimport { SignedTransaction, TransactionPending, TransactionReceipt, TransactionRequest } from './transaction'\n\nexport interface Signer {\n /**\n * Connect to a provider\n * @param provider\n */\n connect(provider: Provider): Signer\n\n /**\n * Sign a transaction\n * @param transaction\n */\n signTransaction(transaction: TransactionRequest): Promise<SignedTransaction>\n\n /**\n * Send a transaction\n * @param transaction\n * @param sendOptions\n */\n sendTransaction(transaction: SignedTransaction, sendOptions?: any): Promise<TransactionPending>\n\n /**\n * Send a transaction and wait for confirmation\n * @param transaction\n * @param opts\n */\n sendAndConfirm(transaction: SignedTransaction, opts?: any): Promise<TransactionReceipt>\n\n /**\n * Sign a buffer (e.g. a message hash)\n */\n signBuffer(buffer: Uint8Array): Promise<Uint8Array>\n\n /**\n * returns the address of the signer\n */\n getAddress(): Promise<string>\n\n /**\n * Native signer object\n */\n native: unknown\n}\n\nexport interface Connectable<T> {\n connect<U>(provider: U): T\n}\n\nexport function isConnectable<T>(obj: any): obj is Connectable<T> {\n return typeof obj.connect === 'function' && obj.connect.length === 1\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layerzerolabs/lz-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "LayerZero Core Library",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"exports": {
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@jest/globals": "^29.7.0",
|
|
30
|
-
"@layerzerolabs/tsup-config-next": "^2.
|
|
31
|
-
"@layerzerolabs/typescript-config-next": "^2.
|
|
30
|
+
"@layerzerolabs/tsup-config-next": "^2.2.2",
|
|
31
|
+
"@layerzerolabs/typescript-config-next": "^2.2.2",
|
|
32
32
|
"@types/jest": "^29.5.10",
|
|
33
33
|
"jest": "^29.7.0",
|
|
34
34
|
"rimraf": "^5.0.5",
|