forked from bosagora/dms-osx
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47aab5a
commit 776d9fe
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { BOACoin } from "../src/common/Amount"; | ||
|
||
import "@nomiclabs/hardhat-ethers"; | ||
import * as hre from "hardhat"; | ||
import { INotificationEventHandler, NotificationSender } from "../src/delegator/NotificationSender"; | ||
|
||
import { Config } from "../src/common/Config"; | ||
|
||
async function main() { | ||
const provider = hre.ethers.provider; | ||
const account = "0x9E8549cc1B5b9036AC410Ed11966BB3c6B94A77d"; | ||
const balance = await provider.getBalance(account); | ||
console.log(`${account} : ${new BOACoin(balance).toBOAString()}`); | ||
|
||
const notificationEventHandler: INotificationEventHandler = { | ||
receive: async (to: string, title: string, body: string, data: any) => { | ||
console.log(to, title); | ||
}, | ||
}; | ||
// Create with the arguments and read from file | ||
const config = new Config(); | ||
config.readFromFile("config/config.yaml"); | ||
const notification: NotificationSender = new NotificationSender(config, notificationEventHandler); | ||
|
||
await notification.send( | ||
"ExponentPushToken[gr9g1_GA_54W9mUfYMYPtG]", | ||
"마일리지 사용 취소 알림", | ||
"구매처 : 마이클2, 구매 금액 : 100 PHP, 포인트 사용 : 100 POINT", | ||
{ type: "cancel" } | ||
); | ||
// | ||
// await notification.send( | ||
// "ExponentPushToken[s__I-xJSSmcJCfLRPSobU_]", | ||
// "마일리지 사용 취소 알림", | ||
// "구매처 : 마이클2, 구매 금액 : 100 PHP, 포인트 사용 : 100 POINT", | ||
// { type: "cancel" } | ||
// ); | ||
} | ||
|
||
main().catch((error) => { | ||
console.error(error); | ||
process.exitCode = 1; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters