- Name in Remix:
contentImport
- kind:
contentImport
Type | Name | Description |
---|---|---|
method | resolve |
Resolve a file from github, ipfs, swarm, http or https |
method | resolveAndSave |
Resolve a file from github, ipfs, swarm, http or https and save it in the file explorer |
resolve
: Resolve a file from github, ipfs, swarm, http or https
const link = "https://github.com/GrandSchtroumpf/solidity-school/blob/master/std-0/1_HelloWorld/HelloWorld.sol"
const { content } = await client.call('contentImport', 'resolve', link)
// OR
const { content } = await client.contentImport.resolve(link)
resolveAndSave
: Resolve and save a file from github, ipfs, swarm, http or https
const link = "https://github.com/GrandSchtroumpf/solidity-school/blob/master/std-0/1_HelloWorld/HelloWorld.sol"
const targetPath = 'HelloWorld.sol' # optional
const { content } = await client.call('contentImport', 'resolveAndSave', link, targetPath)
// OR
const { content } = await client.contentImport.resolveAndSave(link, targetPath)
ContentImport
: An object that describes the returned file
export interface ContentImport {
content: string
cleanUrl: string
type: 'github' | 'http' | 'https' | 'swarm' | 'ipfs'
url: string
}
Type Definitions can be found here