@leofcoin/chain 1.7.94 → 1.7.95
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/exports/browser/chain.js +6 -0
- package/exports/chain.d.ts +2 -0
- package/exports/chain.js +6 -0
- package/package.json +1 -1
package/exports/browser/chain.js
CHANGED
|
@@ -6001,6 +6001,12 @@ class Chain extends VersionControl {
|
|
|
6001
6001
|
transfer(from, to, amount) {
|
|
6002
6002
|
return this.call(addresses.nativeToken, 'transfer', [from, to, amount]);
|
|
6003
6003
|
}
|
|
6004
|
+
BalanceOf(address) {
|
|
6005
|
+
return this.staticCall(addresses.nativeToken, 'balanceOf', [address]);
|
|
6006
|
+
}
|
|
6007
|
+
get Balance() {
|
|
6008
|
+
return this.staticCall(addresses.nativeToken, 'balanceOf', [globalThis.peernet.selectedAccount]);
|
|
6009
|
+
}
|
|
6004
6010
|
get balances() {
|
|
6005
6011
|
return this.staticCall(addresses.nativeToken, 'balances');
|
|
6006
6012
|
}
|
package/exports/chain.d.ts
CHANGED
|
@@ -50,6 +50,8 @@ export default class Chain extends VersionControl {
|
|
|
50
50
|
staticCall(contract: Address, method: string, parameters?: any[]): Promise<any>;
|
|
51
51
|
mint(to: Address, amount: bigint): Promise<any>;
|
|
52
52
|
transfer(from: Address, to: Address, amount: bigint): Promise<any>;
|
|
53
|
+
BalanceOf(address: Address): Promise<bigint>;
|
|
54
|
+
get Balance(): Promise<bigint>;
|
|
53
55
|
get balances(): Promise<{
|
|
54
56
|
[index: string]: bigint;
|
|
55
57
|
}>;
|
package/exports/chain.js
CHANGED
|
@@ -2147,6 +2147,12 @@ class Chain extends VersionControl {
|
|
|
2147
2147
|
transfer(from, to, amount) {
|
|
2148
2148
|
return this.call(addresses.nativeToken, 'transfer', [from, to, amount]);
|
|
2149
2149
|
}
|
|
2150
|
+
BalanceOf(address) {
|
|
2151
|
+
return this.staticCall(addresses.nativeToken, 'balanceOf', [address]);
|
|
2152
|
+
}
|
|
2153
|
+
get Balance() {
|
|
2154
|
+
return this.staticCall(addresses.nativeToken, 'balanceOf', [globalThis.peernet.selectedAccount]);
|
|
2155
|
+
}
|
|
2150
2156
|
get balances() {
|
|
2151
2157
|
return this.staticCall(addresses.nativeToken, 'balances');
|
|
2152
2158
|
}
|