Skip to content

Commit

Permalink
refactor: change to getDefaultAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
yoojinko committed Sep 12, 2023
1 parent 2ef3217 commit 6a2f101
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/modules/service/depositService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { HISTORY_TYPE } from "../../types/type";
export default class DepositService extends ServiceBase {
async requestDeposit(appName: string, amount: number, userAddress?: string) {
const transferKey = Date.now();
userAddress = userAddress ? userAddress : this.wallet.getDefaultAccount();
userAddress = userAddress ? userAddress : this.wallet.getDefaultAddress();
const depositAddress = await this.getDepositAddress(appName);

const op_list: SetOperation[] = [
Expand Down
4 changes: 2 additions & 2 deletions src/modules/service/useService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import ServiceBase from "./serviceBase";
export default class UseService extends ServiceBase{
async writeRequest(appName: string, serviceName: string, value: string, requesterAddress?: string) {
const requestKey = Date.now();
requesterAddress = requesterAddress ? requesterAddress : this.wallet.getDefaultAccount();
requesterAddress = requesterAddress ? requesterAddress : this.wallet.getDefaultAddress();
const requestPath = Path.app(appName).request(serviceName, requesterAddress, requestKey);
const requestData = {
prompt: value,
Expand All @@ -19,7 +19,7 @@ export default class UseService extends ServiceBase{
}

async calculateCostAndCheckBalance(appName: string, serviceName: string, value: string, requesterAddress?: string) {
requesterAddress = requesterAddress ? requesterAddress : this.wallet.getDefaultAccount();
requesterAddress = requesterAddress ? requesterAddress : this.wallet.getDefaultAddress();
const billingConfig = await this.app.getBillingConfig(appName);
// TODO(woojae): calculate cost more accurately
let serviceBillingConfig = billingConfig.service.default;
Expand Down

0 comments on commit 6a2f101

Please sign in to comment.