@cryptorubic/web3 0.0.8 → 0.0.9
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AbstractAdapter } from '@cryptorubic/web3';
|
|
2
2
|
import { BlockchainName, HttpClient, ICustomLogger, Token, TonBlockchainName } from '@cryptorubic/core';
|
|
3
|
-
import { TonClient } from "@ton/ton";
|
|
3
|
+
import { Address, TonClient } from "@ton/ton";
|
|
4
4
|
import { TonApiParseAddressResp } from "./models/tonapi-models";
|
|
5
5
|
import { TonAdapterConfig } from "./models/ton-adapter-config";
|
|
6
6
|
export declare class TonAdapter extends AbstractAdapter<TonClient, TonClient, TonBlockchainName> {
|
|
@@ -11,4 +11,5 @@ export declare class TonAdapter extends AbstractAdapter<TonClient, TonClient, To
|
|
|
11
11
|
read<T>(args: unknown): Promise<T>;
|
|
12
12
|
write(args: unknown): Promise<string>;
|
|
13
13
|
getAllFormatsOfAddress(walletAddress: string): Promise<TonApiParseAddressResp>;
|
|
14
|
+
getWalletAddress(address: Address, contractAddress: Address): Promise<Address>;
|
|
14
15
|
}
|
|
@@ -39,6 +39,12 @@ class TonAdapter extends web3_1.AbstractAdapter {
|
|
|
39
39
|
async getAllFormatsOfAddress(walletAddress) {
|
|
40
40
|
return this.tonApi.getAllFormatsOfAddress(walletAddress);
|
|
41
41
|
}
|
|
42
|
+
async getWalletAddress(address, contractAddress) {
|
|
43
|
+
const addressResult = await this.tonClient.runMethod(contractAddress, 'get_wallet_address', [
|
|
44
|
+
{ cell: (0, ton_1.beginCell)().storeAddress(address).endCell(), type: 'slice' }
|
|
45
|
+
]);
|
|
46
|
+
return addressResult.stack.readAddress();
|
|
47
|
+
}
|
|
42
48
|
}
|
|
43
49
|
exports.TonAdapter = TonAdapter;
|
|
44
50
|
//# sourceMappingURL=ton-adapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ton-adapter.js","sourceRoot":"","sources":["../../../../../../../packages/web3/src/lib/adapter/adapters/ton-adapter.ts"],"names":[],"mappings":";;;AAAA,4CAA8D;AAC9D,4CAQ2B;AAC3B,6DAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"ton-adapter.js","sourceRoot":"","sources":["../../../../../../../packages/web3/src/lib/adapter/adapters/ton-adapter.ts"],"names":[],"mappings":";;;AAAA,4CAA8D;AAC9D,4CAQ2B;AAC3B,6DAAsD;AACtD,kCAAuD;AAIvD,MAAa,UAAW,SAAQ,sBAAwD;IAKpF,YAAY,UAAsB,EAAE,MAAwB,EAAG,MAAsB;QACjF,KAAK,CAAC,sBAAe,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,IAAI,+BAAa,CAAC,UAAU,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;QACjE,IAAI,CAAC,SAAS,GAAG,IAAI,eAAS,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;IAC1D,CAAC;IAEe,KAAK,CAAC,iBAAiB,CAAC,cAAgD;QACpF,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,GAAG,CAC1B,cAAc,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;YAC3B,IAAI,eAAQ,CAAC,eAAe,CAAC,sBAAe,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC;gBACzD,MAAM,WAAW,GAAG,uBAAgB,CAAC,sBAAe,CAAC,GAAG,CAAC,CAAC;gBAC1D,OAAO,WAAW,CAAC;YACvB,CAAC;YACD,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC,CAAC,CACL,CAAC;QACF,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,OAAO,EAAE,CAAC;QAE5B,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAC1B,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM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