payment-kit 1.13.218 → 1.13.220
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.
|
@@ -175,7 +175,7 @@ export async function checkStakeRevokeTx() {
|
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
export async function getStakeSummaryByDid(did: string, livemode: boolean): Promise<GroupedBN> {
|
|
178
|
+
export async function getStakeSummaryByDid(did: string, livemode: boolean = true): Promise<GroupedBN> {
|
|
179
179
|
const methods = await PaymentMethod.findAll({
|
|
180
180
|
where: { type: 'arcblock', livemode },
|
|
181
181
|
include: [{ model: PaymentCurrency, as: 'payment_currencies' }],
|
|
@@ -203,7 +203,11 @@ export async function getStakeSummaryByDid(did: string, livemode: boolean): Prom
|
|
|
203
203
|
return results;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
export async function getTokenSummaryByDid(
|
|
206
|
+
export async function getTokenSummaryByDid(
|
|
207
|
+
did: string,
|
|
208
|
+
livemode: boolean,
|
|
209
|
+
type: string = 'arcblock'
|
|
210
|
+
): Promise<GroupedBN> {
|
|
207
211
|
const methods = await PaymentMethod.findAll({
|
|
208
212
|
where: { type, livemode },
|
|
209
213
|
include: [{ model: PaymentCurrency, as: 'payment_currencies' }],
|
|
@@ -49,6 +49,10 @@ export default {
|
|
|
49
49
|
description: `Pay all past due invoices for ${subscriptionId}`,
|
|
50
50
|
partialTx: { from: userDid, pk: userPk, itx },
|
|
51
51
|
requirement: { tokens },
|
|
52
|
+
chainInfo: {
|
|
53
|
+
host: paymentMethod.settings?.arcblock?.api_host as string,
|
|
54
|
+
id: paymentMethod.settings?.arcblock?.chain_id as string,
|
|
55
|
+
},
|
|
52
56
|
},
|
|
53
57
|
};
|
|
54
58
|
|
|
@@ -45,6 +45,10 @@ export default {
|
|
|
45
45
|
description: `Pay for invoice ${invoice.number}`,
|
|
46
46
|
partialTx: { from: userDid, pk: userPk, itx },
|
|
47
47
|
requirement: { tokens },
|
|
48
|
+
chainInfo: {
|
|
49
|
+
host: paymentMethod.settings?.arcblock?.api_host as string,
|
|
50
|
+
id: paymentMethod.settings?.arcblock?.chain_id as string,
|
|
51
|
+
},
|
|
48
52
|
},
|
|
49
53
|
};
|
|
50
54
|
|
|
@@ -54,6 +54,10 @@ export default {
|
|
|
54
54
|
description: `Approve the transfer to complete payment ${paymentIntent.id}`,
|
|
55
55
|
partialTx: { from: userDid, pk: userPk, itx },
|
|
56
56
|
requirement: { tokens },
|
|
57
|
+
chainInfo: {
|
|
58
|
+
host: paymentMethod.settings?.arcblock?.api_host as string,
|
|
59
|
+
id: paymentMethod.settings?.arcblock?.chain_id as string,
|
|
60
|
+
},
|
|
57
61
|
},
|
|
58
62
|
};
|
|
59
63
|
}
|
|
@@ -544,7 +544,7 @@ export async function ensureInvoiceForCollect(invoiceId: string) {
|
|
|
544
544
|
}
|
|
545
545
|
|
|
546
546
|
export function getAuthPrincipalClaim(method: PaymentMethod, action: string) {
|
|
547
|
-
let chainInfo = { type: '
|
|
547
|
+
let chainInfo = { type: 'none', id: 'none', host: 'none' };
|
|
548
548
|
if (method.type === 'arcblock') {
|
|
549
549
|
chainInfo = {
|
|
550
550
|
type: 'arcblock',
|
|
@@ -623,6 +623,10 @@ export async function getDelegationTxClaim({
|
|
|
623
623
|
purpose: 'delegation',
|
|
624
624
|
address,
|
|
625
625
|
},
|
|
626
|
+
chainInfo: {
|
|
627
|
+
host: paymentMethod.settings?.arcblock?.api_host as string,
|
|
628
|
+
id: paymentMethod.settings?.arcblock?.chain_id as string,
|
|
629
|
+
},
|
|
626
630
|
};
|
|
627
631
|
}
|
|
628
632
|
|
|
@@ -719,6 +723,10 @@ export async function getStakeTxClaim({
|
|
|
719
723
|
purpose: 'staking',
|
|
720
724
|
address,
|
|
721
725
|
},
|
|
726
|
+
chainInfo: {
|
|
727
|
+
host: paymentMethod.settings?.arcblock?.api_host as string,
|
|
728
|
+
id: paymentMethod.settings?.arcblock?.chain_id as string,
|
|
729
|
+
},
|
|
722
730
|
};
|
|
723
731
|
}
|
|
724
732
|
|
package/blocklet.yml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "payment-kit",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.220",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "cross-env COMPONENT_STORE_URL=https://test.store.blocklet.dev blocklet dev --open",
|
|
6
6
|
"eject": "vite eject",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"clean": "node scripts/build-clean.js",
|
|
14
14
|
"bundle": "tsc --noEmit && npm run bundle:client && npm run bundle:api",
|
|
15
15
|
"bundle:client": "vite build",
|
|
16
|
-
"bundle:api": "npm run clean && tsc -p tsconfig.api.json && blocklet bundle --compact --
|
|
16
|
+
"bundle:api": "npm run clean && tsc -p tsconfig.api.json && blocklet bundle --compact --monorepo --create-release --changelog",
|
|
17
17
|
"build": "npm run clean && tsc -p tsconfig.api.json && npm run bundle:client",
|
|
18
18
|
"types": "rm -rf types && tsc -p tsconfig.types.json && rm -f ../../packages/types/lib/*.d.ts && cp -f types/store/models/*.d.ts ../../packages/types/lib",
|
|
19
19
|
"deploy": "npm run bundle && blocklet deploy .blocklet/bundle",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@arcblock/ux": "^2.9.66",
|
|
52
52
|
"@arcblock/validator": "^1.18.115",
|
|
53
53
|
"@blocklet/logger": "1.16.25",
|
|
54
|
-
"@blocklet/payment-react": "1.13.
|
|
54
|
+
"@blocklet/payment-react": "1.13.220",
|
|
55
55
|
"@blocklet/sdk": "1.16.25",
|
|
56
56
|
"@blocklet/ui-react": "^2.9.66",
|
|
57
57
|
"@blocklet/uploader": "^0.0.76",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"devDependencies": {
|
|
118
118
|
"@abtnode/types": "1.16.25",
|
|
119
119
|
"@arcblock/eslint-config-ts": "^0.3.0",
|
|
120
|
-
"@blocklet/payment-types": "1.13.
|
|
120
|
+
"@blocklet/payment-types": "1.13.220",
|
|
121
121
|
"@types/cookie-parser": "^1.4.6",
|
|
122
122
|
"@types/cors": "^2.8.17",
|
|
123
123
|
"@types/dotenv-flow": "^3.3.3",
|
|
@@ -156,5 +156,5 @@
|
|
|
156
156
|
"parser": "typescript"
|
|
157
157
|
}
|
|
158
158
|
},
|
|
159
|
-
"gitHead": "
|
|
159
|
+
"gitHead": "5b7f937e70f8cb2000e0cfab0b404f42d46bf5a5"
|
|
160
160
|
}
|