@aurigami/sdk 1.11.0-beta4 → 1.11.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/interactors/PlyGame.d.ts +0 -5
- package/dist/sdk.cjs.development.js +40 -92
- package/dist/sdk.cjs.development.js.map +1 -1
- package/dist/sdk.cjs.production.min.js +1 -1
- package/dist/sdk.cjs.production.min.js.map +1 -1
- package/dist/sdk.esm.js +40 -92
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/consts/constants.ts +1 -1
- package/src/interactors/PlyGame.ts +4 -14
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.11.0
|
|
2
|
+
"version": "1.11.0",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"typescript": "^4.5.4"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@aurigami/contracts": "3.12.0-beta-
|
|
65
|
+
"@aurigami/contracts": "3.12.0-beta-4",
|
|
66
66
|
"axios": "^0.26.1",
|
|
67
67
|
"bignumber.js": "^9.0.2",
|
|
68
68
|
"ethers": "^5.6.4"
|
package/src/consts/constants.ts
CHANGED
|
@@ -90,7 +90,7 @@ export const networkAddresses: NetworkAddresses = {
|
|
|
90
90
|
PLY_TOKEN_LOCK: MAINNET_ADDRESSES.plyTokenLock.toLowerCase(),
|
|
91
91
|
REFERRAL: MAINNET_ADDRESSES.referralDirectory.toLowerCase(),
|
|
92
92
|
AURI_INTERNAL_LENS: MAINNET_ADDRESSES.auriInternalLens.toLowerCase(),
|
|
93
|
-
PLYGAME:
|
|
93
|
+
PLYGAME: MAINNET_ADDRESSES.plyGame.toLowerCase(),
|
|
94
94
|
},
|
|
95
95
|
tokens: {
|
|
96
96
|
AURORA: '0x8bec47865ade3b172a928df8f990bc7f2a3b9f79'.toLowerCase(),
|
|
@@ -76,17 +76,15 @@ export class PlyGameRead extends BlockchainEntityRead {
|
|
|
76
76
|
return new TokenAmount(this.plyToken, jackpot.toString());
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
public async nextJackpotRevealTime(): Promise<number> {
|
|
80
|
-
return 0; // TODO: TBD
|
|
81
|
-
}
|
|
82
|
-
|
|
83
79
|
public async earlyUnlockedPulpAmount(user: Address): Promise<TokenAmount> {
|
|
84
80
|
let earlyUnlockedPulpAmount = await this.env.plygame.totalPlyUnlockedEarly(user);
|
|
85
81
|
return new TokenAmount(this.pulpToken, earlyUnlockedPulpAmount.toString());
|
|
86
82
|
}
|
|
87
83
|
|
|
88
84
|
public async getPlyGameResultsInTransaction(txHash: Address): Promise<PlyGameBetResult[]> {
|
|
89
|
-
|
|
85
|
+
// wait for the tx to be mined if needed.
|
|
86
|
+
let tx = await this._networkConnection.provider.waitForTransaction(txHash, 1);
|
|
87
|
+
|
|
90
88
|
let filter = this.env.plygame.filters.BetMade();
|
|
91
89
|
let betMadeEvents: PlyBetMadeEvent[] = tx.logs
|
|
92
90
|
.filter((log) => isSameAddress(log.topics[0], filter.topics![0] as string))
|
|
@@ -113,15 +111,6 @@ export class PlyGameRead extends BlockchainEntityRead {
|
|
|
113
111
|
}
|
|
114
112
|
|
|
115
113
|
export class PlyGameReadWrite extends PlyGameRead {
|
|
116
|
-
/**
|
|
117
|
-
* makes "times" independent bets, but consecutively, of the same amount
|
|
118
|
-
*/
|
|
119
|
-
public async makeBetMultiple(amount: TokenAmount, times: number): Promise<TransactionResponse> {
|
|
120
|
-
return this.env.plygame
|
|
121
|
-
.connect(this._networkConnection.signer!)
|
|
122
|
-
.makeBetMultiple(amount.rawAmount(), times);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
114
|
/**
|
|
126
115
|
* Make a single bet
|
|
127
116
|
*/
|
|
@@ -130,6 +119,7 @@ export class PlyGameReadWrite extends PlyGameRead {
|
|
|
130
119
|
.connect(this._networkConnection.signer!)
|
|
131
120
|
.makeBetOnce(amount.rawAmount());
|
|
132
121
|
}
|
|
122
|
+
|
|
133
123
|
public async approve(amount: TokenAmount): Promise<TransactionResponse> {
|
|
134
124
|
return this.env.ply
|
|
135
125
|
.connect(this._networkConnection.signer!)
|