@alephium/web3 0.40.0 → 0.41.0
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/alephium-web3.min.js +1 -1
- package/dist/alephium-web3.min.js.map +1 -1
- package/dist/src/api/node-provider.d.ts +2 -0
- package/dist/src/api/node-provider.js +12 -6
- package/dist/src/api/utils.d.ts +1 -1
- package/dist/src/block/block.d.ts +28 -0
- package/dist/src/block/block.js +131 -0
- package/dist/src/block/index.d.ts +1 -0
- package/dist/src/block/index.js +22 -0
- package/dist/src/codec/contract-output-codec.js +4 -4
- package/dist/src/codec/lockup-script-codec.js +2 -2
- package/dist/src/codec/method-codec.d.ts +3 -1
- package/dist/src/codec/method-codec.js +27 -2
- package/dist/src/codec/script-codec.d.ts +11 -6
- package/dist/src/codec/script-codec.js +13 -2
- package/dist/src/codec/transaction-codec.js +2 -2
- package/dist/src/codec/unlock-script-codec.d.ts +2 -2
- package/dist/src/codec/unsigned-tx-codec.d.ts +2 -2
- package/dist/src/contract/contract.d.ts +19 -10
- package/dist/src/contract/contract.js +103 -56
- package/dist/src/contract/events.d.ts +1 -2
- package/dist/src/contract/events.js +28 -14
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/signer/tx-builder.js +4 -4
- package/dist/src/transaction/status.js +28 -4
- package/dist/src/utils/address.js +29 -16
- package/dist/src/utils/exchange.js +25 -15
- package/dist/src/utils/number.d.ts +1 -1
- package/dist/src/utils/sign.js +6 -6
- package/dist/src/utils/subscription.d.ts +4 -4
- package/dist/src/utils/subscription.js +1 -1
- package/package.json +3 -3
- package/src/api/node-provider.ts +8 -1
- package/src/api/utils.ts +1 -1
- package/src/block/block.ts +139 -0
- package/src/block/index.ts +19 -0
- package/src/codec/contract-output-codec.ts +1 -1
- package/src/codec/lockup-script-codec.ts +3 -3
- package/src/codec/method-codec.ts +41 -3
- package/src/codec/script-codec.ts +23 -5
- package/src/codec/transaction-codec.ts +1 -1
- package/src/codec/unlock-script-codec.ts +2 -2
- package/src/codec/unsigned-tx-codec.ts +2 -2
- package/src/contract/contract.ts +139 -78
- package/src/contract/events.ts +6 -18
- package/src/index.ts +1 -0
- package/src/signer/tx-builder.ts +2 -2
- package/src/transaction/status.ts +4 -4
- package/src/utils/address.ts +15 -2
- package/src/utils/exchange.ts +32 -10
- package/src/utils/number.ts +1 -1
- package/src/utils/sign.ts +1 -1
- package/src/utils/subscription.ts +4 -4
- package/std/fungible_token_interface.ral +1 -0
- package/std/nft_collection_interface.ral +1 -0
- package/std/nft_collection_with_royalty_interface.ral +1 -0
- package/std/nft_interface.ral +1 -0
|
@@ -18,8 +18,8 @@ along with the library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
18
18
|
|
|
19
19
|
import EventEmitter from 'eventemitter3'
|
|
20
20
|
|
|
21
|
-
type MessageCallback<Message> = (message: Message) => Promise<void>
|
|
22
|
-
type ErrorCallback<Message> = (error: any, subscription: Subscription<Message>) => Promise<void>
|
|
21
|
+
type MessageCallback<Message> = (message: Message) => Promise<void> | void
|
|
22
|
+
type ErrorCallback<Message> = (error: any, subscription: Subscription<Message>) => Promise<void> | void
|
|
23
23
|
|
|
24
24
|
export interface SubscribeOptions<Message> {
|
|
25
25
|
pollingInterval: number
|
|
@@ -45,7 +45,7 @@ export abstract class Subscription<Message> {
|
|
|
45
45
|
this.eventEmitter = new EventEmitter()
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
subscribe(): void {
|
|
49
49
|
this.eventEmitter.on('tick', async () => {
|
|
50
50
|
await this.polling()
|
|
51
51
|
|
|
@@ -68,5 +68,5 @@ export abstract class Subscription<Message> {
|
|
|
68
68
|
return this.cancelled
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
abstract polling(): Promise<void>
|
|
71
|
+
protected abstract polling(): Promise<void>
|
|
72
72
|
}
|