apollo-link-ethereum
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -24,3 +24,2 @@ (function (global, factory) { | ||
} | ||
//# sourceMappingURL=removeContractSetsFromDocument.js.map | ||
@@ -166,3 +165,2 @@ // See https://github.com/apollographql/apollo-client/blob/master/packages/graphql-anywhere/src/graphql.ts | ||
} | ||
//# sourceMappingURL=graphql.js.map | ||
@@ -206,3 +204,2 @@ function promiseEntry(promise) { | ||
} | ||
//# sourceMappingURL=resolvePromises.js.map | ||
@@ -225,5 +222,5 @@ var __extends = (undefined && undefined.__extends) || (function () { | ||
__extends(ContractLink, _super); | ||
function ContractLink(web3Resolver) { | ||
function ContractLink(EthereumResolver) { | ||
var _this = _super.call(this) || this; | ||
_this.web3Resolver = web3Resolver; | ||
_this.EthereumResolver = EthereumResolver; | ||
return _this; | ||
@@ -259,3 +256,3 @@ } | ||
else if (contract) { | ||
var entry = promiseEntry(_this.web3Resolver.resolve(contract, contractDirectives, fieldName, args, info.directives)); | ||
var entry = promiseEntry(_this.EthereumResolver.resolve(contract, contractDirectives, fieldName, args, info.directives)); | ||
promises.push(entry.promise); | ||
@@ -334,7 +331,7 @@ return entry; | ||
}(apolloLink.ApolloLink)); | ||
//# sourceMappingURL=ContractLink.js.map | ||
var AbiMapping = /** @class */ (function () { | ||
function AbiMapping() { | ||
this.mapping = {}; | ||
this.abiMapping = {}; | ||
this.addressMapping = {}; | ||
} | ||
@@ -348,10 +345,15 @@ AbiMapping.prototype.addAbi = function (name, abiDefinition) { | ||
} | ||
this.mapping[name] = abiDefinition; | ||
this.abiMapping[name] = abiDefinition; | ||
}; | ||
AbiMapping.prototype.getAbi = function (name) { | ||
return this.mapping[name]; | ||
return this.abiMapping[name]; | ||
}; | ||
AbiMapping.prototype.addAddress = function (name, address) { | ||
this.addressMapping[name] = address; | ||
}; | ||
AbiMapping.prototype.getAddress = function (name) { | ||
return this.addressMapping[name]; | ||
}; | ||
return AbiMapping; | ||
}()); | ||
//# sourceMappingURL=AbiMapping.js.map | ||
@@ -375,6 +377,3 @@ var AbiDefinition = /** @class */ (function () { | ||
}()); | ||
//# sourceMappingURL=AbiDefinition.js.map | ||
//# sourceMappingURL=index.js.map | ||
exports.ContractLink = ContractLink; | ||
@@ -381,0 +380,0 @@ exports.AbiMapping = AbiMapping; |
import { AbiDefinition } from './AbiDefinition'; | ||
export declare class AbiMapping { | ||
mapping: object; | ||
abiMapping: object; | ||
addressMapping: object; | ||
constructor(); | ||
addAbi(name: string, abiDefinition: AbiDefinition): void; | ||
getAbi(name: string): AbiDefinition; | ||
addAddress(name: string, address: string): void; | ||
getAddress(name: string): any; | ||
} |
var AbiMapping = /** @class */ (function () { | ||
function AbiMapping() { | ||
this.mapping = {}; | ||
this.abiMapping = {}; | ||
this.addressMapping = {}; | ||
} | ||
@@ -12,7 +13,13 @@ AbiMapping.prototype.addAbi = function (name, abiDefinition) { | ||
} | ||
this.mapping[name] = abiDefinition; | ||
this.abiMapping[name] = abiDefinition; | ||
}; | ||
AbiMapping.prototype.getAbi = function (name) { | ||
return this.mapping[name]; | ||
return this.abiMapping[name]; | ||
}; | ||
AbiMapping.prototype.addAddress = function (name, address) { | ||
this.addressMapping[name] = address; | ||
}; | ||
AbiMapping.prototype.getAddress = function (name) { | ||
return this.addressMapping[name]; | ||
}; | ||
return AbiMapping; | ||
@@ -19,0 +26,0 @@ }()); |
import { Operation, NextLink, Observable, FetchResult, ApolloLink } from 'apollo-link'; | ||
import { Web3Resolver } from './Web3Resolver'; | ||
import { EthereumResolver } from './EthereumResolver'; | ||
export declare class ContractLink extends ApolloLink { | ||
web3Resolver: Web3Resolver; | ||
constructor(web3Resolver?: Web3Resolver); | ||
EthereumResolver: EthereumResolver; | ||
constructor(EthereumResolver?: EthereumResolver); | ||
request(operation: Operation, forward: NextLink): Observable<FetchResult>; | ||
} |
@@ -22,5 +22,5 @@ var __extends = (this && this.__extends) || (function () { | ||
__extends(ContractLink, _super); | ||
function ContractLink(web3Resolver) { | ||
function ContractLink(EthereumResolver) { | ||
var _this = _super.call(this) || this; | ||
_this.web3Resolver = web3Resolver; | ||
_this.EthereumResolver = EthereumResolver; | ||
return _this; | ||
@@ -56,3 +56,3 @@ } | ||
else if (contract) { | ||
var entry = promiseEntry(_this.web3Resolver.resolve(contract, contractDirectives, fieldName, args, info.directives)); | ||
var entry = promiseEntry(_this.EthereumResolver.resolve(contract, contractDirectives, fieldName, args, info.directives)); | ||
promises.push(entry.promise); | ||
@@ -59,0 +59,0 @@ return entry; |
export * from './ContractLink'; | ||
export * from './Web3Resolver'; | ||
export * from './EthereumResolver'; | ||
export * from './AbiMapping'; | ||
export * from './AbiDefinition'; |
{ | ||
"name": "apollo-link-ethereum", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"main": "./dist/bundle.umd.js", | ||
@@ -31,5 +31,6 @@ "modules": "./lib/index.js", | ||
"bundle": "rollup -c", | ||
"dist": "yarn build && yarn bundle", | ||
"watch": "tsc -w -p . & rollup -cw" | ||
}, | ||
"gitHead": "b8b1a7619b2bccd3d8338a6c06608573334fa0eb" | ||
"gitHead": "c992ef8472f818616776c702ae3e32d6afc51ae7" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
476136
36
825