@reyaxyz/community-sdk 0.52.31 → 0.52.33
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/modules/vltz/index.js +1 -1
- package/dist/modules/vltz/index.js.map +1 -1
- package/dist/modules/vltz/types.js.map +1 -1
- package/dist/types/modules/vltz/index.d.ts.map +1 -1
- package/dist/types/modules/vltz/types.d.ts +1 -0
- package/dist/types/modules/vltz/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/modules/vltz/index.ts +1 -2
- package/src/modules/vltz/types.ts +1 -0
|
@@ -88,7 +88,7 @@ var VltzModule = /** @class */ (function (_super) {
|
|
|
88
88
|
throw new Error('Network not supported. Switch to Ethereum.');
|
|
89
89
|
}
|
|
90
90
|
_b = (0, encode_1.encodeMint)(walletAddress, scaledAllocation, params.merkleProof, params.merkleRoot), data = _b.calldata, value = _b.value;
|
|
91
|
-
return [4 /*yield*/, (0, common_1.executeTransaction)(params.signer, data, value, chainId,
|
|
91
|
+
return [4 /*yield*/, (0, common_1.executeTransaction)(params.signer, data, value, chainId, params.contractAddress)];
|
|
92
92
|
case 3:
|
|
93
93
|
result = _c.sent();
|
|
94
94
|
return [2 /*return*/, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/vltz/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/vltz/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAKyB;AASzB,0CAAmD;AACnD,mCAAsC;AAEtC;IAAwC,8BAAU;IAGhD,oBAAY,MAAc,EAAE,cAAuB;QACjD,YAAA,MAAK,YAAC,MAAM,CAAC,SAAC;QAHhB,o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EAAE,CAAE,CAAC;wBACpC,qBAAM,IAAI,CAAC,GAAG,CAAsB,GAAG,CAAC,EAAA;4BAA/C,sBAAO,SAAwC,EAAC;;;;KACjD;IAGK,sCAAiB,GAAjB,UAAkB,MAA4B;;;;;;wBAC5C,GAAG,GAAG,2BAAoB,MAAM,CAAC,OAAO,cAAI,MAAM,CAAC,OAAO,CAAE,CAAC;wBAC5D,qBAAM,IAAI,CAAC,GAAG,CAAuB,GAAG,CAAC,EAAA;4BAAhD,sBAAO,SAAyC,EAAC;;;;KAClD;IA/CK;QADL,IAAA,eAAM,EAAC,iBAAiB,CAAC;0CAmCzB;IAIK;QADL,IAAA,eAAM,EAAC,6BAA6B,CAAC;sDAIrC;IAGK;QADL,IAAA,eAAM,EAAC,8BAA8B,CAAC;uDAItC;IACH,iBAAC;CAAA,AA1DD,CAAwC,mBAAU,GA0DjD;kBA1DoB,UAAU","sourcesContent":["import {\n executeTransaction,\n MoneyInOutChainId,\n RestClient,\n scale,\n} from '@reyaxyz/common';\nimport {\n VltzMintResult,\n VltzMintParams,\n VltzRoundInfoResult,\n VltzRoundInfoParams,\n VltzWalletInfoParams,\n VltzWalletInfoResult,\n} from './types';\nimport { Logger, Loggable } from '@reyaxyz/common';\nimport { encodeMint } from './encode';\n\nexport default class VltzModule extends RestClient implements Loggable {\n loggingEnabled: boolean = false;\n\n constructor(apiUrl: string, loggingEnabled: boolean) {\n super(apiUrl);\n this.loggingEnabled = loggingEnabled;\n }\n\n // WRITE\n @Logger('VltzModule.mint')\n async mint(params: VltzMintParams): Promise<VltzMintResult> {\n const network = await params.signer.provider?.getNetwork();\n const chainId: MoneyInOutChainId = Number(network?.chainId);\n const walletAddress = await params.signer.getAddress();\n\n const scaledAllocation = scale(18)(Number(params.allocation)).toString();\n\n if (\n !(\n chainId === MoneyInOutChainId.ethereumSepolia ||\n chainId === MoneyInOutChainId.ethereumMainnet\n )\n ) {\n throw new Error('Network not supported. Switch to Ethereum.');\n }\n\n const { calldata: data, value } = encodeMint(\n walletAddress,\n scaledAllocation,\n params.merkleProof,\n params.merkleRoot,\n );\n\n const result = await executeTransaction(\n params.signer,\n data,\n value,\n chainId,\n params.contractAddress,\n );\n\n return {\n transactionHash: result?.hash || null,\n };\n }\n\n // READ\n @Logger('VltzModule.getVltzRoundInfo')\n async getVltzRoundInfo(params: VltzRoundInfoParams) {\n const uri = `/api/vltz/round/${params.id}`;\n return await this.get<VltzRoundInfoResult>(uri);\n }\n\n @Logger('VltzModule.getVltzWalletInfo')\n async getVltzWalletInfo(params: VltzWalletInfoParams) {\n const uri = `/api/vltz/wallet/${params.address}/${params.roundId}`;\n return await this.get<VltzWalletInfoResult>(uri);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["modules/vltz/types.ts"],"names":[],"mappings":"","sourcesContent":["import { VltzRoundInfo, VltzWalletInfo } from '@reyaxyz/common';\nimport { Signer } from 'ethers';\n\nexport type VltzMintResult = {\n transactionHash: string | null;\n};\nexport type VltzMintParams = {\n signer: Signer;\n allocation: number;\n merkleRoot: string;\n merkleProof: string[];\n};\n\nexport type VltzRoundInfoParams = {\n id: string;\n};\n\nexport type VltzRoundInfoResult = VltzRoundInfo;\n\nexport type VltzWalletInfoParams = {\n address: string;\n roundId: string;\n};\n\nexport type VltzWalletInfoResult = VltzWalletInfo;\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["modules/vltz/types.ts"],"names":[],"mappings":"","sourcesContent":["import { VltzRoundInfo, VltzWalletInfo } from '@reyaxyz/common';\nimport { Signer } from 'ethers';\n\nexport type VltzMintResult = {\n transactionHash: string | null;\n};\nexport type VltzMintParams = {\n signer: Signer;\n allocation: number;\n merkleRoot: string;\n merkleProof: string[];\n contractAddress: string;\n};\n\nexport type VltzRoundInfoParams = {\n id: string;\n};\n\nexport type VltzRoundInfoResult = VltzRoundInfo;\n\nexport type VltzWalletInfoParams = {\n address: string;\n roundId: string;\n};\n\nexport type VltzWalletInfoResult = VltzWalletInfo;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/vltz/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/vltz/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAEX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,cAAc,EACd,cAAc,EAEd,mBAAmB,EACnB,oBAAoB,EAErB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAU,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGnD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,UAAW,YAAW,QAAQ;IACpE,cAAc,EAAE,OAAO,CAAS;gBAEpB,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO;IAO7C,IAAI,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;IAsCrD,gBAAgB,CAAC,MAAM,EAAE,mBAAmB;IAM5C,iBAAiB,CAAC,MAAM,EAAE,oBAAoB;CAIrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["modules/vltz/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,MAAM,cAAc,GAAG;IAC3B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC;AACF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["modules/vltz/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,MAAM,cAAc,GAAG;IAC3B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC;AACF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAEhD,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reyaxyz/community-sdk",
|
|
3
|
-
"version": "0.52.
|
|
3
|
+
"version": "0.52.33",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"url": "https://github.com/Reya-Labs/reya-off-chain-monorepo.git"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@reyaxyz/common": "0.310.
|
|
14
|
-
"@reyaxyz/sdk": "0.136.
|
|
13
|
+
"@reyaxyz/common": "0.310.3",
|
|
14
|
+
"@reyaxyz/sdk": "0.136.16",
|
|
15
15
|
"ethers": "6.9.0"
|
|
16
16
|
},
|
|
17
17
|
"main": "dist/index.js",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"generate:coverage-badges": "npx istanbul-badges-readme --silent"
|
|
39
39
|
},
|
|
40
40
|
"packageManager": "pnpm@8.3.1",
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "fd97edccdc28ca41655e1290f3b3f43d6f3a7e6e"
|
|
42
42
|
}
|
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
MoneyInOutChainId,
|
|
4
4
|
RestClient,
|
|
5
5
|
scale,
|
|
6
|
-
VLTZ_MINTING_DETAILS,
|
|
7
6
|
} from '@reyaxyz/common';
|
|
8
7
|
import {
|
|
9
8
|
VltzMintResult,
|
|
@@ -54,7 +53,7 @@ export default class VltzModule extends RestClient implements Loggable {
|
|
|
54
53
|
data,
|
|
55
54
|
value,
|
|
56
55
|
chainId,
|
|
57
|
-
|
|
56
|
+
params.contractAddress,
|
|
58
57
|
);
|
|
59
58
|
|
|
60
59
|
return {
|