summaryrefslogtreecommitdiff
path: root/src/wallet.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-03-03 15:37:04 +0100
committerFlorian Dold <florian.dold@gmail.com>2017-03-03 15:37:17 +0100
commit16371276588b34769a09d940e608426b06ec3163 (patch)
treea3ac6a169502797cfa0145e726f9b7da0edf30bc /src/wallet.ts
parentac342628533ddf1922c050d9c37428d73538d8d6 (diff)
downloadwallet-core-16371276588b34769a09d940e608426b06ec3163.tar.gz
wallet-core-16371276588b34769a09d940e608426b06ec3163.tar.bz2
wallet-core-16371276588b34769a09d940e608426b06ec3163.zip
have from contract, remove extended contract query
Diffstat (limited to 'src/wallet.ts')
-rw-r--r--src/wallet.ts26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/wallet.ts b/src/wallet.ts
index 01d26c297..50febf946 100644
--- a/src/wallet.ts
+++ b/src/wallet.ts
@@ -669,27 +669,13 @@ export class Wallet {
/**
- * Retrieve all necessary information for looking up the contract
- * with the given hash.
+ * Retrieve information required to pay for a contract, where the
+ * contract is identified via the fulfillment url.
*/
- async queryPayment(query: any): Promise<any> {
- let t: TransactionRecord | undefined;
-
- console.log("query for payment", query);
-
- switch (query.type) {
- case "fulfillment_url":
- t = await this.q().getIndexed(Stores.transactions.fulfillmentUrlIndex, query.value);
- break;
- case "order_id":
- t = await this.q().getIndexed(Stores.transactions.orderIdIndex, query.value);
- break;
- case "hash":
- t = await this.q().get<TransactionRecord>(Stores.transactions, query.value);
- break;
- default:
- throw Error("invalid type");
- }
+ async queryPayment(url: string): Promise<any> {
+ console.log("query for payment", url);
+
+ const t = await this.q().getIndexed(Stores.transactions.fulfillmentUrlIndex, url);
if (!t) {
console.log("query for payment failed");